Add RabbitAI to Your Repo
One workflow file. A few secrets. RabbitAI reviews every PR automatically.
Option 1 — GitHub Action
The recommended way. RabbitAI runs inside GitHub Actions on every PR — no server needed.
Step 1 — Add the workflow file
Create .github/workflows/review.yml in your repo:
name: RabbitAI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install RabbitAI
run: pip install rabbitai-reviewer
- name: Run RabbitAI
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
VECTOR_STORE_PROVIDER: ${{ vars.VECTOR_STORE_PROVIDER }}
EMBEDDING_PROVIDER: ${{ vars.EMBEDDING_PROVIDER }}
EMBEDDING_MODEL: ${{ vars.EMBEDDING_MODEL }}
LLM_PROVIDER: ${{ vars.LLM_PROVIDER }}
LLM_MODEL: ${{ vars.LLM_MODEL }}
REVIEW_LANGUAGE: ${{ vars.REVIEW_LANGUAGE }}
PINECONE_INDEX: ${{ vars.PINECONE_INDEX }}
run: |
python -c "
import os
from rabbitai.agent import run
result = run(os.environ['GITHUB_REPOSITORY'], int(os.environ['PR_NUMBER']))
print(result.comment_url if result.posted else result.reason)
"
Commit this file to your main branch. That's the only file you need in your repo.
Step 2 — Add your secrets
Go to your repo on GitHub → Settings → Secrets and variables → Actions
Under the Secrets tab, add whichever keys your chosen providers need:
| Secret | When you need it | Get it from |
|---|---|---|
GEMINI_API_KEY | Using Gemini for LLM or embeddings | aistudio.google.com → Get API key |
OPENAI_API_KEY | Using OpenAI for LLM or embeddings | platform.openai.com/api-keys |
PINECONE_API_KEY | Using Pinecone as vector store | app.pinecone.io → API Keys |
GITHUB_TOKENis injected automatically by GitHub. Do not add it as a secret.
Step 3 — Set your variables
Go to your repo → Settings → Secrets and variables → Actions → Variables tab
| Variable | Options | Default |
|---|---|---|
VECTOR_STORE_PROVIDER | chromadb · pinecone · qdrant | chromadb |
EMBEDDING_PROVIDER | gemini · openai | gemini |
EMBEDDING_MODEL | e.g. text-embedding-3-small | provider default |
LLM_PROVIDER | gemini · openai | gemini |
LLM_MODEL | e.g. gpt-4o-mini | provider default |
REVIEW_LANGUAGE | typescript · python · go etc | typescript |
PINECONE_INDEX | your Pinecone index name | code-review |
⚠️ Important: Make sure variable values have no leading/trailing spaces or newlines. A value of
" openai"instead of"openai"will cause anUnknown providererror.
⚠️ Pinecone users:
PINECONE_INDEXmust exactly match an index you've already created in your Pinecone dashboard. RabbitAI does not auto-create indexes. If the index doesn't exist you'll get a404 NOT_FOUNDerror. See Getting Your API Keys for index setup instructions.
If you skip this step entirely, RabbitAI defaults to Gemini for everything — free and zero config.
Step 4 — Open a PR
That's it. Open any PR on your repo and RabbitAI posts a structured review automatically.
Option 2 — MCP Server
Trigger reviews manually from inside Claude or Cursor IDE.
Setup
git clone https://github.com/nikhilsaiankilla/rabbitai
cd rabbitai
pip install rabbitai-reviewer
cp config.example.yaml config.yaml
# fill in your keys in config.yaml
python mcp/server.py
Add to Claude desktop
Edit claude_desktop_config.json:
{
"mcpServers": {
"rabbitai": {
"command": "python",
"args": ["/absolute/path/to/rabbitai/mcp/server.py"]
}
}
}
Add to Cursor
Go to Cursor Settings → MCP and add the same config.
Usage
Once connected, type inside Claude or Cursor:
"Review PR #12 in nikhilsaiankilla/myrepo"
RabbitAI fetches the diff, runs the full pipeline, and posts the comment directly on the PR.
Option 3 — Local CLI
Run reviews manually from your terminal.
git clone https://github.com/nikhilsaiankilla/rabbitai
cd rabbitai
pip install rabbitai-reviewer
cp config.example.yaml config.yaml
# fill in your keys in config.yaml
Create test.py:
from rabbitai.agent import run
result = run(
repo_name="your-username/your-repo",
pr_number=1,
)
print(result)
python test.py
The review posts as a comment on the PR. The comment URL is printed to stdout.
Requires Python 3.11. Use
py -3.11on Windows if you have multiple Python versions installed.
Getting Your API Keys
Gemini API key — free
- →Go to aistudio.google.com
- →Sign in with your Google account
- →Click Get API key → Create API key → copy it
No credit card required. The free tier covers most usage.
OpenAI API key
- →Go to platform.openai.com → sign in
- →Click your avatar → API keys
- →Create new secret key → copy it
Pinecone API key — free tier available
- →Go to app.pinecone.io → sign up
- →API Keys in the sidebar → copy your key
- →Indexes → Create Index with these settings:
- →Name: whatever you set as
PINECONE_INDEX(e.g.rabbitai) - →Dimensions:
768for Gemini ·1536for OpenAItext-embedding-3-small - →Metric:
cosine - →Cloud: AWS
us-east-1(free tier)
- →Name: whatever you set as
⚠️ The index name you create here must exactly match what you set in
PINECONE_INDEX. If they don't match, you'll get a404 NOT_FOUNDerror.
GitHub token — local dev only
Only needed when running locally. GitHub Actions injects the token automatically.
- →Go to github.com → avatar → Settings
- →Developer settings → Personal access tokens → Tokens (classic)
- →Generate new token (classic) → check
repo→ copy it
Never commit this token. Add it to
config.yamlonly — which is gitignored.