ChatGPT-powered code review bot
Top 11.5% on sourcepulse
This project provides an automated code review bot powered by ChatGPT, designed to assist developers by identifying potential issues and suggesting improvements within pull requests. It targets developers and teams seeking to enhance code quality and streamline their review process.
How It Works
The bot integrates with GitHub Actions or can be self-hosted. Upon a new pull request or push event, it analyzes code diffs using the OpenAI API. Users can configure the model, prompt, and specific file patterns to include or ignore, allowing for tailored review experiences.
Quick Start & Requirements
OPENAI_API_KEY
to your GitHub Actions secrets and include the anc95/ChatGPT-CodeReview@main
action in your .github/workflows/cr.yml
..env.example
to .env
and fill in OPENAI_API_KEY
, then run npm install
, npm run build
, and pm2 start pm2.config.cjs
.docker build -t cr-bot .
and run with docker run -e APP_ID= -e PRIVATE_KEY= cr-bot
.LANGUAGE
, OPENAI_API_ENDPOINT
, MODEL
, PROMPT
, top_p
, temperature
, max_tokens
, MAX_PATCH_LENGTH
, IGNORE_PATTERNS
, INCLUDE_PATTERNS
, AZURE_API_VERSION
, and AZURE_DEPLOYMENT
.Highlighted Details
MAX_PATCH_LENGTH
.Maintenance & Community
The project is open-source with a contribution guide available. It is inspired by codereview.gpt
.
Licensing & Compatibility
Licensed under the ISC license, which is permissive and allows for commercial use and integration with closed-source projects.
Limitations & Caveats
The publicly deployed bot on AWS Lambda has rate limits and may be unstable; self-hosting is recommended for reliable use. The effectiveness of the review is dependent on the quality of the prompt and the capabilities of the chosen OpenAI model.
3 months ago
Inactive