Skip to main content

Integrate CodeRabbit into a GitHub repository that you own

Observe CodeRabbit perform a code review of a pull request that you initiate

Converse with CodeRabbit about the code review

4

>>> Prompt CodeRabbit to generate its own improvements to the pull request

Request code improvements

One of CodeRabbit’s powerful features is its ability to not just identify issues, but also generate the code changes needed to fix them. Instead of manually implementing the suggestions from the review, you can ask CodeRabbit to do it for you. In this step, you’ll use a CodeRabbit command to automatically fix the findings from the review of your Python code.

Fix the review findings

Post the following as a new comment on your pull request:
This command instructs CodeRabbit to implement fixes for its unresolved review findings and deliver them in a separate pull request.
Fix comments works only on unresolved CodeRabbit review findings that include fix instructions. If the review left none, CodeRabbit skips the run and opens no pull request. In that case, ask CodeRabbit in the pull request conversation for the change you want, then apply its proposal as described in Confirm and commit prepared changes.

What CodeRabbit does next

After a few moments, CodeRabbit automatically performs the following actions:
  1. Creates a new branch - CodeRabbit generates a new branch based on your add-utils branch
  2. Commits the changes - CodeRabbit applies fixes for the review findings to your simple_utils.py file
  3. Opens a pull request - CodeRabbit creates a new pull request from the new branch back into add-utils
You can review the fixes in the new pull request, and if you’re satisfied with them, merge them into your original branch. See Fix comments for the other ways to deliver fixes.

Review the generated changes

Once CodeRabbit creates the new pull request with the fixes:
  1. Navigate to the new pull request
  2. Review the generated changes
  3. Check that each change addresses its review finding
  4. Merge the changes if they meet your standards
This demonstrates how CodeRabbit can handle not just code review, but also automated code generation based on best practices.

Confirm and commit prepared changes

After CodeRabbit proposes prepared changes in a pull request conversation or inline review thread, confirm the proposal to apply those exact prepared changes to the current branch.
In the CodeRabbit-authored general or inline review comment that contains the proposal, select the Commit the changes to this branch checkbox.
CodeRabbit uses the most recent CodeRabbit-authored prepared proposal from the relevant conversation or inline thread. A proposal from an unrelated thread or a comment that CodeRabbit did not author cannot supply the changes. After a successful confirmation, CodeRabbit commits the prepared changes and reports the resulting commit hash. This workflow requires no configuration or migration.

Other available commands

CodeRabbit supports many other commands to help you improve your code. For example:
  • @coderabbitai generate unit tests - Create unit tests for your code
  • @coderabbitai fix comments - Apply suggested fixes directly to your current branch
  • @coderabbitai help - See all available commands
You can use CodeRabbit commands on any pull request comment to request specific actions. This makes it easy to iterate on code improvements without leaving GitHub.