Commands
cr is the short alias for coderabbit. Both work identically — use whichever fits your workflow.
Review modes
Review scope
cr review reviews tracked changes by default: committed changes, staged changes (including new files added with git add), and unstaged edits to tracked files.
New files are included once staged with
git add. To review them before staging, use --include-untracked. You can combine it with --uncommitted, but not with --committed. Contradictory scope flags, such as --committed with --uncommitted, are rejected before a review starts.--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.
Finding events use these fields:
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.
When the selected review scope is skipped because it contains too many files, the review fails with an error event. The event can include these optional, additive fields:
These fields do not change the existing error contract, so integrations do not need to handle them. Candidates are alternatives, not an automatic partition of the full change set. The CLI does not select a candidate or retry the review. The user or agent must choose one suggestion and rerun the narrower command manually.
In plain mode, the same failure can print a Narrower scopes found in this diff block with concrete commands, estimated file counts, and fit indicators. The CLI does not increase the limit, split the review, or retry automatically; choose one command and rerun it manually.
When the selected review scope has no file changes,
cr review --agent still emits the review_context event, then emits a status event with status: "review_skipped" and a complete event with status: "review_skipped", findings: 0, and message: "No changes detected". Plain mode prints a no-changes message and exits without starting a review.
Diagnostics
Runcr 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.
Configuration validation
Usecr config validate to check a CodeRabbit YAML file before committing or deploying it.
.coderabbit.yaml, then .coderabbit.yml. With a file argument, it validates that path instead.
The command checks YAML syntax first, then fetches the current official schema and validates the parsed configuration. Errors identify the affected line, configuration path, and expected value when available.
For browser-based validation, use the interactive YAML validator.
Skills command
Runcr skills in an interactive terminal to install or update CodeRabbit skills for detected Codex, Claude Code, Cursor, Gemini CLI, and GitHub Copilot setups. The command verifies the latest published skills release, previews every planned path and change, and asks once for confirmation with No selected by default.
Stats command
Usage command
Runcr usage to show your review count, usage-billing status, and, when available, spend and the reset date for the current billing period. cr review --usage and cr --usage are aliases that show the same report instead of starting a review.
The usage command requires authentication and is not available for self-hosted logins.
Session handoff commands
Use session handoff commands to move coding-session summaries between local and cloud agents.Feedback command
When feedback is enabled for your account, usecr feedback "<message>" to report a wrong, confusing, or useful review finding. Add --agent to emit structured JSON output for an agent workflow. If the command is unavailable, the CLI reports that it is not enabled for your account.
Agent-friendly auth commands
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.
If your browser-based session is missing or expired, run cr auth login before cr auth org. The organization command does not start login automatically.
Regional authentication
SaaS login uses the US region when no region is specified or saved. For an EU-hosted CodeRabbit account, select EU during browser or API-key login:cr auth status to verify it, or use --region us during login to switch back to US. Self-hosted authentication uses --self-hosted instead of a SaaS region.
For a one-off EU review without storing the API key, pass both options to the review command:
--region unless --api-key is provided. A saved EU login does not need either flag on later reviews.
Options
--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.