Codex CLI (codex)¶
Codex CLI is OpenAI's agentic coding CLI.
Install¶
npm install -g @openai/codex
Authenticate¶
export OPENAI_API_KEY=sk-...
Codex reads OPENAI_API_KEY from the environment. Add it to your shell profile or a .env file.
Configure in millstone¶
cli = "codex"
codex_yolo = true # optional: pass --yolo to codex
Or target a specific role — for example, using Codex only as the reviewer:
cli = "claude"
cli_reviewer = "codex"
You can also opt into --yolo from the CLI when needed:
millstone --cli codex --codex-yolo
Notes¶
- millstone invokes
codex exec -by default. Add--codex-yoloor setcodex_yolo = trueto pass Codex--yoloexplicitly. - The prompt is delivered via stdin to avoid OS argument-size limits on large prompts.
- Session resume uses
codex exec resume <session_id>. - Structured output (reviewer and sanity check roles) uses
--output-schema <path>with a JSON schema file written to.millstone/.