THE ONLY GUIDE YOU NEED - Everything from installation to usage in one place.
What is Ansieyes?
- AI-powered GitHub bot for PR reviews and issue triage
- Uses Google's Gemini AI
- Mention-based triggers:
/ansieyes_prreview,/ansieyes_triage, and/ansieyes_triage_force(same as triage but skips prompt-injection screening)
What you need:
- Python 3.8+, Node.js, Git
- Gemini API key: https://makersuite.google.com/app/apikey
- GitHub account with admin access
Time to setup: 5-10 minutes with automated script
Where to run:
- Development: Your laptop + ngrok (for testing)
- Production: EC2/VPS/server with public IP (for 24/7 operation)
cd Ansieyes
./setup-ansieyes.shThe script will:
- ✅ Check and install dependencies (Node.js, repomix, Python packages)
- ✅ Clone and setup AI-Issue-Triage
- ✅ Guide you through GitHub App creation
- ✅ Configure environment variables
- ✅ Test the setup
- ✅ (Optional) Deploy to AWS
Just follow the prompts - that's it!
# Install Node.js (if not installed)
# macOS: brew install node
# Linux: sudo apt install nodejs npm
# Install repomix (required for issue triage)
npm install -g repomix
# Verify
repomix --version
node --version
python3 --version# Clone AI-Issue-Triage
cd ~ # or your preferred directory
git clone https://github.com/shvenkat-rh/AI-Issue-Triage.git
cd AI-Issue-Triage
git checkout feature/pr-analyzer
# Install dependencies
pip install -r requirements.txt
# Note this path - you'll need it
pwd # Example: /Users/username/AI-Issue-Triagecd /path/to/Ansieyes
pip install -r requirements.txt- Go to: https://github.com/settings/apps
- Click "New GitHub App"
Basic Information:
- GitHub App name:
ansieyes-bot(or your choice) - Homepage URL:
https://github.com/your-username/Ansieyes - Webhook URL:
https://your-domain.com/webhook- For testing: Use ngrok URL (see Step 6)
- Webhook secret: Generate strong random string (save it!)
Repository Permissions:
- Contents: Read-only
- Issues: Read and write ✓
- Pull requests: Read and write ✓
- Metadata: Read-only (auto-selected)
- Actions: Read-only
Subscribe to Events:
- ☑ Issue comment (REQUIRED)
- ☑ Pull request
- ☑ Workflow run
- Save the App ID (you'll see it at top of settings)
- Click "Generate a private key" (downloads .pem file)
- Click "Install App" → Select your repositories
cd /path/to/Ansieyes
cp env_example.txt .envEdit .env with your values:
# Get from https://makersuite.google.com/app/apikey
GEMINI_API_KEY=your_actual_gemini_api_key
# From GitHub App settings page
GITHUB_APP_ID=123456
# Full path to the .pem file you downloaded
GITHUB_PRIVATE_KEY_PATH=/absolute/path/to/your-app.private-key.pem
# The webhook secret you created
GITHUB_WEBHOOK_SECRET=your_webhook_secret
# Path to AI-Issue-Triage from Step 2
AI_TRIAGE_PATH=/Users/username/AI-Issue-Triage
# Server settings (defaults are fine)
PORT=3000
HOST=0.0.0.0Important: Use absolute paths, not relative paths!
# macOS
brew install ngrok
# Or download from https://ngrok.com/downloadTerminal 1 - Start Ansieyes:
cd /path/to/Ansieyes
python3 app.pyYou should see:
INFO:__main__:Starting GitHub PR Review Bot on 0.0.0.0:3000
Terminal 2 - Start ngrok:
ngrok http 3000You'll see:
Forwarding https://abc123.ngrok.io -> http://localhost:3000
Copy the ngrok URL (e.g., https://abc123.ngrok.io)
- Go to your GitHub App settings
- Edit webhook URL to:
https://abc123.ngrok.io/webhook - Save changes
- Go to a test repository where the app is installed
- Create a test pull request
- Add a comment:
/ansieyes_prreview - Bot should respond with code review (~10-30 seconds)
- Create a test issue
- Add a comment:
/ansieyes_triage - Bot should respond with analysis (~30-70 seconds)
- Try
/ansieyes_triageon a PR → Should get error message ✓ - Try
/ansieyes_prreviewon an issue → Should get error message ✓
If all tests pass, you're ready!
| Command | Use On | What It Does | Time |
|---|---|---|---|
/ansieyes_prreview |
Pull Requests ONLY | AI code review | 10-30s |
/ansieyes_triage |
Issues ONLY | Two-pass analysis + labeling (includes prompt-injection check) | 30-70s |
/ansieyes_triage_force |
Issues ONLY | Same as /ansieyes_triage but does not run prompt-injection detection |
30-70s |
Commands must be exact with no extra text:
✅ Correct:
/ansieyes_triage
❌ Wrong:
/ansieyes_triage please analyze
Hey /ansieyes_triage
/ansieyes_triage!
@ab_triage (missing underscore)
Uses: Direct Gemini API (NOT AI-Issue-Triage)
What it does:
- Fetches all changed files from PR
- Analyzes code with Gemini AI
- Identifies bugs, security issues, code quality problems
- Suggests improvements and best practices
- Posts detailed review comment
Example output:
## 🤖 AI Code Review (Powered by Gemini)
### Overall Assessment
This PR adds user authentication...
### Strengths
- Well-structured code
- Good test coverage
### Issues Found
- Security: API keys hardcoded
- Performance: N+1 query in loop
### Suggestions
1. Move secrets to environment variables
2. Optimize database queries with eager loading
...Uses: AI-Issue-Triage package with two-pass architecture
What it does:
- Prompt-injection screening on the issue title and body (high/critical risk blocks triage)
- Clones your repository to fetch:
triage.config.json(if exists).omit-triage(if exists)
- Duplicate Check: Compares with existing open issues
- Librarian Pass: Identifies relevant files from codebase
- Surgeon Pass: Deep analysis of identified code
- Auto-labeling: Applies type and severity labels
- Posts comprehensive analysis
Same pipeline as /ansieyes_triage, but step 1 (prompt-injection screening) is skipped. Use when a maintainer trusts the issue content and triage was blocked as a false positive.
Example output:
## 🤖 AI Two-Pass Issue Triage
### 📚 Pass 1: Librarian (File Identification)
Identified 5 relevant file(s):
1. src/auth/login.py
2. src/middleware/auth.py
...
### 🔬 Pass 2: Surgeon (Deep Analysis)
Type: BUG
Severity: HIGH
Confidence: 85%
#### Summary
The login failure is caused by...
#### Root Cause
> The authentication middleware is not properly...
#### Proposed Solutions
1. Update the middleware to handle edge cases...You can add these files to your repository root to customize triage:
{
"repository": {
"url": "https://github.com/your-org/your-repo.git",
"description": "Your repository description"
},
"omit_directories": [
"node_modules",
"vendor",
"dist",
"build",
".git"
]
}# Directories to exclude from analysis
node_modules
vendor
dist
build
.git
__pycache__
.venv
Note: Bot automatically fetches these from your repo when triage runs. If they don't exist, defaults are used.
When triage completes successfully, these labels are automatically created (if they don't exist) and added:
Type Labels (from AI-Issue-Triage):
Type : Bug🐛Type : Enhancement✨Type : Feature Request🚀
Severity Labels (from AI-Issue-Triage):
Severity : Critical🔴Severity : High🟠Severity : Medium🟡Severity : Low🟢
Status Labels:
ai-triaged- Analysis completedduplicate- Duplicate issue detectedPrompt injection blocked- High/critical risk prompt injection attempt detected
Note: Labels are automatically created in your repository with appropriate colors if they don't already exist.
For Development/Testing:
- Run on your local machine (laptop/desktop)
- Use ngrok for webhook URL
- Test everything locally
For Production:
- Run on your production server (EC2, VPS, etc.)
- Use server's public IP or domain for webhook URL
- Bot runs 24/7 on the server
Step-by-step for EC2:
-
Launch EC2 instance (Ubuntu 22.04 recommended, t3.small or larger)
-
SSH into EC2:
ssh -i your-key.pem ubuntu@your-ec2-ip- Clone and setup Ansieyes ON THE EC2 INSTANCE:
# On EC2 instance
git clone <ansieyes-repo-url>
cd Ansieyes
./setup-ansieyes.sh-
Script will install everything on EC2:
- Python dependencies
- Node.js and repomix
- AI-Issue-Triage
- Configure environment
-
Get your EC2 webhook URL:
Option A: Use EC2 Public IP (Quick)
# On EC2, get your public IP curl ifconfig.me # Example output: 54.123.45.67 # Your webhook URL is: # http://54.123.45.67:3000/webhook
Option B: Use EC2 Public DNS (Better)
# Find in AWS Console → EC2 → Instance → Public IPv4 DNS # Example: ec2-54-123-45-67.compute-1.amazonaws.com # Your webhook URL is: # http://ec2-54-123-45-67.compute-1.amazonaws.com:3000/webhook
Option C: Use Elastic IP + Domain (Best for Production)
# 1. In AWS Console, allocate Elastic IP # 2. Associate it with your EC2 instance # 3. Point your domain to the Elastic IP (Route53 or your DNS) # Example: ansieyes.yourdomain.com → 54.123.45.67 # Your webhook URL is: # https://ansieyes.yourdomain.com/webhook (with SSL)
-
Configure GitHub webhook:
- Go to your GitHub App settings
- Set Webhook URL to one of the URLs above
- For Option C with domain, set up nginx with SSL (see below)
-
Important: Open port 3000 in EC2 Security Group:
AWS Console → EC2 → Security Groups → Edit inbound rules Add rule: - Type: Custom TCP - Port: 3000 - Source: 0.0.0.0/0 (or restrict to GitHub IPs) -
Keep bot running:
# Option A: Use screen
screen -S ansieyes
python3 app.py
# Press Ctrl+A then D to detach
# Option B: Use systemd (better)
sudo nano /etc/systemd/system/ansieyes.service
# (See service file example below)
sudo systemctl start ansieyes
sudo systemctl enable ansieyesSystemd service file example:
[Unit]
Description=Ansieyes GitHub Bot
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/Ansieyes
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
ExecStart=/usr/bin/python3 /home/ubuntu/Ansieyes/app.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetSecurity considerations for EC2:
- Open port 3000 in Security Group
- Use HTTPS with reverse proxy (nginx/Apache)
- Keep credentials secure
- Regular updates
Optional: Setup nginx with SSL (Recommended for production)
# Install nginx and certbot
sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx
# Create nginx config
sudo nano /etc/nginx/sites-available/ansieyes
# Paste this:
server {
server_name ansieyes.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# Enable site
sudo ln -s /etc/nginx/sites-available/ansieyes /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
# Get SSL certificate (free from Let's Encrypt)
sudo certbot --nginx -d ansieyes.yourdomain.com
# Now your webhook URL is:
# https://ansieyes.yourdomain.com/webhookAfter nginx setup:
- Change Security Group: Close port 3000, open ports 80 and 443
- Bot still runs on port 3000 internally
- Nginx forwards requests from 443 → 3000
- GitHub webhooks use:
https://ansieyes.yourdomain.com/webhook
For detailed AWS setup, see docs/AWS_DEPLOYMENT.md or use the setup script:
./setup-ansieyes.sh
# Choose option 3 (AWS Deployment)# Install Railway CLI
npm install -g railway
# Login and initialize
railway login
railway init
# Deploy
railway up
# Set environment variables in Railway dashboard
# Add all variables from .env file- Push code to GitHub
- Go to https://render.com/
- New Web Service → Connect your Ansieyes repo
- Set environment variables (from .env)
- Click "Create Web Service"
# Build and run with docker-compose
docker-compose up -d
# Or build manually
docker build -t ansieyes .
docker run -d -p 3000:3000 --env-file .env ansieyes# On your server
cd /opt/ansieyes
python3 app.py
# Or use systemd service
sudo systemctl start ansieyes
sudo systemctl enable ansieyes- Must be exact match:
/ansieyes_triage,/ansieyes_triage_force, or/ansieyes_prreview - No extra text allowed
- No typos (check underscore placement)
# Verify these in GitHub App settings:
- App is installed on the repository
- Permissions: Issues (RW), PRs (RW), Contents (R)
- Events: Issue comment is checked ✓
- Webhook URL is correct and accessibleTo check webhook deliveries:
- Go to GitHub App settings → Advanced tab
- Click "Recent Deliveries"
- Check for errors in delivery logs
# Check terminal where bot is running
# Look for errors in output
# Or if running as service (log path is the app directory, not /var/log)
tail -f /path/to/Ansieyes/ansieyes.log
# e.g. on EC2: tail -f ~/Ansieyes/ansieyes.log
# Or follow the systemd journal:
journalctl -u ansieyes -f# Verify the path exists
ls -la $AI_TRIAGE_PATH
# Update .env with correct ABSOLUTE path
nano .env
# Change AI_TRIAGE_PATH to correct value
# Restart bot# Install repomix globally
npm install -g repomix
# Verify installation
which repomix
repomix --version
# If still not found, add to PATH
export PATH=$PATH:/usr/local/bin
# Or wherever npm global packages are installedThis is EXPECTED behavior! The bot validates context:
Example 1: Wrong command on PR
User comments on PR: /ansieyes_triage
Bot responds:
⚠️ Invalid Command
/ansieyes_triage (and /ansieyes_triage_force) can only be used on issues.
For PR reviews, use /ansieyes_prreview instead.
Solution: Use /ansieyes_prreview on PRs
Example 2: Wrong command on Issue
User comments on Issue: /ansieyes_prreview
Bot responds:
⚠️ Invalid Command
/ansieyes_prreview can only be used on pull requests.
For issue triage, use /ansieyes_triage or /ansieyes_triage_force instead.
Solution: Use /ansieyes_triage on issues
# Test API key
python3 << EOF
import os
from dotenv import load_dotenv
import google.generativeai as genai
load_dotenv()
genai.configure(api_key=os.getenv('GEMINI_API_KEY'))
model = genai.GenerativeModel('gemini-2.0-flash-001')
response = model.generate_content('Hello')
print(response.text)
EOF
# If error:
# - Check API key is valid
# - Check API quota limits
# - Verify internet connectivity# Verify private key file exists
cat $GITHUB_PRIVATE_KEY_PATH
# Should show PEM format key starting with:
# -----BEGIN RSA PRIVATE KEY-----
# Check environment variables
env | grep GITHUB
# Verify App ID is correct (numbers only)
# Verify webhook secret matches what's in GitHubNormal timing:
- PR Review: 10-30 seconds (depends on PR size)
- Issue Triage: 30-70 seconds (includes cloning, duplicate check, 2 passes)
If much slower:
- Check network connectivity
- Large repository? First clone takes longer
- Gemini API rate limits? Check quota
- Server resources? Check CPU/memory
This is OK! Bot will use defaults if files don't exist in your repo.
To add configuration:
- Create
triage.config.jsonin your repo root - Create
.omit-triagein your repo root - Commit and push
- Next
/ansieyes_triagewill use them
To verify bot is fetching configs: Check bot logs for:
INFO:issue_triager:Cloning repository to fetch configuration files...
INFO:issue_triager:Repository cloned to /tmp/...
GitHub Event
│
├─── Webhook (POST /webhook)
│
▼
Ansieyes (app.py)
│
├─── Signature Verification
│
├─── Event Type Detection
│ │
│ ├─── pull_request → pr_reviewer.py
│ │ │
│ │ └──→ Gemini API (direct)
│ │
│ └─── issue_comment → Check comment text
│ │
│ ├─── "/ansieyes_prreview" → pr_reviewer.py
│ │ │
│ │ └──→ Gemini API
│ │
│ ├─── "/ansieyes_triage" → issue_triager.py
│ └─── "/ansieyes_triage_force" → issue_triager.py (skip injection check)
│ │
│ ├─── Clone repo (get configs)
│ │
│ ├─── AI-Issue-Triage/duplicate_check
│ │ └──→ Gemini API
│ │
│ ├─── AI-Issue-Triage/librarian (Pass 1)
│ │ └──→ Gemini API
│ │
│ └─── AI-Issue-Triage/analyzer (Pass 2)
│ └──→ Gemini API
│
└─── Post Results to GitHub
- PR Review: Uses
pr_reviewer.pydirectly with Gemini (does NOT use AI-Issue-Triage) - Issue Triage: Uses AI-Issue-Triage package with two-pass architecture
- Config Fetching: Bot clones repository to get
triage.config.jsonand.omit-triage - Exact Matching: Commands must be exact (
/ansieyes_triage,/ansieyes_triage_force, or/ansieyes_prreviewonly) - Context Validation: Wrong command on wrong context shows helpful error
Q: Can I change the trigger commands?
A: Yes, edit app.py and change the CMD_TRIAGE, CMD_TRIAGE_FORCE, and CMD_PR_REVIEW constants near the top of the file.
Q: Does PR review use AI-Issue-Triage?
A: No. Only issue triage uses AI-Issue-Triage. PR review uses Gemini directly.
Q: What if I don't have triage.config.json in my repo?
A: That's fine! Bot will use defaults. Add config files for better results.
Q: Can I use this on private repositories?
A: Yes, if your GitHub App is installed on those repositories.
Q: How much does it cost?
A: Depends on usage. Gemini API pricing is per token. Rough estimate: $0.01-0.05 per triage.
Q: Can I self-host this?
A: Yes! Run on any server with Python 3.8+ and Node.js.
Q: Does it work with GitHub Enterprise?
A: Yes, but you need to configure your GitHub Enterprise API endpoint.
Q: Can multiple people trigger analysis simultaneously?
A: Yes, bot handles concurrent requests.
Q: What happens if analysis fails?
A: Bot posts an error message to the issue/PR with troubleshooting info.
Q: Can I disable duplicate detection?
A: Yes, modify issue_triager.py to skip the duplicate check step.
# Gemini AI Configuration
GEMINI_API_KEY=your_gemini_api_key
# Get from: https://makersuite.google.com/app/apikey
# GitHub App Configuration
GITHUB_APP_ID=123456
# From GitHub App settings page
GITHUB_PRIVATE_KEY_PATH=/absolute/path/to/private-key.pem
# Full path to .pem file downloaded from GitHub
GITHUB_WEBHOOK_SECRET=your_webhook_secret
# The secret you created for your GitHub App
# AI-Issue-Triage Path
AI_TRIAGE_PATH=/absolute/path/to/AI-Issue-Triage
# Where you cloned AI-Issue-Triage repository# Server Configuration (defaults shown)
PORT=3000
HOST=0.0.0.0
# Alternative: Use base64 encoded private key (for cloud deployments)
GITHUB_PRIVATE_KEY_B64=your_base64_encoded_key# Automated setup
./setup-ansieyes.sh
# Manual setup
npm install -g repomix
pip install -r requirements.txt
cp env_example.txt .env
# Edit .env, then:
python3 app.py/ansieyes_triage # Issue triage (exact match only)
/ansieyes_triage_force # Issue triage without prompt-injection check
/ansieyes_prreview # PR review (exact match only)
# Start bot
python3 app.py
# Start ngrok (different terminal)
ngrok http 3000
# Check logs
tail -f app.log
# Test API key
python3 -c "import google.generativeai as genai; genai.configure(api_key='your_key'); print('OK')"- Issues: Open a GitHub issue
- Setup Help: Re-run
./setup-ansieyes.sh - AI-Issue-Triage: https://github.com/shvenkat-rh/AI-Issue-Triage
- Gemini API: https://ai.google.dev/
- Run:
./setup-ansieyes.sh(or follow manual steps) - Create: GitHub App with correct permissions
- Test: Use
/ansieyes_triageon issue,/ansieyes_prreviewon PR - Deploy: To AWS/Railway/Render for production
- Customize: Add
triage.config.jsonto your repos
That's it! You're ready to use Ansieyes.
Version: 2.0
Last Updated: January 2, 2026
License: MIT