## Summary Add Codex CLI (`@openai/codex`) as a third engine option alongside Claude and OpenCode. ## Why - Codex is included with ChatGPT Plus/Pro plans (no separate API billing) - Written in Rust, fast startup - Has both CLI headless mode and TypeScript SDK ## Codex CLI Headless Mode ```bash codex exec "task" # non-interactive codex exec --json "task" # JSONL streaming output codex exec resume --last "continue" # resume sessions ``` ## TypeScript SDK (preferred approach) ```typescript import { Codex } from "@openai/codex-sdk"; const codex = new Codex(); const thread = codex.startThread(); const result = await thread.run("task"); ``` `npm i @openai/codex-sdk` — native async, no subprocess management. ## Key Details - Auth: ChatGPT login or `OPENAI_API_KEY` env var - Default model: `gpt-5.3-codex` - Approval modes: auto (default), read-only, full-access - Config: `~/.codex/config.toml` - Sessions persist and can resume via thread ID - Built-in multi-agent support ## Implementation Plan 1. Add `CodexEngine` class (prefer SDK over shelling out) 2. Config support: `[engine] type = codex` + `[models] codex = gpt-5.3-codex` 3. CLI flag: `sfk --codex` 4. Auth: read `OPENAI_API_KEY` from env or delegate to `codex` login flow 5. Map sfk progress tracking to Codex thread model ## References - Repo: https://github.com/openai/codex - SDK: https://github.com/openai/codex/tree/main/sdk/typescript - Docs: https://developers.openai.com/codex/sdk - CLI features: https://developers.openai.com/codex/cli/features
Activity