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
Review uncommitted changes in the working directory.
Review changes compared to a base branch (e.g.,
main, develop).Review a specific commit by SHA or reference (e.g.,
abc123, HEAD~1).Provide a commit title for context. Only valid with
--commit.Custom review instructions. Use
- to read from stdin.Output
Save the review report to a file.
Output review events as JSON Lines.
Model & Execution
AI model to use for the review.
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