Skip to main content
wit includes a powerful code review command powered by CodeRabbit, our AI code review partner. Catch issues before you push.

Overview

The wit review command provides:
  • Pre-push code review to catch issues early
  • Review of uncommitted changes, staged changes, or entire branches
  • CI integration with --strict mode
  • Seamless integration with CodeRabbit’s AI

Quick Start

Setup

Get a CodeRabbit API Key

  1. Sign up at coderabbit.ai
  2. Get your API key from the dashboard
  3. Configure wit:

Check Configuration

Output:

Usage

Review Uncommitted Changes

Review all changes in your working directory (staged and unstaged):
Output:

Review Staged Changes Only

Perfect for pre-commit checks:

Review Branch Changes

Review everything you’ve changed since branching from main:
This compares your current branch against 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:
This exits with code 1 if any critical or high severity issues are found.

Pre-push Hook

Add to .wit/hooks/pre-push (or .git/hooks/pre-push):
Make it executable:
Now every push will be reviewed first!

GitHub Actions

Output Formats

Default (Human-Readable)

JSON Output

For programmatic use:

Verbose Output

Show more detail:

Options Reference

Comparison with wit ai review

wit has two review commands: wit review (CodeRabbit) is recommended for:
  • Team workflows
  • CI/CD pipelines
  • Production code review
  • Consistent review quality

PR Reviews

For pull request reviews, use the wit pr review command:
See Pull Requests for more details.

Tips

  1. Review before pushing: Make wit review --branch --strict part of your pre-push workflow
  2. Focus on critical issues: The --strict flag only fails on critical/high severity issues
  3. Use in CI: Automate reviews on every PR to maintain code quality
  4. Review incrementally: Use --staged to review as you stage changes
  5. Branch-based reviews: --branch gives you the full picture of what you’re about to merge

Troubleshooting

Run the configuration wizard:
Or set the environment variable:
Make sure you have:
  • Uncommitted changes (for default mode)
  • Staged changes (for --staged mode)
  • Commits on your branch (for --branch mode)
Check with wit status first.
Ensure:
  • CODERABBIT_API_KEY is 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
wit’s partnership with CodeRabbit brings enterprise-grade code review to the command line.