/cli:codex-review
Interactive code review command that invokes codex review via CCW CLI endpoint with guided parameter selection.
Overview
The /cli:codex-review command provides an interface to Codex's powerful code review capabilities, supporting multiple review targets and customizable review parameters.
Review Parameters
| Parameter | Description |
|---|---|
[PROMPT] | Custom review instructions (positional) |
-c model=<model> | Override model via config |
--uncommitted | Review staged, unstaged, and untracked changes |
--base <BRANCH> | Review changes against base branch |
--commit <SHA> | Review changes introduced by a commit |
--title <TITLE> | Optional commit title for review summary |
Usage
Direct Execution (No Interaction)
# Review uncommitted changes
/cli:codex-review --uncommitted
# Review against main branch
/cli:codex-review --base main
# Review specific commit
/cli:codex-review --commit abc123
# Review with custom model
/cli:codex-review --uncommitted --model o3
# Review with security focus
/cli:codex-review --uncommitted security
# Full options
/cli:codex-review --base main --model o3 --title "Auth Feature" security
Interactive Mode
# Start interactive selection (guided flow)
/cli:codex-review
Review Targets
| Target | Description | Use Case |
|---|---|---|
| Uncommitted | Reviews staged, unstaged, and untracked changes | Quick pre-commit review |
| Base Branch | Reviews changes against specified branch | PR review, branch comparison |
| Commit | Reviews changes introduced by specific commit | Historical commit review |
Focus Areas
| Focus | Description | Key Checks |
|---|---|---|
| General | Comprehensive review | Correctness, style, bugs, documentation |
| Security | Security-first review | Injection vulnerabilities, auth issues, validation, data exposure |
| Performance | Optimization review | Complexity analysis, memory usage, query optimization, caching |
| Code Quality | Maintainability review | SOLID principles, code duplication, naming conventions, test coverage |
Execution Flow
Interactive Mode
- Select Review Target - Choose uncommitted, base branch, or commit
- Select Focus Area - Choose general, security, performance, or code quality
- Configure Options - Set model, title, and custom instructions
- Execute Review - Runs Codex review with selected parameters
- Display Results - Shows structured review findings
Command Construction
# Base structure
ccw cli -p "<PROMPT>" --tool codex --mode review [OPTIONS]
# Example with custom prompt
ccw cli -p "
PURPOSE: Comprehensive code review to identify issues and improve quality
TASK: • Review correctness and logic • Check standards compliance • Identify bugs
MODE: review
CONTEXT: Reviewing uncommitted changes
CONSTRAINTS: Actionable feedback
" --tool codex --mode review --rule analysis-review-code-quality
# Example with target flag only
ccw cli --tool codex --mode review --uncommitted
Prompt Template
Follow the standard CCW CLI prompt template:
PURPOSE: [what] + [why] + [success criteria]
TASK: • [step 1] • [step 2] • [step 3]
MODE: review
CONTEXT: [target description] | Memory: [project context]
EXPECTED: [deliverable format] + [quality criteria]
CONSTRAINTS: [domain constraints]
Validation Constraints
IMPORTANT: Target flags (--uncommitted, --base, --commit) and custom prompt are mutually exclusive.
Valid Combinations
| Command | Result |
|---|---|
codex review "Focus on security" | ✓ Custom prompt, reviews uncommitted (default) |
codex review --uncommitted | ✓ No prompt, uses default review |
codex review --base main | ✓ No prompt, uses default review |
codex review --commit abc123 | ✓ No prompt, uses default review |
Invalid Combinations
| Command | Result |
|---|---|
codex review --uncommitted "prompt" | ✗ Mutually exclusive |
codex review --base main "prompt" | ✗ Mutually exclusive |
codex review --commit abc123 "prompt" | ✗ Mutually exclusive |
Error Handling
No Changes to Review
No changes found for review target. Suggestions:
- For --uncommitted: Make some code changes first
- For --base: Ensure branch exists and has diverged
- For --commit: Verify commit SHA exists
Invalid Branch
# Show available branches
git branch -a --list | head -20
Invalid Commit
# Show recent commits
git log --oneline -10
Examples
Pre-Commit Review
# Quick review before committing
/cli:codex-review --uncommitted
# Output:
# Reviewing 3 files with 45 changes
# - src/auth/login.ts: 2 issues found
# - src/user/profile.ts: 1 issue found
# - tests/auth.test.ts: No issues
Branch Comparison
# Review feature branch against main
/cli:codex-review --base feature-auth
# Shows all differences between branches
Security-Focused Review
# Security review of uncommitted changes
/cli:codex-review --uncommitted "Focus on security vulnerabilities, injection risks, authentication issues"
# Prioritizes security-related findings
Related Commands
- /cli:cli-init - Initialize CLI configuration
- /workflow:review-session-cycle - Session-based code review
- /workflow:review-module-cycle - Module-specific code review
Integration Notes
- Uses
ccw cli --tool codex --mode reviewendpoint - Model passed via prompt (codex uses
-c model=internally) - Target flags passed through to codex
- Prompt follows standard CCW CLI template format
- Results include severity levels, file:line references, and remediation suggestions