Commands
cr is the short alias for coderabbit. Both work identically — use whichever fits your workflow.
Review modes
--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.
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 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.
Stats command
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.
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.