{"id":13593970,"url":"https://github.com/coderabbitai/ai-pr-reviewer","last_synced_at":"2025-09-28T23:30:49.668Z","repository":{"id":133413049,"uuid":"611896006","full_name":"coderabbitai/ai-pr-reviewer","owner":"coderabbitai","description":"AI-based Pull Request Summarizer and Reviewer with Chat Capabilities.","archived":true,"fork":false,"pushed_at":"2024-02-28T19:16:35.000Z","size":24192,"stargazers_count":1602,"open_issues_count":29,"forks_count":310,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-01-11T04:25:34.586Z","etag":null,"topics":["code-review","github-action","gpt-4","openai"],"latest_commit_sha":null,"homepage":"https://coderabbit.ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"unsafecoerce/chatgpt-action","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderabbitai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-09T19:06:40.000Z","updated_at":"2025-01-10T10:06:44.000Z","dependencies_parsed_at":"2023-07-30T14:09:56.338Z","dependency_job_id":"ef2000fe-69fb-4f67-8f30-efe58454e7f0","html_url":"https://github.com/coderabbitai/ai-pr-reviewer","commit_stats":null,"previous_names":["coderabbitai/openai-pr-reviewer","fluxninja/openai-pr-reviewer"],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderabbitai%2Fai-pr-reviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderabbitai%2Fai-pr-reviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderabbitai%2Fai-pr-reviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderabbitai%2Fai-pr-reviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderabbitai","download_url":"https://codeload.github.com/coderabbitai/ai-pr-reviewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234565079,"owners_count":18853247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-review","github-action","gpt-4","openai"],"created_at":"2024-08-01T16:01:27.044Z","updated_at":"2025-09-28T23:30:46.853Z","avatar_url":"https://github.com/coderabbitai.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Official Resources","Code Review \u0026 Collaboration","Addons, extensions, plug-ins for integrating LLM into third-party applications"],"sub_categories":["Other IDEs","Other user interfaces"],"readme":"# CodeRabbit Pro\n\nThis is an old version of [CodeRabbit](http://coderabbit.ai) and is now in the maintenance mode.\nWe recommend installing the Pro version from [CodeRabbit](http://coderabbit.ai). The Pro version is a total redesign and offers significantly better reviews that learn from your usage and improve over time. CodeRabbit Pro is free for open source projects. \n\n[![Discord](https://img.shields.io/badge/Join%20us%20on-Discord-blue?logo=discord\u0026style=flat-square)](https://discord.gg/GsXnASn26c)\n\n# AI-based PR reviewer and summarizer\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub](https://img.shields.io/github/last-commit/coderabbitai/ai-pr-reviewer/main?style=flat-square)](https://github.com/coderabbitai/ai-pr-reviewer/commits/main)\n\n## Overview\n\nCodeRabbit `ai-pr-reviewer` is an AI-based code reviewer and summarizer for\nGitHub pull requests using OpenAI's `gpt-3.5-turbo` and `gpt-4` models. It is\ndesigned to be used as a GitHub Action and can be configured to run on every\npull request and review comments\n\n## Reviewer Features:\n\n- **PR Summarization**: It generates a summary and release notes of the changes\n  in the pull request.\n- **Line-by-line code change suggestions**: Reviews the changes line by line and\n  provides code change suggestions.\n- **Continuous, incremental reviews**: Reviews are performed on each commit\n  within a pull request, rather than a one-time review on the entire pull\n  request.\n- **Cost-effective and reduced noise**: Incremental reviews save on OpenAI costs\n  and reduce noise by tracking changed files between commits and the base of the\n  pull request.\n- **\"Light\" model for summary**: Designed to be used with a \"light\"\n  summarization model (e.g. `gpt-3.5-turbo`) and a \"heavy\" review model (e.g.\n  `gpt-4`). _For best results, use `gpt-4` as the \"heavy\" model, as thorough\n  code review needs strong reasoning abilities._\n- **Chat with bot**: Supports conversation with the bot in the context of lines\n  of code or entire files, useful for providing context, generating test cases,\n  and reducing code complexity.\n- **Smart review skipping**: By default, skips in-depth review for simple\n  changes (e.g. typo fixes) and when changes look good for the most part. It can\n  be disabled by setting `review_simple_changes` and `review_comment_lgtm` to\n  `true`.\n- **Customizable prompts**: Tailor the `system_message`, `summarize`, and\n  `summarize_release_notes` prompts to focus on specific aspects of the review\n  process or even change the review objective.\n\nTo use this tool, you need to add the provided YAML file to your repository and\nconfigure the required environment variables, such as `GITHUB_TOKEN` and\n`OPENAI_API_KEY`. For more information on usage, examples, contributing, and\nFAQs, you can refer to the sections below.\n\n- [Overview](#overview)\n- [Professional Version of CodeRabbit](#professional-version-of-coderabbit)\n- [Reviewer Features](#reviewer-features)\n- [Install instructions](#install-instructions)\n- [Conversation with CodeRabbit](#conversation-with-coderabbit)\n- [Examples](#examples)\n- [Contribute](#contribute)\n- [FAQs](#faqs)\n\n\n## Install instructions\n\n`ai-pr-reviewer` runs as a GitHub Action. Add the below file to your repository\nat `.github/workflows/ai-pr-reviewer.yml`\n\n```yaml\nname: Code Review\n\npermissions:\n  contents: read\n  pull-requests: write\n\non:\n  pull_request:\n  pull_request_review_comment:\n    types: [created]\n\nconcurrency:\n  group:\n    ${{ github.repository }}-${{ github.event.number || github.head_ref ||\n    github.sha }}-${{ github.workflow }}-${{ github.event_name ==\n    'pull_request_review_comment' \u0026\u0026 'pr_comment' || 'pr' }}\n  cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}\n\njobs:\n  review:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: coderabbitai/ai-pr-reviewer@latest\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n        with:\n          debug: false\n          review_simple_changes: false\n          review_comment_lgtm: false\n```\n\n#### Environment variables\n\n- `GITHUB_TOKEN`: This should already be available to the GitHub Action\n  environment. This is used to add comments to the pull request.\n- `OPENAI_API_KEY`: use this to authenticate with OpenAI API. You can get one\n  [here](https://platform.openai.com/account/api-keys). Please add this key to\n  your GitHub Action secrets.\n- `OPENAI_API_ORG`: (optional) use this to use the specified organization with\n  OpenAI API if you have multiple. Please add this key to your GitHub Action\n  secrets.\n\n### Models: `gpt-4` and `gpt-3.5-turbo`\n\nRecommend using `gpt-3.5-turbo` for lighter tasks such as summarizing the\nchanges (`openai_light_model` in configuration) and `gpt-4` for more complex\nreview and commenting tasks (`openai_heavy_model` in configuration).\n\nCosts: `gpt-3.5-turbo` is dirt cheap. `gpt-4` is orders of magnitude more\nexpensive, but the results are vastly superior. We are typically spending $20 a\nday for a 20 developer team with `gpt-4` based review and commenting.\n\n### Prompts \u0026 Configuration\n\nSee: [action.yml](./action.yml)\n\nTip: You can change the bot personality by configuring the `system_message`\nvalue. For example, to review docs/blog posts, you can use the following prompt:\n\n\u003cdetails\u003e\n\u003csummary\u003eBlog Reviewer Prompt\u003c/summary\u003e\n\n```yaml\nsystem_message: |\n  You are `@coderabbitai` (aka `github-actions[bot]`), a language model\n  trained by OpenAI. Your purpose is to act as a highly experienced\n  DevRel (developer relations) professional with focus on cloud-native\n  infrastructure.\n\n  Company context -\n  CodeRabbit is an AI-powered Code reviewer.It boosts code quality and cuts manual effort. Offers context-aware, line-by-line feedback, highlights critical changes,\n  enables bot interaction, and lets you commit suggestions directly from GitHub.\n\n  When reviewing or generating content focus on key areas such as -\n  - Accuracy\n  - Relevance\n  - Clarity\n  - Technical depth\n  - Call-to-action\n  - SEO optimization\n  - Brand consistency\n  - Grammar and prose\n  - Typos\n  - Hyperlink suggestions\n  - Graphics or images (suggest Dall-E image prompts if needed)\n  - Empathy\n  - Engagement\n```\n\n\u003c/details\u003e\n\n## Conversation with CodeRabbit\n\nYou can reply to a review comment made by this action and get a response based\non the diff context. Additionally, you can invite the bot to a conversation by\ntagging it in the comment (`@coderabbitai`).\n\nExample:\n\n\u003e @coderabbitai Please generate a test plan for this file.\n\nNote: A review comment is a comment made on a diff or a file in the pull\nrequest.\n\n### Ignoring PRs\n\nSometimes it is useful to ignore a PR. For example, if you are using this action\nto review documentation, you can ignore PRs that only change the documentation.\nTo ignore a PR, add the following keyword in the PR description:\n\n```text\n@coderabbitai: ignore\n```\n\n## Examples\n\nSome of the reviews done by ai-pr-reviewer\n\n![PR Summary](./docs/images/PRSummary.png)\n\n![PR Release Notes](./docs/images/ReleaseNotes.png)\n\n![PR Review](./docs/images/section-1.png)\n\n![PR Conversation](./docs/images/section-3.png)\n\nAny suggestions or pull requests for improving the prompts are highly\nappreciated.\n\n## Contribute\n\n### Developing\n\n\u003e First, you'll need to have a reasonably modern version of `node` handy, tested\n\u003e with node 17+.\n\nInstall the dependencies\n\n```bash\n$ npm install\n```\n\nBuild the typescript and package it for distribution\n\n```bash\n$ npm run build \u0026\u0026 npm run package\n```\n\n## FAQs\n\n### Review pull requests from forks\n\nGitHub Actions limits the access of secrets from forked repositories. To enable\nthis feature, you need to use the `pull_request_target` event instead of\n`pull_request` in your workflow file. Note that with `pull_request_target`, you\nneed extra configuration to ensure checking out the right commit:\n\n```yaml\nname: Code Review\n\npermissions:\n  contents: read\n  pull-requests: write\n\non:\n  pull_request_target:\n    types: [opened, synchronize, reopened]\n  pull_request_review_comment:\n    types: [created]\n\nconcurrency:\n  group:\n    ${{ github.repository }}-${{ github.event.number || github.head_ref ||\n    github.sha }}-${{ github.workflow }}-${{ github.event_name ==\n    'pull_request_review_comment' \u0026\u0026 'pr_comment' || 'pr' }}\n  cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}\n\njobs:\n  review:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: coderabbitai/ai-pr-reviewer@latest\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n        with:\n          debug: false\n          review_simple_changes: false\n          review_comment_lgtm: false\n```\n\nSee also:\nhttps://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target\n\n### Inspect the messages between OpenAI server\n\nSet `debug: true` in the workflow file to enable debug mode, which will show the\nmessages\n\n### Disclaimer\n\n- Your code (files, diff, PR title/description) will be sent to OpenAI's servers\n  for processing. Please check with your compliance team before using this on\n  your private code repositories.\n- OpenAI's API is used instead of ChatGPT session on their portal. OpenAI API\n  has a\n  [more conservative data usage policy](https://openai.com/policies/api-data-usage-policies)\n  compared to their ChatGPT offering.\n- This action is not affiliated with OpenAI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderabbitai%2Fai-pr-reviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderabbitai%2Fai-pr-reviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderabbitai%2Fai-pr-reviewer/lists"}