Spaces:
Sleeping
Sleeping
metadata
title: PRism AI Code Reviewer
emoji: π€
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
PRism AI Code Reviewer
Automated AI-powered code review bot for GitHub Pull Requests using Google Gemini AI.
Setup Instructions
1. Configure Secrets in HuggingFace Space Settings
Go to your Space Settings β Variables and secrets, and add:
GITHUB_TOKEN- Your GitHub personal access token withreposcopeGEMINI_API_KEY- Your Google Gemini API key (get from https://aistudio.google.com/apikey)GITHUB_WEBHOOK_SECRET- Random secret string (generate withopenssl rand -hex 32)
2. Configure GitHub Webhook
- Go to your GitHub repo β Settings β Webhooks β Add webhook (or edit existing)
- Payload URL:
https://YOUR-SPACE-NAME.hf.space/webhook/github - Content type:
application/json - Secret: Same value as
GITHUB_WEBHOOK_SECRETabove - Events: Select "Let me select individual events" β Check ONLY "Pull requests" (uncheck everything else)
- Active: β Check this box
Important: Make sure ONLY "Pull requests" is checked to avoid unnecessary webhook calls
3. Test It
Open a Pull Request in your repo and watch PRism automatically review it!
How It Works
- PR opened/updated β GitHub sends webhook
- PRism fetches the code changes (diff)
- Google Gemini AI analyzes the code
- PRism posts review comments back to the PR
Features
- π Fast: Uses Gemini 2.0 Flash for quick responses
- π¬ Real-time: Comments appear as each file is analyzed
- π― Accurate: Line-specific feedback with severity levels
- π Secure: Webhook signature verification
Local Development
pip install -r requirements.txt
uvicorn app.main:app --reload
Visit: http://localhost:8000