Skip to main content

Before you start

1

Confirm plan access

The non-interactive API-key flow requires an Agentic API key from a CodeRabbit organization where the user has an assigned seat. CLI reviews use the assigned user’s plan allowance first.Enable usage-based reviews if you want eligible over-limit reviews to continue with usage credits after the plan allowance is exhausted.
2

Create an Agentic API key

Open API Keys for your US account or EU account, then generate an Agentic API key for the organization that should power your CLI reviews.API-key authentication always uses that key’s organization for billing and review behavior. Browser-based organization selection does not apply in this mode.
3

Store the key as a secret

Save the key in your automation platform as a secret such as CODERABBIT_API_KEY, then expose it as an environment variable wherever your automation runs.
4

Install the CodeRabbit CLI

Make the CLI available in the environment using your preferred install method.
If coderabbit is not available immediately after installation, start a new shell, or run the exact shell-specific reload command printed under Next steps. If the install script offers browser sign-in without first asking for a region, EU users should skip it and authenticate later with an explicit --region eu.

Headless setup

The CLI uses the US region when no region is specified or saved. Use --region eu with an EU account.
Pass the key directly to the command:
An authenticated login saves the selected region, so later review commands reuse it without another --region flag. coderabbit auth status displays the saved region. For a single-command review, --region must be used together with --api-key.

Common automation patterns

Use --agent when another tool needs structured output:
Plain-text output is the default. Use the default review command when you want readable logs in the workflow output:
If your workflow edits code in place and wants feedback on staged and tracked local edits, use --uncommitted.
If your workflow creates new files without staging them, add --include-untracked.
If your workflow compares a branch against a base branch, set the base explicitly:
With CLI 0.7.7 or later, automation can review an installed GitHub repository without checking it out:
Authenticate first using the key for the organization where the repository is installed. The command uses repository content on GitHub and does not upload local files or save local review history. See remote reviews for access requirements, supported refs, and file limits. cr is the short alias for coderabbit, so cr review --agent and coderabbit review --agent work the same way. If the review scope has no file changes, the CLI exits cleanly. In --agent mode the complete event has status: "review_skipped" and findings: 0. Starting with CLI 0.7.7, failed or incomplete reviews exit with code 1, even if some findings were already emitted. Check the process exit code as well as the output stream before treating a run as complete. Local reviews preserve received findings and the last successful incremental checkpoint for a retry. See failed or incomplete reviews.

Troubleshooting

If authentication fails with a message saying user API keys are not supported, generate an Agentic API key instead. The CLI validates the key before storing it locally and rejects unsupported key types.
If a later review step says no stored API key was found, make sure the coderabbit auth login --api-key step ran successfully earlier in the same environment and that the secret was exposed to that step.

What’s next

Usage-based reviews

Enable credits, manage billing, and understand how CLI reviews consume usage

CLI Command Reference

Review authentication commands, review modes, and CLI options

Codex integration

Combine headless CLI authentication with Codex-driven implementation and review loops