Syntax
Description
Thereview command runs Codex in code review mode. You can review uncommitted changes, compare against a base branch, review a specific commit, or provide custom review instructions.
The
review command runs non-interactively like codex exec. Use codex review --help for all available options.Usage
Review Uncommitted Changes
Review Against Base Branch
Compare current branch withmain:
Review Specific Commit
Custom Review Instructions
Provide specific review criteria:Options
Review Target
boolean
Review uncommitted changes in the working directory.
string
Review changes compared to a base branch (e.g.,
main, develop).string
Review a specific commit by SHA or reference (e.g.,
abc123, HEAD~1).string
Provide a commit title for context. Only valid with
--commit.string
Custom review instructions. Use
- to read from stdin.Output
path
Save the review report to a file.
boolean
Output review events as JSON Lines.
Model & Execution
string
AI model to use for the review.
string
Control colored output:
auto, always, never.Examples
Pre-Commit Review
Pull Request Review
Commit Review
Focused Reviews
CI/CD Integration
Pre-Commit Hook
Different Models
Review Output
By default, Codex outputs the review to stderr. Use-o to save to a file:
--json, events are emitted as JSON Lines:
Exit Codes
0- Review completed successfully1- Error occurred during review
Related Commands
codex exec- Non-interactive executioncodex- Interactive mode