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

# Code review commands

> Complete reference of CodeRabbit commands for controlling code reviews, generating documentation, and managing pull requests.

export const EssentialsPlanBadge = ({tip = "This feature is available on Essentials (formerly Pro), Team (formerly Pro+), Advanced, and Enterprise. Please refer to our pricing page for more information about our plans and features.", title = "Essentials Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-check" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const Hint = ({type, children, headline, tip, href, cta}) => {
  const TIPS = {
    learnings: {
      headline: "Learnings",
      tip: "Review preferences CodeRabbit learns from your chat conversations and applies automatically to future reviews.",
      cta: "Learn about Learnings",
      href: "/knowledge-base/learnings",
      content: "Learnings"
    },
    walkthrough: {
      headline: "PR Walkthrough",
      tip: "A structured comment posted by CodeRabbit at the top of every pull request, summarizing changes, sequence diagrams, review effort, and more.",
      cta: "Learn about PR Walkthroughs",
      href: "/pr-reviews/walkthroughs",
      content: "Walkthrough"
    },
    "finishing-touches": {
      headline: "Finishing Touches",
      tip: "Post-review agentic actions (Autofix, writing docstrings or unit tests, and more) you trigger from a PR comment or a checkbox in the Walkthrough.",
      cta: "See all Finishing Touches",
      href: "/finishing-touches",
      content: "Finishing Touches"
    },
    "coding-plan": {
      headline: "Coding Plan",
      tip: "A detailed, codebase-aware implementation plan CodeRabbit generates from an issue or description, ready to hand off to any coding agent.",
      cta: "Learn about Coding Plans",
      href: "/plan",
      content: "Coding Plan"
    },
    "knowledge-base": {
      headline: "Knowledge Base",
      tip: "The collected context sources CodeRabbit draws on during reviews: Learnings, Code Guidelines, issue trackers, connected MCP servers, and cross-repo analysis.",
      cta: "Explore the Knowledge Base",
      href: "/knowledge-base",
      content: "Knowledge Base"
    },
    "path-instructions": {
      headline: "Path Instructions",
      tip: "Custom review rules that only apply to files matching a glob pattern, e.g. 'src/controllers/**'.",
      cta: "Configure path instructions",
      href: "/configuration/path-instructions",
      content: "Path Instructions"
    },
    "change-stack": {
      headline: "Change Stack",
      tip: "An improved code inspection interface that reorganizes a pull request from a flat file list into a structured, layer-by-layer walkthrough with range-specific summaries and diagrams when useful.",
      cta: "Learn about Change Stack",
      href: "/pr-reviews/change-stack",
      content: "Change Stack"
    },
    scope: {
      headline: "Scope",
      tip: "A named set of repositories, connections, and spend limits that controls what CodeRabbit Agent can access in a given Slack conversation.",
      cta: "Learn about Scopes",
      href: "/slack-agent/scopes",
      content: "Scope"
    },
    "coderabbit-agent": {
      headline: "CodeRabbit Agent for Slack",
      tip: "An AI agent built into Slack that investigates issues, generates implementation plans, and opens pull requests right from the Slack threads.",
      cta: "Explore CodeRabbit Agent",
      href: "/slack-agent",
      content: "CodeRabbit Agent"
    },
    "configuration-inheritance": {
      headline: "Configuration Inheritance",
      tip: "A setting that merges configuration values across multiple levels — repository YAML, central YAML, and UI settings — instead of using only the highest-priority source.",
      cta: "Learn about Configuration Inheritance",
      href: "/configuration/configuration-inheritance",
      content: "Configuration Inheritance"
    }
  };
  const defaults = TIPS[type] || ({});
  return <Tooltip headline={headline ?? defaults.headline} tip={tip ?? defaults.tip} cta={cta ?? defaults.cta} href={href ?? defaults.href}>
      {children ?? defaults.content}
    </Tooltip>;
};

<Info>
  Examples on this page use `@coderabbitai`. If CodeRabbit is installed with a different service-account handle on your platform, use that handle instead in PR comments and PR descriptions.
</Info>

## Review control commands

These commands control CodeRabbit's automatic review behavior for your pull request.

### Manual review triggers

<Info>
  `@coderabbitai review` does incremental review (new changes), not a full review. Use `@coderabbitai full review` when you want a complete pass over the entire pull request. Both commands use one PR review from your allowance when the review runs.
</Info>

<AccordionGroup>
  <Accordion title="@coderabbitai review" icon="refresh-cw">
    **Description:** Triggers an incremental review of new changes only

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Automatic reviews are disabled
    * You want to manually request a review of recent changes
    * You've made updates and want focused feedback on new code
    * A full review already ran and you only want feedback on what changed since then (new commits)

    **Example:**

    ```
    @coderabbitai review
    ```
  </Accordion>

  <Accordion title="@coderabbitai full review" icon="scan">
    **Description:** Performs a complete review of all files from scratch

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * You want a fresh view on the entire PR
    * Previous reviews may have missed something
    * You've made significant changes affecting the overall logic
    * A PR was moved from draft to open and you want the first complete review now

    **Example:**

    ```
    @coderabbitai full review
    ```
  </Accordion>
</AccordionGroup>

### Review flow control

<AccordionGroup>
  <Accordion title="@coderabbitai pause" icon="pause">
    **Description:** Temporarily stops automatic reviews on the PR

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Making multiple rapid changes
    * Want to avoid review spam during development
    * Need time to complete your implementation

    **Example:**

    ```
    @coderabbitai pause
    ```
  </Accordion>

  <Accordion title="@coderabbitai resume" icon="play">
    **Description:** Restarts automatic reviews after a pause

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Ready for CodeRabbit to review again
    * Completed your changes and want feedback

    **Example:**

    ```
    @coderabbitai resume
    ```
  </Accordion>

  <Accordion title="@coderabbitai ignore" icon="eye-off">
    **Description:** Permanently disables automatic reviews for this PR

    **Usage:** Add anywhere in the pull request description

    **When to use:**

    * Want to handle the review process manually
    * PR contains sensitive or experimental code
    * Working on a hotfix that needs immediate deployment

    **Example:**

    ```
    @coderabbitai ignore
    ```

    <Warning>
      This command must be placed in the PR description, not in comments. To re-enable reviews, remove this text from the description.
    </Warning>
  </Accordion>
</AccordionGroup>

## Content generation commands

These commands help generate and update PR content and documentation.

### Summary and documentation

<AccordionGroup>
  <Accordion title="@coderabbitai summary" icon="file-text">
    **Note:** This is not a command - it's a placeholder that you put in your PR description.

    **Description:** A placeholder in your PR description that gets replaced with CodeRabbit's high-level summary of the changes

    **How it works:**

    1. Add `@coderabbitai summary` anywhere in your PR description
    2. When CodeRabbit generates a summary, it replaces this placeholder instead of appending to the end
    3. You can customize this placeholder using the `reviews.high_level_summary_placeholder` configuration option

    **Usage:** Place directly in your PR description (not as a comment)

    **When to use:**

    * You want the summary in a specific location in your description
    * You want to control where the summary appears instead of it being appended at the end

    **Example PR description:**

    ```
    ## Overview
    This PR implements the new user authentication flow.

    @coderabbitai summary

    ## Testing
    - [ ] Unit tests pass
    - [ ] Integration tests pass
    ```

    <Info>
      You can change this placeholder to anything you like using the `reviews.high_level_summary_placeholder` configuration option. See the [configuration reference](/reference/configuration#param-high-level-summary-placeholder) for more details.
    </Info>
  </Accordion>

  <Accordion title="@coderabbitai generate docstrings" icon="book">
    **Description:** Generates docstrings for functions and classes in the PR

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Code lacks proper documentation
    * Want consistent docstring formatting
    * Need to improve code documentation quickly

    **Example:**

    ```
    @coderabbitai generate docstrings
    ```

    <Note>
      This feature must be enabled in your CodeRabbit configuration under `reviews.finishing_touches.docstrings.enabled`.
    </Note>
  </Accordion>

  <Accordion title="@coderabbitai generate unit tests" icon="test-tube">
    **Description:** Generates unit tests for the code in the PR

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Code lacks test coverage
    * Want to quickly scaffold test cases
    * Need examples of how to test your functions

    **Example:**

    ```
    @coderabbitai generate unit tests
    ```

    <Info>
      Supported on GitHub, GitLab, and Azure DevOps. This feature must be enabled in your CodeRabbit configuration under `reviews.finishing_touches.unit_tests.enabled`.
    </Info>
  </Accordion>

  <Accordion title="@coderabbitai autofix" icon="wand-sparkles">
    **Description:** Automatically applies fixes for unresolved CodeRabbit review findings on GitHub, GitLab, Azure DevOps, and Bitbucket Cloud pull requests. Fixes can be committed directly to the current branch or to a new branch, based on your preference. For full details, see [Finishing Touches / Autofix](/finishing-touches/autofix).

    **When to use:** You want CodeRabbit to automatically implement review fixes

    **Usage:**

    Post as a comment in your pull request

    <Info>
      An inline reply within a CodeRabbit review thread limits the fix to that thread's unresolved finding. A comment in the pull request conversation processes all unresolved CodeRabbit review threads.
    </Info>

    ```text Commit changes directly to the current branch theme={null}
    @coderabbitai autofix
    ```

    ```text Commit changes to a new branch and open a stacked pull request against the current branch theme={null}
    @coderabbitai autofix stacked pr
    ```

    <Info>
      The aliases `auto-fix` and `auto fix` are also supported.
    </Info>

    <Info>
      Supported on GitHub, GitLab, Azure DevOps, and Bitbucket Cloud. The interactive **Autofix** checkboxes are available on supported GitHub pull-request flows only.
    </Info>

    <Info>
      No configuration required. Enabled by default for Essentials, Team, Advanced, and Enterprise plan users.
    </Info>

    <Info>
      If the pull request has merge conflicts, Autofix stops before making changes. The reply will suggest `@coderabbitai resolve merge conflict` as the next step. See [Resolve merge conflicts](/finishing-touches/resolve-merge-conflict) for details.
    </Info>

    <Info>
      Resolve Merge Conflicts must be enabled in your CodeRabbit configuration under `reviews.finishing_touches.resolve_merge_conflict.enabled`. It is enabled by default.
    </Info>
  </Accordion>

  <Accordion title="@coderabbitai local commit" icon="git-commit-horizontal">
    **Description:** Confirms and commits the most recent CodeRabbit-authored prepared proposal to the current branch

    **When to use:** CodeRabbit has proposed prepared changes in a pull request conversation or inline review thread

    **Usage:** Reply to the CodeRabbit-authored comment that carries the prepared-change payload

    **Example:**

    ```text theme={null}
    @coderabbitai local commit
    ```

    <Info>
      GitHub uses the interactive **Commit the changes to this branch** checkbox. Providers without reliable checkbox-edit events, including GitLab, use the `@coderabbitai local commit` reply.
    </Info>

    <Info>
      The reply must target a CodeRabbit-authored comment that carries the prepared-change payload.
    </Info>
  </Accordion>

  <Accordion title="@coderabbitai fix-ci" icon="list-checks">
    **Description:** Investigates failing CI checks and applies generated fixes as a direct commit or a stacked pull request. For full details, see [Finishing Touches / Fix CI failures](/finishing-touches/fix-ci).

    **When to use:** A GitHub or Azure DevOps pull request has failing CI checks that CodeRabbit can investigate

    **Usage:**

    Post one of these commands as a pull request comment:

    <Tabs>
      <Tab title="Stacked pull request">
        ```text theme={null}
        @coderabbitai fix-ci
        ```
      </Tab>

      <Tab title="Direct commit">
        ```text theme={null}
        @coderabbitai fix-ci commit
        ```
      </Tab>
    </Tabs>

    <Info>
      The aliases `fix ci` and `fixci` are also supported. Add `commit` to any alias to request a direct commit.
    </Info>

    <Info>
      Natural-language Fix CI requests use a stacked pull request by default. Explicitly ask CodeRabbit to commit directly, commit to the current branch, or avoid a stacked pull request to select direct-commit delivery.
    </Info>

    <Info>
      On GitHub, CodeRabbit can also show mutually exclusive **Commit on current branch** and **Create stacked PR** options under **Fix failing CI** in Finishing Touches when it detects failing checks. On Azure DevOps, use the comment commands.
    </Info>

    <Info>
      Fix CI failures must be enabled under `reviews.finishing_touches.fix_ci.enabled`. It is available on GitHub and Azure DevOps and requires a Team plan.
    </Info>
  </Accordion>

  <Accordion title="@coderabbitai generate sequence diagram" icon="workflow">
    **Description:** Creates a sequence diagram visualizing the PR's history and changes

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Want to visualize complex interactions
    * Need to understand the flow of changes
    * Documentation requires visual aids

    **Example:**

    ```
    @coderabbitai generate sequence diagram
    ```
  </Accordion>
</AccordionGroup>

## Comment management

<AccordionGroup>
  <Accordion title="@coderabbitai approve" icon="badge-check">
    **Description:** Resolves all unresolved CodeRabbit review threads and then attempts to submit CodeRabbit's approval on the pull request

    **Usage:** Post as a new top-level comment in your pull request

    **When to use:**

    * You've addressed CodeRabbit's feedback and want a single command to resolve its threads and approve the PR
    * Your team uses CodeRabbit as a required reviewer and you want to request approval explicitly
    * You do not want to wait for the normal automatic approval path after resolving comments

    **Example:**

    ```
    @coderabbitai approve
    ```

    <Info>
      This command only submits an approval when `reviews.request_changes_workflow` is enabled. Without that setting, CodeRabbit resolves its review threads but reports that approval is disabled. See the [configuration reference](/reference/configuration#param-request-changes-workflow).
    </Info>

    <Warning>
      Post this as a new top-level PR comment. `@coderabbitai approve` is not supported in review-thread replies.
    </Warning>
  </Accordion>

  <Accordion title="@coderabbitai resolve" icon="circle-check">
    **Description:** Marks all CodeRabbit review comments as resolved

    **Usage:** Post as a new top-level comment in your pull request

    **When to use:**

    * Addressed all CodeRabbit feedback
    * Want to clean up resolved issues
    * Ready to merge and need clean comment state

    **Example:**

    ```
    @coderabbitai resolve
    ```

    <Warning>
      Post this as a new top-level PR comment. `@coderabbitai resolve` is not supported in review-thread or inline replies.

      This will resolve ALL CodeRabbit comments. Make sure you've actually addressed the feedback before using this command.
    </Warning>
  </Accordion>
</AccordionGroup>

## Information and configuration

<AccordionGroup>
  <Accordion title="@coderabbitai rate limit" icon="gauge">
    **Description:** Displays your remaining PR review allowance and when the next review becomes available without consuming a review

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Check whether another PR review is currently available
    * See when review allowance will become available again

    **Example:**

    ```
    @coderabbitai rate limit
    ```

    <Info>
      The aliases `rate-limit`, `limits`, and `quota` are also supported. You can also ask an obvious question such as `@coderabbitai reviews remaining?`.
    </Info>
  </Accordion>

  <Accordion title="@coderabbitai configuration" icon="settings">
    **Description:** Displays the resolved CodeRabbit configuration settings, with comments that identify where settings came from (repository YAML, inherited central configuration, UI settings, defaults, global overrides, etc.). When <Hint type="configuration-inheritance" /> is enabled, source comments let you trace exactly which level each merged value originated from.

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Need to check current settings
    * Troubleshooting configuration issues
    * Want to export or share your configuration
    * Need to understand which configuration layer supplied a setting

    **Example:**

    ```
    @coderabbitai configuration
    ```
  </Accordion>

  <Accordion title="@coderabbitai generate configuration" icon="settings">
    **Description:** Creates a PR that adds the current resolved configuration as `.coderabbit.yaml` (or shows it if already present).

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Want to export current settings to a file
    * Share configuration with team members
    * Create a baseline configuration for the repository

    **Example:**

    ```
    @coderabbitai generate configuration
    ```
  </Accordion>

  <Accordion title="@coderabbitai emit path instructions" icon="list-checks">
    **Description:** Opens a pull request that adds suggested <Hint type="path-instructions" /> to your `.coderabbit.yaml`. CodeRabbit collects path-instruction suggestions generated over the past 7 days, merges the new ones into the `reviews.path_instructions` section, and opens a PR titled "Update CodeRabbit path instructions".

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * You want to capture recurring review guidance as durable, path-scoped configuration
    * CodeRabbit has surfaced path-instruction suggestions that you want to apply in bulk
    * You want a reviewable PR rather than hand-editing `.coderabbit.yaml`

    **Example:**

    ```
    @coderabbitai emit path instructions
    ```

    **How it works:**

    1. Reads path-instruction suggestions from the past 7 days, both those surfaced after reviews and those produced by CodeRabbit's path-instruction agent.
    2. If no recent agent suggestions exist, it runs the path-instruction agent inline to generate them.
    3. Merges the suggestions into your existing `.coderabbit.yaml` (or creates one if none exists), preserving your existing comments, formatting, and other settings. Entries are deduplicated by path, so existing path instructions are never overwritten.
    4. Opens a pull request with the updated configuration, including a summary of how many suggestions came from each source.

    **What you might see back:**

    * **A pull request** when new path instructions are added.
    * **No changes** when all recent suggestions already exist in your configuration.
    * **No suggestions** when no path-instruction suggestions were found in the last 7 days.

    <Info>
      The alias `emit path-instructions` is also supported.
    </Info>

    <Info>
      This command requires a platform that supports opening pull requests.
    </Info>

    <EssentialsPlanBadge tip="Generating new suggestions with the path-instruction agent requires an active Essentials, Team, Advanced, or Enterprise subscription." />
  </Accordion>

  <Accordion title="@coderabbitai help" icon="circle-question-mark">
    **Description:** Shows a quick reference guide of available commands

    **Usage:** Post as a comment in your pull request

    **When to use:**

    * Need a quick reminder of available commands
    * Want to see command syntax
    * Sharing CodeRabbit capabilities with team members

    **Example:**

    ```
    @coderabbitai help
    ```
  </Accordion>
</AccordionGroup>

## Per-pull-request configuration

### Configuration override

<AccordionGroup>
  <Accordion title="@coderabbitai configuration override" icon="settings">
    **Description:** Adjusts a small set of review settings for one pull request, without changing any committed configuration. Write the `@coderabbitai configuration override` line as plain text in the pull request **description**, immediately followed by a fenced YAML block. The line itself must sit outside the fence.

    **Usage:** Add to your pull request description

    **Supported settings:** A description override accepts only the following. If the block contains any other setting, the whole override is rejected, none of its settings are applied, and CodeRabbit notes the unsupported settings in the pull request.

    | Setting                                       | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `reviews.review_details`                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    | `knowledge_base.code_guidelines.filePatterns` | Requires a branch in the repository itself, opened by a collaborator, member, or owner. Each named repository is used only if the pull request author can read it, and anyone else who pushes to the branch must be able to read it too; otherwise that source is skipped and the review continues with your other guidelines. Added to the configured guidelines; cannot replace or disable them. See [code guidelines](/knowledge-base/code-guidelines#eligibility-and-access). |

    **When to use:**

    * Selecting the [coding guidelines](/knowledge-base/code-guidelines#adding-guidelines-to-a-single-pull-request) that apply to one pull request, by hand or from tooling that opens it
    * Changing review detail for a single pull request

    **Example:**

    ````text theme={null}
    @coderabbitai configuration override

    ```yaml
    knowledge_base:
      code_guidelines:
        filePatterns:
          - "platform-standards:security/**.md"
    ```
    ````
  </Accordion>
</AccordionGroup>

<Info>
  Pull requests from forks use the target branch's configuration. Guideline entries are not accepted from a fork's description, and CodeRabbit rejects the block that contains them; a block with only other supported settings, such as `reviews.review_details`, still applies.
</Info>

## Command reference table

For quick reference, here's a summary of all available commands:

| Command                                   | Type       | Description                                              | Location                    |
| ----------------------------------------- | ---------- | -------------------------------------------------------- | --------------------------- |
| `@coderabbitai review`                    | Review     | Incremental review of new changes                        | PR comment                  |
| `@coderabbitai full review`               | Review     | Complete review from scratch                             | PR comment                  |
| `@coderabbitai pause`                     | Control    | Temporarily stop reviews                                 | PR comment                  |
| `@coderabbitai resume`                    | Control    | Restart reviews after pause                              | PR comment                  |
| `@coderabbitai ignore`                    | Control    | Permanently disable reviews                              | PR description              |
| `@coderabbitai summary`                   | Content    | Regenerate PR summary                                    | PR description              |
| `@coderabbitai generate docstrings`       | Content    | Generate function documentation                          | PR comment                  |
| `@coderabbitai generate unit tests`       | Content    | Generate test cases                                      | PR comment                  |
| `@coderabbitai autofix`                   | Content    | Auto-apply review fixes                                  | Review comment              |
| `@coderabbitai autofix stacked pr`        | Content    | Auto-fix via stacked pull request                        | Review comment              |
| `@coderabbitai local commit`              | Content    | Commit prepared changes to the current branch            | CodeRabbit-authored comment |
| `@coderabbitai fix-ci`                    | Content    | Fix CI via stacked pull request                          | PR comment                  |
| `@coderabbitai fix-ci commit`             | Content    | Fix CI via direct commit                                 | PR comment                  |
| `@coderabbitai generate sequence diagram` | Content    | Create visual diagram                                    | PR comment                  |
| `@coderabbitai approve`                   | Management | Resolve threads and approve PR                           | PR comment                  |
| `@coderabbitai resolve`                   | Management | Resolve all CR comments                                  | PR comment                  |
| `@coderabbitai rate limit`                | Info       | Show remaining PR review allowance and next availability | PR comment                  |
| `@coderabbitai configuration`             | Info       | Show current settings                                    | PR comment                  |
| `@coderabbitai generate configuration`    | Info       | Create/export configuration file                         | PR comment                  |
| `@coderabbitai emit path instructions`    | Info       | Suggest path instructions via PR                         | PR comment                  |
| `@coderabbitai help`                      | Info       | Show command reference                                   | PR comment                  |
| `@coderabbitai configuration override`    | Config     | Adjust select settings for one PR                        | PR description              |

## Related configuration

Many of these commands are affected by your CodeRabbit configuration. Key configuration options include:

* **Automatic reviews**: `reviews.auto_review.enabled`
* **Docstring generation**: `reviews.finishing_touches.docstrings.enabled`
* **Unit test generation**: `reviews.finishing_touches.unit_tests.enabled`
* **Fix CI failures**: `reviews.finishing_touches.fix_ci.enabled`
* **Resolve Merge Conflicts**: `reviews.finishing_touches.resolve_merge_conflict.enabled`
* **High-level summaries**: `reviews.high_level_summary`
* **Sequence diagrams**: `reviews.sequence_diagrams`

For complete configuration options, see [Configuration Reference](/reference/configuration).
