Skip to content

feat(cli): add Codex CLI as a selectable AI tool - #77

Merged
salimomrani merged 1 commit into
masterfrom
016-codex-ai-tool
Apr 24, 2026
Merged

feat(cli): add Codex CLI as a selectable AI tool#77
salimomrani merged 1 commit into
masterfrom
016-codex-ai-tool

Conversation

@salimomrani

Copy link
Copy Markdown
Owner

Summary

  • Adds Codex CLI as a third AI-tool choice in `forgekit new` (Claude / Codex / None) — `ProjectConfig.claudeCode` is replaced by `aiTool: 'claude' | 'codex' | 'none'`.
  • New `CodexGenerator` emits `AGENTS.md` + `.codex/config.toml` + `.codex/rules/{backend,frontend}.md` (Codex doesn't read sub-files; `.codex/rules/` is shipped as a human/IDE convention per explicit user choice).
  • `speckit` (`specify init`) now forwards `--ai claude` or `--ai codex` based on the choice; `speckitPreset` prompt is skipped for Codex (presets are Claude-only).
  • New `isCodexInstalled()` helper, new `forgekit add codex` layer, `--ai-tool` CLI flag.

Test plan

  • `npm run typecheck` — clean
  • `npm run lint` — clean (also added `coverage/` to eslint ignores to unblock a pre-existing failure)
  • `npm test` — full suite green, including new Codex generator suite (9 cases) and expanded speckit suite (4 cases covering claude/codex/none/fail)
  • `npm run build` — clean; `dist/templates/codex/` populated
  • Manual smoke: built CLI prompts "Workflow mode (Codex CLI)" when `--ai-tool codex` is passed

Spec: `specs/016-codex-ai-tool/`.

Replaces ProjectConfig.claudeCode boolean with aiTool enum (claude / codex /
none). Adds a CodexGenerator emitting AGENTS.md, .codex/config.toml, and
.codex/rules/{backend,frontend}.md. The speckit generator now forwards --ai
claude or --ai codex based on the choice and is skipped when aiTool is none.

- New isCodexInstalled() helper mirrors the Claude detection (sync, --help)
- --ai-tool <claude|codex|none> CLI flag replaces --claude-code/--no-claude-code
- forgekit add gains a "codex" layer alongside "claude-code"
- Codex generator owns only its own dir (Constitution §1) and writes the four
  files in parallel (Constitution §10)

Tests: new vitest suite for the Codex generator (9 cases), new isCodexInstalled
suite, expanded speckit suite covering all three aiTool values. Every existing
fixture migrated to declare aiTool explicitly (Constitution §7).

Spec at specs/016-codex-ai-tool/.
@salimomrani
salimomrani merged commit 6556b1b into master Apr 24, 2026
7 checks passed
@salimomrani
salimomrani deleted the 016-codex-ai-tool branch April 24, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant