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.

Before you start

1

Enable the Usage-based Add-on

The non-interactive API-key flow requires an Agentic API key. Enable the Usage-based Add-on first so your organization can generate and use one for CLI reviews.
2

Create an Agentic API key

Go to API Keys in the CodeRabbit dashboard and generate an Agentic API key for the organization that should power your CLI reviews.
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.
curl -fsSL https://cli.coderabbit.ai/install.sh | sh

Headless setup

Pass the key directly to the command:
coderabbit review --api-key "$CODERABBIT_API_KEY"

Common automation patterns

Use --agent when another tool needs structured output:
coderabbit review --agent
Use --plain when you want readable logs in the workflow output:
coderabbit review --plain
If your workflow edits code in place and wants feedback on the current working tree, use --type uncommitted.
coderabbit review --type uncommitted
If your workflow compares a branch against a base branch, set the base explicitly:
coderabbit review --agent --base main
cr is the short alias for coderabbit, so cr review --agent and coderabbit review --agent work the same way.

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.
API-key authentication works with the plain and agent review flows. Do not use --interactive in headless environments.

What’s next

Usage-based Add-on

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