Skip to content

OpenAI Codex CLI

The OpenAI Codex CLI harness (codex) runs Codex non-interactively with codex exec --json. Jimothy parses its JSONL event stream, so you see commands, file changes and reasoning live, and token usage is recorded per step. The built-in Feature template uses Codex for its cross-model review step.

Terminal window
npm i -g @openai/codex
codex login # or set OPENAI_API_KEY
codex --version

Then click Re-detect on the Harnesses page.

Field Default
Command codex
Arguments exec --json --full-auto --skip-git-repo-check {{options}} -
Model arguments --model {{model}}
System prompt arguments none (the system prompt is prepended to the prompt)
Subagent arguments none (subagents are ignored, with a note in the log)
Prompt delivery stdin
Output format Codex exec –json (codex-json)
Version check args --version
Model list source Command: debug models
Models gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5
Default model gpt-6-sol

The {{options}} line marks where model arguments go, so with a model selected a step runs:

Terminal window
codex exec --json --full-auto --skip-git-repo-check --model gpt-6-sol - < prompt

The trailing - tells Codex to read the prompt from stdin. --skip-git-repo-check lets Codex run in workspaces that aren’t git repositories (the Empty folder and Existing folder workspace modes).

Codex event Log line
thread.started thread <id> (stored as the step’s session id)
item.started for a command $ <command>
item.completed command exit <code> plus the command output (clipped at 1,500 chars); non-zero exits are shown as errors
agent message assistant text
reasoning thinking
file change edit add src/a.ts, update src/b.ts
MCP tool call mcp <server>.<tool>
web search web search: <query>
turn.completed turn completed · N in / M out tokens
turn.failed / error error, and the step fails

The step Output is the last agent message.

Codex reports tokens (input, output, cached input) per turn, and Jimothy sums them for the step. It does not report a dollar cost, so Codex steps add $0 to the run’s cost figures.

Click Models on the Codex card (or Fetch latest in the editor) to run codex debug models and replace the model list with what your installed Codex offers. Entries marked hidden in that catalog are skipped, and the rest are sorted by Codex’s priority.

A typical review step prompt asks for a verdict line, and the step’s Pass if output matches (regex) is VERDICT:\s*APPROVE with On failure, loop back to the implement step. Codex’s final message becomes {{steps.review.output}}, which the implementer’s prompt can include on the next pass. See Loops & verdicts.