Overview
Thewit review command provides:
- Pre-push code review to catch issues early
- Review of uncommitted changes, staged changes, or entire branches
- CI integration with
--strictmode - Seamless integration with CodeRabbit’s AI
Quick Start
Setup
Get a CodeRabbit API Key
- Sign up at coderabbit.ai
- Get your API key from the dashboard
- Configure wit:
Check Configuration
Usage
Review Uncommitted Changes
Review all changes in your working directory (staged and unstaged):Review Staged Changes Only
Perfect for pre-commit checks:Review Branch Changes
Review everything you’ve changed since branching from main:main (or master if main doesn’t exist).
Review Specific Commits
Compare Against Different Branch
CI Integration
Use--strict mode to fail the build if issues are found:
Pre-push Hook
Add to.wit/hooks/pre-push (or .git/hooks/pre-push):
GitHub Actions
Output Formats
Default (Human-Readable)
JSON Output
For programmatic use:Verbose Output
Show more detail:Options Reference
| Option | Description |
|---|---|
--staged | Review only staged changes |
--branch | Review all changes since branching from main |
--commits <range> | Review specific commit range |
--base <branch> | Compare against specific branch (default: main) |
--json | Output as JSON |
--verbose | Show detailed output |
--strict | Exit with error if critical/high issues found |
--configure | Set up CodeRabbit API key |
--status | Show configuration status |
Comparison with wit ai review
wit has two review commands:
| Command | Powered By | Best For |
|---|---|---|
wit review | CodeRabbit | Pre-push review, CI integration, production use |
wit ai review | OpenAI/Anthropic | Quick local review, requires own API key |
wit review (CodeRabbit) is recommended for:
- Team workflows
- CI/CD pipelines
- Production code review
- Consistent review quality
PR Reviews
For pull request reviews, use thewit pr review command:
Tips
-
Review before pushing: Make
wit review --branch --strictpart of your pre-push workflow -
Focus on critical issues: The
--strictflag only fails on critical/high severity issues - Use in CI: Automate reviews on every PR to maintain code quality
-
Review incrementally: Use
--stagedto review as you stage changes -
Branch-based reviews:
--branchgives you the full picture of what you’re about to merge
Troubleshooting
API key not configured
API key not configured
Run the configuration wizard:Or set the environment variable:
No changes to review
No changes to review
Make sure you have:
- Uncommitted changes (for default mode)
- Staged changes (for
--stagedmode) - Commits on your branch (for
--branchmode)
wit status first.Review fails in CI
Review fails in CI
Ensure:
CODERABBIT_API_KEYis set as a secret- Full git history is available (
fetch-depth: 0) - The base branch exists locally
About CodeRabbit
CodeRabbit is an AI-powered code review platform that provides:- Intelligent code analysis
- Security vulnerability detection
- Best practices enforcement
- Consistent review quality across teams