Add codex exec review: headless code review
What feature would you like to see?
Why
Enable CI/automation without requiring the interactive TUI.
What
Introduce codex exec review command with presets:
- uncommitted
- base-branch <branch>
- commit <hash> [--subject <subject>]
- custom [PROMPT|-]
How
Reuse existing review flow and emit lifecycle events.
Surface a structured JSON result for machine parsing; keep human mode to final review text on stdout.
Examples
codex exec review uncommitted
codex exec review base-branch main
codex exec review commit d5853d9 --subject "Fix sandbox"
codex exec review custom "Check for security vulnerabilities"
Acceptance
All presets run end-to-end with TUI-equivalent output.
Structured result is CI-friendly and easy to parse; human mode prints only final review content.
Behavior matches current codex review logic.
Note: Implementation ready — opening this issue for visibility and review. Happy to open PR if maintainers are open to this feature.
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I don't think It conflicts with #6023. Using codex as a agent tool or in multi agents scenario, a system prompt will potentially occupy contextual space.
Headless review is already supported via the non-interactive runner:
codex exec review --uncommittedcodex exec review --base maincodex exec review --commit <SHA> --title "..."(title is supported)For CI/multi-agent workflows where you want the final TUI-equivalent review text as a
single blob, use JSONL mode and extract the last agent_message:
This avoids tail truncation (messages are multi-line) and gives a clean machine-consumable
way to grab the final review output.
source: I used codex in the codex repo. only tested uncommitted myself
@ThomasFD I will test codex exec review --base and remove [prompt]
@ThomasFD I’m running headless review in --json mode and trying to capture the final verdict to a file with -o, but it writes an empty file:
I consistently get:
This is a poor experience for CI/multi-agent workflows because I want a single, TUI-equivalent “final review” blob saved to a file without requiring jq/post-processing. Ideally, when -o is provided.
codex exec reviewnow supports uncommitted, base, and commit reviews.