A GitHub App that provides automated code review on Pull Requests. It utilizes Flake8 for static syntax analysis and Google Gemini 1.5 Flash for semantic code review, identifying logic bugs and security vulnerabilities that standard linters miss.
You do not need to download or host any code to use this tool. It is deployed as a public GitHub App.
- Navigate to the App's public installation page:
https://github.com/apps/autonomous-pr-reviewer-bot - Click Install.
- Select the specific repositories (or your entire account) where you want the reviewer active.
- Click Install & Authorize.
The application operates passively. Once installed:
- Create a new branch and commit your code changes.
- Open a Pull Request against your target branch (e.g.,
main). - The App will automatically detect the
pull_requestevent, analyze the diff, and post actionable feedback directly on the PR timeline as inline comments. - The bot will re-run its analysis automatically if you push new commits to the open PR.
If you wish to host your own instance of the application or modify its behavior, follow the setup instructions below.
- Python 3.10+
- A Google Gemini API Key
- A public endpoint for GitHub Webhooks (e.g., a Render web service or a local ngrok tunnel)
- In your GitHub account, navigate to Settings > Developer Settings > GitHub Apps > New GitHub App.
- Name your App and set the Webhook URL to your server's endpoint (e.g.,
https://your-domain.com/webhook). - Under Repository Permissions, set:
- Contents:
Read-only - Metadata:
Read-only - Pull Requests:
Read and write
- Under Subscribe to events, check Pull request.
- Click Create GitHub App.
- Save your App ID and generate a Private Key (
.pemfile).
- Clone the repository and navigate into the directory:
git clone https://github.com/your-username/autonomous-pr-reviewer.git
cd autonomous-pr-reviewer
- Set up the Python environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Create a .env file in the project root. You must format your .pem private key as a single continuous line, replacing physical line breaks with \n characters.
GITHUB_APP_ID=your_app_id
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
GEMINI_API_KEY=your_gemini_api_key
(Note: If deploying to Render, paste the raw, multi-line key into the dashboard variable without quotes).
Development:
python -m app.main
Production (WSGI):
gunicorn app.main:server