Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt

Use this file to discover all available pages before exploring further.

Commands

cr is the short alias for coderabbit. Both work identically — use whichever fits your workflow.
CommandDescription
crRun code review in non-interactive plain text mode (default)
cr --plainOutput detailed feedback in plain text format
cr --interactiveLaunch the interactive terminal review UI
cr --agentOutput structured JSON for agent-driven workflows
cr authAuthentication commands
cr auth loginAuthenticate via browser OAuth, self-hosted (--self-hosted), or API key (--api-key "<key>")
cr auth logoutLog out from CodeRabbit
cr auth statusShow current authentication status
cr auth orgChoose or switch the login/default organization for browser-based auth
cr doctorCheck the CLI installation, local storage, authentication, Git repository state, update policy, and service connectivity
cr reviewAI-driven code reviews with plain text, interactive, or agent output
cr review findingsShow review comments stored locally for the current review context
cr updateCheck for and install the latest CLI version

Review modes

ModeDescription
Default / --plainDetailed plain text feedback in the terminal
--agentStructured JSON output for coding agents and automation
--interactiveBrowsable terminal UI for manual review

--agent review output

cr review --agent writes one JSON object per line to stdout. Read the stream line by line and handle events by their type.
FieldDescription
typeAlways finding for review results
severityOne of: critical, major, minor, trivial, info
fileNameFile path for the finding
codegenInstructionsAgent-oriented fix instructions
suggestionsSuggested fix commands or snippets
commentHuman-readable review comment, included when codegenInstructions is empty
Other event types in the stream include review_context, status, heartbeat, complete, and error. heartbeat events are periodic keep-alive signals — reset timeout timers on receipt and otherwise ignore them. For finding events, use codegenInstructions for agent fix logic and fall back to comment when it is absent.

Diagnostics

Run cr doctor when installation, authentication, or review startup fails. The command checks:
  • CLI runtime and version
  • Local CodeRabbit storage directory
  • Authentication state and auth environment
  • Current Git repository and branch metadata
  • Auto-update policy
  • CodeRabbit backend reachability
  • CodeRabbit WebSocket reachability
cr doctor exits with status code 1 when any check fails. Warnings are shown in the report, but they do not cause a non-zero exit code.

Agent-friendly auth commands

CommandDescription
cr auth login --agentBrowser-based OAuth login with structured JSON events for agents
cr auth logout --agentLog out with structured JSON events for agents
cr auth status --agentReturn authentication status as structured JSON
cr auth org --agentReturn organization data as structured JSON for agent workflows; starts browser OAuth first if needed
For GitHub Actions and other non-interactive environments, use cr auth login --api-key "<key>" and follow the Headless CLI integration guide. cr auth org changes the login/default org for browser-based auth. Review attribution still depends on the current repository, while API-key auth always uses the API key’s organization.

Options

OptionDescription
--plainOutput detailed feedback in plain text format (default)
--agentOutput structured JSON for agent-driven workflows
--interactiveLaunch the interactive review UI
-t, --type <type>Review type: all, committed, uncommitted (default: all)
-c, --config <files...>Additional instructions for CodeRabbit AI (for example, claude.md or coderabbit.yaml)
--base <branch>Base branch for comparison
--base-commit <commit>Base commit on current branch for comparison
--api-key "<key>"Agentic API key for usage-based reviews (auto-detected if logged in via cr auth login --api-key)
--dir <path>Review directory path (must contain an initialized Git repository)
--show-promptsPrint saved AI prompts from the most recent local review without running a new review
--agent is supported in authentication workflows as well as reviews. cr auth login --agent applies to the browser-based OAuth login flow and is not used with --self-hosted or --api-key login.
PR reviews and CLI reviews will differ, even if run on the same code. CLI reviews optimize for immediate feedback during active development, while PR reviews provide comprehensive team collaboration context and broader repository analysis.