X Tutup
Skip to main content
This feature is currently in open beta. We are actively improving it based on your feedback. If you encounter any issues or have suggestions, please share them on our Discord community or reach out to our support team.

Review local changes

The CodeRabbit CLI analyzes your uncommitted changes using the same pattern recognition that powers our PR reviews. Review code as you write it, apply suggested fixes instantly, and catch critical issues while you still have full context in memory.

Key features

Review uncommitted changes

Catch bugs before they reach your repository. CodeRabbit scans your working directory for race conditions, null pointer exceptions, and logic errors before you commit.

Apply fixes in one step

Fix simple issues like missing imports or syntax errors instantly. For complex architectural problems, send the full context directly to your AI coding agent.

Context-aware reviews

Paid plans unlock reviews powered by your team’s codebase history: error handling conventions, architectural patterns, and coding preferences applied automatically to every review.

Getting started

1

Install CLI

Download and install the CodeRabbit CLI using your preferred method.
curl -fsSL https://cli.coderabbit.ai/install.sh | sh
After installation, restart your shell or reload your shell configuration:
source ~/.zshrc
2

Authenticate

Link your CodeRabbit account to enable personalized reviews based on your team’s patterns.
# cr is the short alias for coderabbit — both work identically
cr auth login
Follow the browser redirect to sign in and copy the access token back to your CLI.
3

Review your code

Analyze your Git repository for issues using the CodeRabbit CLI.
Git repository required: The CLI must be run from within an initialized Git repository. The --cwd flag changes the working directory but that directory must also contain a Git repository.
cr
If your main branch is not main, specify your base branch:
cr --base develop
# or for other base branches
cr --base master
CodeRabbit scans your working directory and provides specific feedback with suggested fixes.
4

Apply suggestions

Review findings in your terminal and either apply quick fixes or send complex issues to your AI coding agent.

Review modes

The CLI offers different output formats to fit your workflow:
# Interactive mode (default) - full interface with browsable findings
cr

# Plain text mode - detailed feedback with fix suggestions
cr --plain

# Prompt-only mode - minimal output optimized for AI agents
cr --prompt-only

Working with review results

CodeRabbit analyzes your code and surfaces specific issues with actionable suggestions. Each finding includes the problem location, explanation, and recommended fix. Example findings include:
  • Race condition detected: “This goroutine accesses shared state without proper locking”
  • Memory leak potential: “Stream not closed in error path - consider using defer”
  • Security vulnerability: “SQL query uses string concatenation - switch to parameterized queries”
  • Logic error: “Function returns nil without checking error condition first”

Browse and apply suggestions

In interactive mode, use the arrow keys to navigate to a finding and press enter to see the detailed explanation and suggested fix inline in your CLI. For simple issues like missing imports, syntax errors, or formatting problems, choose Apply suggested change to fix immediately.

Use AI coding agents

For AI agent integration, see the AI agent integration section for detailed workflow guidance and integration guides.

Managing comments

  • Ignore: Hide findings you want to address later
  • Restore: Click collapsed findings in the sidebar to show again

AI agent integration

CodeRabbit detects the problems, then your AI coding agent implements the fixes.
Claude Code users: Claude Code now supports CodeRabbit through a native plugin. See the Claude Code integration guide for the recommended plugin-based setup using /coderabbit:review instead of the CLI commands shown below.

Integration guides

See detailed workflows for specific AI coding agents:

CodeRabbit Skills

The fastest way to get started — install agent-native Skills and trigger reviews with natural language: “Review my code.”

Example prompt for your AI agent

Here’s a complete prompt you can use with Cursor, Codex, or other AI coding agents:
Sample prompt
Please implement phase 7.3 of the planning doc and then run cr --prompt-only, let it run as long as it needs (run it in the background) and fix any issues.

Components of a good prompt

Breaking down what makes an effective CodeRabbit + AI agent workflow:
Tell your AI agent to run CodeRabbit with the --prompt-only flag:
cr --prompt-only
You can also specify review types or branches:
# Review only uncommitted changes
cr --prompt-only --type uncommitted

# With specific base branch
cr --prompt-only --base develop
CodeRabbit reviews can take 7-30+ minutes depending on the scope of changes. Instruct your AI agent to run CodeRabbit in the background and set up a timer to check periodically:
Prompt
Run cr --prompt-only --type uncommitted in the background, let it take as long as it needs, and check on it periodically.
Once CodeRabbit completes, have your AI agent evaluate the findings and prioritize:
Prompt
Evaluate the fixes and considerations. Fix major issues only, or fix any critical issues and ignore the nits.
This keeps your agent focused on meaningful improvements rather than minor style issues.
Run CodeRabbit one more time to ensure fixes didn’t introduce new issues:
Prompt
Once those changes are implemented, run cr one more time to make sure we addressed all the critical issues and didn't introduce any additional bugs.
Prevent infinite iteration by setting clear completion criteria:
Prompt
Only run the loop twice. If on the second run you don't find any critical issues, ignore the nits and you're complete. Give me a summary of everything that was completed and why.
This ensures your AI agent completes the task efficiently and provides a clear report.

Pricing and capabilities

Free tier

Basic static analysis with limited daily usage. Catches syntax errors, logic issues, and security vulnerabilities. Perfect for individual developers trying out the CLI workflow.

Paid plans

Enhanced reviews powered by learnings from your codebase history plus higher rate limits and more files per review. Paid users with linked GitHub accounts get:
  • Learnings-powered reviews: Remembers your team’s preferred patterns for error handling, state management, and architecture
  • Full contextual analysis: Understands your imports, dependencies, and project structure
  • Team standards enforcement: Applies your documented coding guidelines automatically
  • Advanced issue detection: Spots subtle race conditions, performance bottlenecks, and security vulnerabilities

Usage-based Add-On (Pay-as-you-Go)

Allows unrestricted access to CodeRabbit CLI
  • Unlimited code reviews across every agentic coding loop
  • Full control over usage and scaling through the dashboard
  • Flexible purchase options (one-time & monthly subscription)
Rate limits without usage-based add-on credits:
PlanReviews per hour
Free3
OSS2
Trial4
Pro8
Enterprise12
Rate limits are per developer seat and subject to change.
Paid users get nearly all PR review features in the CLI, including learnings and contextual analysis. Only chat, docstrings, and unit test generation remain exclusive to PR reviews.
Contact sales@coderabbit.ai for custom rate limits or enterprise needs.

CLI with Usage-based Add-on

1

Buy credits

Go to Subscription and Billing and open the Usage-based add-on tab to purchase credits.For full setup details, see Manage your subscription.
2

Create an Agentic API Key

Once your purchase is complete, navigate to the API Keys section and generate your Agentic API key.
3

Run CodeRabbit via your AI Agent

Prompt your agent to run a CodeRabbit CLI code review with your API key:
cr --plain --api-key "cr-***********"
To avoid passing the key on every command, you can persist it in your shell profile:
~/.zshrc or ~/.bashrc
export CODERABBIT_API_KEY="cr-***********"
Then reference it in your commands:
cr --plain --api-key "$CODERABBIT_API_KEY"

Command reference

See the CLI Command Reference for a complete list of commands and options.

Uninstall

Remove CodeRabbit CLI based on how you installed it.
If installed using install script
rm $(which coderabbit)
If installed using Homebrew
brew remove coderabbit
X Tutup