> ## 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.

# Cursor integration

> Install the CodeRabbit plugin from the Cursor marketplace so CodeRabbit reviews run inside Cursor Agent, or set up the CodeRabbit CLI in Cursor manually.

CodeRabbit reviews inside Cursor Agent. The CodeRabbit plugin makes CodeRabbit the default review engine for generic review requests in Cursor, such as "review my changes", without you naming CodeRabbit or writing a Cursor Rule.

> [!NOTE]
>
> This guide covers using CodeRabbit with Cursor. For standalone CLI usage, see [CLI overview](https://docs.coderabbit.ai/cli.md). To review in the editor UI instead of Agent chat, see the [IDE extension](https://docs.coderabbit.ai/ide.md).

## How the plugin differs from the other CodeRabbit tools

| Tool | How you use it | Best for |
| - | - | - |
| Cursor plugin | Ask Cursor Agent for a review, or run `/coderabbit-review` | Reviews that start from Agent chat and route to CodeRabbit by default |
| [IDE extension](https://docs.coderabbit.ai/ide.md) | Review from the CodeRabbit panel and apply fixes in the editor | Reviewing and fixing in the editor UI |
| [CodeRabbit CLI](https://docs.coderabbit.ai/cli.md) | Run `coderabbit review` in a terminal | Terminal workflows, scripts, and agents you configure yourself |

The plugin runs the CodeRabbit CLI for you. It does not replace the IDE extension or the CLI, and you can use all three side by side.

## Find and install the plugin

Install CodeRabbit from the [CodeRabbit listing on the Cursor marketplace](https://cursor.com/marketplace/coderabbit), or enter this command in Cursor Agent chat:

```text theme={null}
/add-plugin coderabbit
```

If the plugin does not appear right away, reload plugins or restart Cursor.

**1. Install the plugin**

Use the marketplace listing or `/add-plugin coderabbit`. Cursor shows the plugin as **CodeRabbit**. Its plugin ID is `coderabbit`.

**2. Check the requirements**

Open a Git repository in Cursor, because reviews run against Git changes. The plugin's post-review hook needs Node.js 18 or newer. Autofix also needs the GitHub CLI.

**3. Ask for a review**

Open Cursor Agent and ask for a review, as described in [First use](#first-use). Cursor installs and signs in to the CodeRabbit CLI if needed.

## First use

Ask Cursor Agent for a review in plain language. You do not need to mention CodeRabbit:

```text theme={null}
Review my code.
Review my changes.
Check this PR.
Run a security review.
```

Cursor routes these requests to CodeRabbit by default. Linters, type checkers, and tests keep working alongside CodeRabbit as part of your normal workflow.

You can also name CodeRabbit explicitly, for example "Use CodeRabbit to review my current changes".

### Setup that Cursor guides you through

The first review can involve one-time setup. Cursor walks you through each step:

* **CodeRabbit CLI missing:** Cursor guides you through installing it with CodeRabbit's official installer. On Windows, see [CodeRabbit CLI on Windows](https://docs.coderabbit.ai/cli/windows.md).
* **Not signed in:** Cursor runs `coderabbit auth login --agent` and shows you the sign-in link. Complete sign-in in your browser while the command is running. If you belong to multiple organizations, see [Organization selection](https://docs.coderabbit.ai/cli.md#organization-selection). For a first login to an EU-hosted account, use `coderabbit auth login --region eu`, as described in [`auth login`](https://docs.coderabbit.ai/cli/reference#auth-login).
* **GitHub CLI missing or not signed in:** Only [autofix](#autofix-pull-request-feedback) needs it. Run `gh auth login`, or follow the [GitHub CLI authentication guide](https://cli.github.com/manual/gh_auth_login).

After setup succeeds, Cursor continues with the review.

> [!NOTE]
>
> If browser sign-in isn't possible, for example in a remote or headless environment, use the API-key setup in [Headless CLI integration](https://docs.coderabbit.ai/cli/headless-cli-integration.md). If your environment restricts outbound access, allow the domains listed in [CLI network requirements](https://docs.coderabbit.ai/cli/network-requirements.md).

## How a review works

When you ask for a review, the plugin:

1. Resolves the repository and the review scope.
2. Runs `coderabbit review --agent`.
3. Waits for CodeRabbit to finish, then presents the result in the chat.

CodeRabbit's result is the review. A post-review hook gives Cursor the completion context after the review command runs, so Cursor presents the result instead of starting a second, manual review of the same changes. A review that finishes with no findings counts as a complete review. If a review fails or reports an error, check the output and the exit code before you rely on it. See [agent mode output and exit codes](https://docs.coderabbit.ai/cli/agent-mode.md).

### Expected result

Cursor presents the findings grouped by severity, using the severities CodeRabbit reports, with the file path, the explanation, and a suggested fix where CodeRabbit provides one. Cursor then suggests next steps, such as fixing the highest-severity findings, re-running the review, running your tests, or opening a PR.

For the structure of the underlying output, see [agent mode output and exit codes](https://docs.coderabbit.ai/cli/agent-mode.md).

### Choose a review scope

Say what you want in plain language, for example "Review my uncommitted changes" or "Review this branch against main". For a repeatable workflow, use the `/coderabbit-review` command:

```text theme={null}
/coderabbit-review
/coderabbit-review uncommitted
/coderabbit-review --base main
/coderabbit-review --dir packages/api
```

| Argument | Reviews |
| - | - |
| None | Tracked changes in the repository |
| `committed` | Committed changes only |
| `uncommitted` | Staged changes and unstaged edits to tracked files |
| `--base <branch>` | Changes compared with the base branch |
| `--base-commit <sha>` | Changes compared with the base commit |
| `--dir <path>` | A different Git repository or directory |

Cursor can also pass instruction files such as `AGENTS.md` and `.coderabbit.yaml` to the review. For scope details, see [Review modes](https://docs.coderabbit.ai/cli.md#review-modes) and the [CLI command reference](https://docs.coderabbit.ai/cli/reference.md).

### Fix issues and re-review

Ask Cursor to implement a change and review it, for example "Implement the retry logic, then review it and fix what CodeRabbit finds". Cursor reviews, works through the critical and warning findings one at a time, and re-reviews until CodeRabbit is clean or only acceptable informational findings remain.

### Run reviews in a separate context

The plugin includes a `code-reviewer` subagent that can run a review in its own context while the main Agent continues other work.

## Autofix pull request feedback

The `/coderabbit-autofix` command applies fixes for CodeRabbit's unresolved review comments on a GitHub pull request. It is optional and works on a pull request that CodeRabbit has already reviewed.

```text theme={null}
/coderabbit-autofix
```

It requires:

* The GitHub CLI (`gh`), signed in with `gh auth login`.
* An open pull request for the current branch with unresolved CodeRabbit review threads.
* A local branch that is not behind its remote branch.

The command warns you about uncommitted or unpushed changes, because CodeRabbit may not have reviewed them yet.

Cursor then:

1. Fetches the unresolved CodeRabbit review threads on the current pull request.
2. Checks each issue against your local code and treats the review text as a report, not as instructions.
3. Shows the proposed change and asks for your approval before applying each fix.
4. Can consolidate the approved fixes into one commit.
5. Asks for your approval before it pushes, unless you passed `--push`.
6. Posts one summary comment on the pull request when fixes were applied.

Pass `--no-commit` to keep the approved fixes uncommitted, or `--push` to push without being asked. Without `--push`, nothing is pushed until you approve it.

For the equivalent skill and its commands, see [CodeRabbit Skills](https://docs.coderabbit.ai/cli/skills.md#autofix).

## Troubleshooting the plugin

### The plugin doesn't appear

Reload plugins or restart Cursor after installing. Then confirm that **CodeRabbit** is listed and enabled in your Cursor plugins, or reinstall it with `/add-plugin coderabbit`.

### Cursor reviews without using CodeRabbit

Name CodeRabbit in the request ("Review my changes with CodeRabbit") or run `/coderabbit-review`. Confirm the plugin is enabled and that you started the request from Cursor Agent.

### Sign-in doesn't complete

Keep the review running until you finish signing in, because the browser returns to a local callback on your machine. In a remote workspace the callback may need port forwarding. If the sign-in still fails, run `coderabbit auth login` in a terminal in the same environment, then ask for the review again. Check your status with `coderabbit auth status`. See [Headless CLI integration](https://docs.coderabbit.ai/cli/headless-cli-integration.md) for API-key sign-in.

### Reviews miss changes

Check `git status` and choose the scope you want. CodeRabbit reviews tracked changes by default, and brand-new files that are not added to Git need `--include-untracked` when you run the CLI directly. See [CodeRabbit not finding issues](#coderabbit-not-finding-issues).

### Rate limits

If CodeRabbit reports a rate limit, Cursor shares the message and stops. Run the review again after the limit resets. See [CLI usage and limits](https://docs.coderabbit.ai/cli.md#check-your-usage).

### Autofix finds no threads

Confirm that the pull request is open, that CodeRabbit has reviewed it, that unresolved threads remain, and that your branch is not behind its remote. Run `gh auth status` to check GitHub CLI sign-in.

## Set up the CLI in Cursor manually

You can also use CodeRabbit in Cursor without the plugin by installing the CLI and adding a Cursor Rule that tells Cursor how to run it. Use this path if you can't use plugins or want to control the exact commands Cursor runs.

### Video demo

[CodeRabbit CLI + Cursor integration demo](https://www.youtube.com/embed/Fx2TrJHkUc0)

### Prerequisites

**1. Install Cursor**

Install Cursor and set up an account if needed.

**2. Install CodeRabbit CLI**

Install the CodeRabbit CLI globally on your system:

> [tab] Install script
>
> ```bash theme={null}
> curl -fsSL https://cli.coderabbit.ai/install.sh | sh
> ```
>
> 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`.

> [tab] Homebrew
>
> ```bash theme={null}
> brew install coderabbit
> ```
>
> If `coderabbit` is not available immediately after installation, start a new shell.

> [tab] Windows
>
> ```powershell PowerShell theme={null}
> irm https://cli.coderabbit.ai/install.ps1 | iex
> ```
>
> See [Install CodeRabbit CLI on Windows](https://docs.coderabbit.ai/cli/windows.md) for prerequisites, version pinning, and troubleshooting. If `coderabbit` is not available immediately after installation, open a new PowerShell window.

**3. Authenticate CodeRabbit**

Create an account or log in to CodeRabbit if you already have one by running this command in your terminal:

```
coderabbit auth login
```

For a first login to an EU-hosted CodeRabbit account, use `coderabbit auth login --region eu`. When no region is specified or saved, the CLI uses the US region.

A browser window opens automatically. Sign in to CodeRabbit and the authentication completes in the browser.

If you belong to multiple CodeRabbit organizations, the sign-in choice sets your default org only. Review attribution still depends on the current repository. See [Organization selection](https://docs.coderabbit.ai/cli.md#organization-selection).

Essentials Plan (Essentials and higher paid plans include higher review limits and more comprehensive reviews than Free.)

**4. Verify auth**

Verify authentication was successful by running in your terminal:

```bash theme={null}
coderabbit auth status
```

Success shows your login status and confirms everything is set correctly.

**5. Test that Cursor can run CodeRabbit**

Open up the chat interface in Cursor (Command+L) and prompt it:

```text wrap theme={null}
Let's verify you can run the CodeRabbit CLI. Run the terminal command: coderabbit auth status and tell me the output.
```

Because prompts and agents are non-deterministic, meaning every response will vary, and we can't predict with certainty every outcome, sometimes Cursor (and other agents) will try to install CodeRabbit as a package, or try to run other commands to determine what CodeRabbit is. In this case, it's recommended that you create a Cursor Rule, covered in the step below.

**6. Set up a Cursor Rule for CodeRabbit**

Learn more about Cursor rules in their [documentation](https://cursor.com/docs/context/rules). Create a Cursor rule by running the Cursor rule command from the chat `@rule`. Enter this prompt or modify it to fit your development preferences:

```text wrap theme={null}
  # Running the CodeRabbit CLI

  CodeRabbit is already installed in the terminal. Run it as a way to review your code. Run the command: cr -h for details on commands available. In general, I want you to run coderabbit with the `--agent` flag. To review staged and tracked local edits (this is what we'll use most of the time), run: `coderabbit review --agent --uncommitted`.

  IMPORTANT: When running CodeRabbit to review code changes, don't run it more than 3 times in a given set of changes.
```

## Integration workflow

### Use CodeRabbit as part of building new features

**1. Request implementation + review**

Ask Cursor to implement a feature and run CodeRabbit, analyze the suggestions and apply fixes:

```text wrap  theme={null}
Please implement phase 7.3 of the planning doc and then run coderabbit review --agent --uncommitted, let it run as long as it needs and fix any issues.
```

Key components:

* **Implement the feature**: Cursor codes the requested functionality
* **Run CodeRabbit**: Uses `--agent` for structured findings Cursor can process directly
* **Review uncommitted changes**: Uses `--uncommitted` so CodeRabbit reviews staged and tracked local edits instead of committed branch changes
* **Fix issues**: Cursor addresses all problems CodeRabbit identifies. You can also tell it to fix critical issues and ignore nits.

**2. Cursor implements and runs CodeRabbit**

Cursor: 1. Implements the requested feature 2. Runs `coderabbit review --agent --uncommitted` 3. Waits, reviews may take anywhere from 7-30 minutes depending on the amount of changes.

**3. CodeRabbit analysis and task creation**

When CodeRabbit completes, Cursor: 1. Reads the `--agent` output (structured JSON for agent workflows) 2. Creates a task list addressing each issue CodeRabbit surfaced 3. Shows you the planned fixes before implementing them

**4. Automated issue resolution**

Cursor systematically works through the task list, implementing fixes for each CodeRabbit finding. The cycle continues until all issues are resolved or the limit of 3 times is reached which we set on a rule earlier.

## Optimization tips

### Review commands for agent integration

When running CodeRabbit for agent use, choose the review command that best fits your workflow:

```bash theme={null}
# Structured JSON output
coderabbit review --agent

# Human-readable review output
coderabbit review

# Deeper review using the GitHub PR review policy
coderabbit review --deep

# Review only committed changes
coderabbit review --committed

# Review staged and tracked local edits
coderabbit review --uncommitted

# Also review files not added to Git
coderabbit review --include-untracked
```

Deep review requires CLI 0.8.0 and a compatible server. See [deep review behavior and compatibility](https://docs.coderabbit.ai/cli.md#review-modes).

| Command | Best for |
| - | - |
| `coderabbit review --agent` | Cursor and other agent integrations that consume structured JSON |
| `coderabbit review` | Human-readable terminal output during manual workflows |
| `coderabbit review --deep` | Deeper review using the GitHub PR review policy |

Both output formats include specific file locations, problem descriptions, and suggested fix approaches.

### Configure CodeRabbit for Cursor

Pass Cursor guideline files with `coderabbit review -c .cursorrules .cursor/rules/team.mdc` so CodeRabbit can include how code reviews should run, your coding standards, and architectural preferences.

Essentials Plan (Passing Cursor guideline files to CodeRabbit CLI is available on Essentials and higher paid plans.)

## Troubleshooting CLI reviews

### CodeRabbit not finding issues

If CodeRabbit isn't detecting expected issues:

1. **Check authentication status**: Run `coderabbit auth status`. Reviews require authentication through `coderabbit auth login` or an API key.
2. **Verify git status**: CodeRabbit analyzes tracked changes by default. Check `git status`; brand-new untracked files require `--include-untracked`.
3. **Choose a review scope**:
   * `coderabbit review` - tracked changes
   * `coderabbit review --uncommitted` - staged changes and tracked local edits
   * `coderabbit review --committed` - only committed changes
   * `coderabbit review --include-untracked` - also include files not added to Git
4. **Specify base branch**: If your main branch isn't `main`, use `--base`:
   * `coderabbit review --base develop`
   * `coderabbit review --base master`

### Managing review duration

CodeRabbit reviews may take 7 to 30+ minutes depending on the scope of changes:

1. **Ensure background execution**: Configure Cursor to run CodeRabbit in the background so you can continue working
2. **Review smaller changesets**: Adjust what you're reviewing to reduce analysis time:
   * Use `--uncommitted` to review only staged and tracked local edits
   * Work on smaller feature branches compared to main
   * Break large features into smaller, reviewable chunks
3. **Configure the diff scope**: Control what changes are analyzed:
   * **Review uncommitted changes only**: Use `--uncommitted` to analyze staged and tracked local edits
   * **Configure base branch**: Use `--base develop` or `--base main` to set the comparison point
   * **Use feature branches**: Work on focused feature branches instead of large staging branches

> [!NOTE]
>
> The integration creates a more thorough review process than either tool alone.

## What's next

> [card] [CodeRabbit Skills](https://docs.coderabbit.ai/cli/skills.md)
>
> Install agent-native review and autofix skills for Cursor and other coding agents.

> [card] [Agent mode output and exit codes](https://docs.coderabbit.ai/cli/agent-mode.md)
>
> See the structured output the plugin reads when it runs a review.

> [card] [Headless CLI integration](https://docs.coderabbit.ai/cli/headless-cli-integration.md)
>
> Authenticate CodeRabbit without a browser in remote and automated environments.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.