Status: Production Ready ✅ | All Phases Complete | Enterprise Features Live
Hybrid AST + LLM GitHub Action that fuses multiple AI providers with consensus filtering, cost tracking, and security scanning. Now with incremental review (6x faster), CLI mode, analytics dashboard, and self-hosted deployment.
- Multi-provider execution with rotation, retries, and rate-limit awareness
- Hybrid analysis: fast AST heuristics + deep LLM prompts
- Consensus-based inline comments with severity thresholds
- Cost estimation/tracking and budget guardrails
- Incremental review (6x faster, 80% cheaper on PR updates)
- CLI mode for local development workflows
- Dry-run mode for previewing reviews without posting
- Chunked GitHub comment posting with JSON + SARIF report output
- Optional test coverage hints, AI code detection, and secrets scanning
- 85%+ test coverage with comprehensive benchmarks
- 📊 Analytics Dashboard - Track costs, performance, and ROI with HTML/CSV/JSON reports
- 🤖 Feedback Learning - Improves over time based on 👍/👎 reactions
- 🚫 Dismiss Findings - Add 👎 reaction to suppress false positives on future reviews
- 🔍 Code Graph Analysis - AST-based dependency tracking for better context
- ⚙️ Auto-Fix Prompts - Generate fix suggestions for AI IDEs (Cursor, Copilot)
- 📈 Provider Reliability - Track and rank providers by success rate and cost
- 🐳 Self-Hosted Deployment - Docker & webhook server for enterprise use
- 🔌 Plugin System - Add custom LLM providers without modifying core code
- Path patterns are validated to prevent injection/traversal: allowed chars
[A-Za-z0-9._-/*?{}[] ,], leading!(negation) and..segments are blocked. - Batch overrides (
PROVIDER_BATCH_OVERRIDES) must be integers 1-200; out-of-range values are clamped with a warning. - Concurrency control: workflow runs use a simple
${{ github.workflow }}-${{ github.ref }}-${{ github.run_id }}group to avoid duplicate reviews per commit/ref.
name: multi-provider-review
on:
pull_request:
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for incremental review
- uses: keithah/multi-provider-code-review@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REVIEW_PROVIDERS: openrouter/free
INCREMENTAL_ENABLED: 'true' # 6x faster on updates
env:
# Required when using OpenRouter providers (even free ones)
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}Note: When using OpenRouter providers, set OPENROUTER_API_KEY in your repository secrets. Get a free API key at openrouter.ai.
# Install globally
npm install -g multi-provider-code-review
# Review uncommitted changes
mpr review
# Review specific commit
mpr review HEAD~1
# Review branch comparison
mpr review main..feature
# Preview without running (dry-run)
mpr review --dry-run
# Generate analytics dashboard
mpr analytics generate
# View analytics summary
mpr analytics summary# Using Docker Compose
docker-compose up -d
# Or standalone Docker
docker run -d \
--name mpr-review \
-e GITHUB_TOKEN=your_token \
-e OPENROUTER_API_KEY=your_key \
-v mpr-cache:/app/.cache \
multi-provider-review:latestSee Self-Hosted Deployment Guide for details.
- OpenRouter (
openrouter/<model>): 200+ models via single API- Recommended:
openrouter/free- Automatically routes to best available free model - Alternative: Specific models like
openrouter/google/gemini-2.0-flash-exp:free - Requires:
OPENROUTER_API_KEYenvironment variable - Get free API key: openrouter.ai
- Recommended:
The following providers require local CLI installation and OAuth authentication. These are ideal for development environments and can be configured for CI/CD.
-
Claude Code CLI (
claude/<model>)- Examples:
claude/sonnet,claude/opus,claude/haiku - Requires:
claudeCLI installed and authenticated - Install: See Claude Code documentation
- Examples:
-
Codex CLI (
codex/<model>)- Examples:
codex/gpt-5.1-codex-max,codex/gpt-5.1-codex - Requires:
codexCLI installed and authenticated (ChatGPT Pro subscription) - Install:
npm install -g codex-cli
- Examples:
-
Gemini CLI (
gemini/<model>)- Examples:
gemini/gemini-2.0-flash,gemini/gemini-1.5-pro - Requires:
geminiCLI installed and authenticated (Google Cloud account) - Install:
npm install -g @google/gemini-cli
- Examples:
-
OpenCode CLI (
opencode/<model>)- Examples:
opencode/minimax-m2.1-free,opencode/deepseek/deepseek-chat - Requires:
opencodeCLI installed - Install:
npm install -g opencode-ai
- Examples:
OAuth-based CLIs (Claude Code, Codex, Gemini) require credential setup for CI/CD:
- Extract credentials from your local machine (where you're authenticated)
- Store as GitHub Secrets (encrypted storage)
- Restore in CI workflow before running reviews
If you have all CLIs authenticated locally and GitHub CLI (gh) installed:
# Set secrets for current repository
# Claude Code (macOS - uses Keychain)
security find-generic-password -s "Claude Code-credentials" -w 2>/dev/null | gh secret set CLAUDE_CODE_OAUTH
# Claude Code (Linux - uses config file instead)
cat ~/.config/claude/credentials.json | gh secret set CLAUDE_CODE_OAUTH
# Codex and Gemini (same on macOS/Linux)
cat ~/.codex/auth.json | gh secret set CODEX_AUTH_JSON
cat ~/.codex/config.toml | gh secret set CODEX_CONFIG_TOML
cat ~/.gemini/oauth_creds.json | gh secret set GEMINI_OAUTH_CREDS
cat ~/.gemini/settings.json | gh secret set GEMINI_SETTINGS
# For another repository, add: --repo owner/repo-nameNote: See CI Setup Guide for platform-specific instructions (Linux/macOS/Windows).
See the CI Setup Guide for:
- Detailed step-by-step instructions
- Manual secret creation via GitHub UI
- Complete workflow examples with credential restoration
- Platform-specific notes (Linux, macOS, Windows)
- Troubleshooting and security best practices
Workflow Example:
- name: Setup CLI Configuration Files
run: |
# Claude Code
if [ -n "${{ secrets.CLAUDE_CODE_OAUTH }}" ]; then
mkdir -p ~/.config/claude
echo '${{ secrets.CLAUDE_CODE_OAUTH }}' > ~/.config/claude/credentials.json
chmod 600 ~/.config/claude/credentials.json
fi
# Codex
if [ -n "${{ secrets.CODEX_AUTH_JSON }}" ]; then
mkdir -p ~/.codex
echo '${{ secrets.CODEX_AUTH_JSON }}' > ~/.codex/auth.json
echo '${{ secrets.CODEX_CONFIG_TOML }}' > ~/.codex/config.toml
chmod 600 ~/.codex/auth.json ~/.codex/config.toml
fi
# Gemini
if [ -n "${{ secrets.GEMINI_OAUTH_CREDS }}" ]; then
mkdir -p ~/.gemini
echo '${{ secrets.GEMINI_OAUTH_CREDS }}' > ~/.gemini/oauth_creds.json
echo '${{ secrets.GEMINI_SETTINGS }}' > ~/.gemini/settings.json
chmod 600 ~/.gemini/oauth_creds.json ~/.gemini/settings.json
fi
- name: Run Review
uses: keithah/multi-provider-code-review@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REVIEW_PROVIDERS: "claude/sonnet,codex/gpt-5.1-codex-max,gemini/gemini-2.0-flash"Add custom LLM providers without modifying core code:
# Enable plugins
export PLUGINS_ENABLED=true
export PLUGIN_DIR=./plugins
# Create custom provider
# See docs/plugins.md for detailsGITHUB_TOKEN: token with PR read/write scopePR_NUMBER: pull request number to review
INCREMENTAL_ENABLED(default:true): Enable 6x faster incremental reviewsINCREMENTAL_CACHE_TTL_DAYS(default:7): Cache lifetime for incremental reviewsBUDGET_MAX_USD(default:0): Skip if estimated cost exceeds this amountDRY_RUN(default:false): Preview mode without posting to GitHub
REVIEW_PROVIDERS: Comma-separated providers (examples:openrouter/<model>,opencode/<model>,claude/<model>,codex/<model>,gemini/<model>)FALLBACK_PROVIDERS: Backup providers if primary providers failPROVIDER_DISCOVERY_LIMIT(default:8): Max providers to discover/health-checkPROVIDER_LIMIT(default:6): Max providers to use for actual reviewPROVIDER_MAX_PARALLEL(default:3): Max parallel provider execution
INLINE_MAX_COMMENTS(default:5): Maximum inline comments to postINLINE_MIN_SEVERITY(default:major): Minimum severity for inline commentsINLINE_MIN_AGREEMENT(default:2): Providers required to agreeMIN_CHANGED_LINES(default:0): Skip if below this line countMAX_CHANGED_FILES(default:0): Skip if over this file countSKIP_LABELS: Comma-separated labels to skip review
ENABLE_AST_ANALYSIS(default:true): Fast AST-based analysisENABLE_SECURITY(default:true): Security secrets scanningENABLE_TEST_HINTS(default:true): Test coverage hintsENABLE_AI_DETECTION(default:true): AI-generated code detectionENABLE_CACHING(default:true): Cache findings for faster reviews
ANALYTICS_ENABLED(default:true): Track costs and performanceANALYTICS_MAX_REVIEWS(default:1000): Max reviews to storeLEARNING_ENABLED(default:true): Learn from feedback reactionsLEARNING_MIN_FEEDBACK_COUNT(default:5): Min feedback before learningQUIET_MODE_ENABLED(default:false): Filter low-confidence findingsQUIET_MIN_CONFIDENCE(default:0.5): Confidence threshold for quiet modeGRAPH_ENABLED(default:true): Enable code graph analysisGRAPH_MAX_DEPTH(default:5): Max dependency depthGENERATE_FIX_PROMPTS(default:false): Generate auto-fix suggestionsFIX_PROMPT_FORMAT(default:plain): Format for fix prompts (cursor, copilot, plain)PLUGINS_ENABLED(default:false): Enable custom provider pluginsPLUGIN_DIR(default:./plugins): Plugin directory path
REPORT_BASENAME(default:multi-provider-review): Base name for*.jsonand*.sariffiles
npm install
npm run hooks:install # Install pre-commit hooksnpm run build # Bundle action and CLI
npm run build:prod # Minified production build
npm run test # All tests
npm run test:unit # Fast unit tests only
npm run test:coverage # Coverage report (target: 85%)
npm run benchmark # Performance benchmarksnpm run lint # ESLint
npm run format # Prettier formatting
npm run typecheck # TypeScript type checkingThe pre-commit hook automatically runs on every commit:
- Type checking
- Linting
- Fast unit tests
- Build verification
Skip with: git commit --no-verify
- Test Coverage: 85%+ with 42 test files, 5,192 lines of test code
- Incremental Review: 6x faster, 80% cheaper on PR updates
- CLI Mode: Full local development workflow
- Performance: All benchmarks exceed targets by 10-100x
- DX: Pre-commit hooks, dry-run mode, structured logging
- Feedback Learning: Learns from 👍/👎 reactions, adjusts confidence thresholds
- Code Graph: AST-based dependency tracking with O(1) lookups
- Quiet Mode: Filters low-confidence findings using learned thresholds
- Auto-Fix Prompts: Generates fix suggestions for AI IDEs (Cursor, Copilot, Plain)
- Provider Reliability: Tracks success rates, false positives, and cost per provider
- Comprehensive Tests: Full test coverage for all Phase 2 features
- Analytics Dashboard: HTML/CSV/JSON reports with cost trends, ROI calculation
- Self-Hosted Deployment: Docker + docker-compose with webhook server
- Plugin System: Load custom LLM providers dynamically
- Enterprise Features: Webhook server, health checks, graceful shutdown
- Documentation: Complete guides for self-hosting, plugins, and analytics
- Security Hardening: Secret redaction, resource leak fixes, path traversal protection
All 14 weeks of v0.2.1 development plan delivered. Production ready with 303/306 tests passing (99%). Ready for enterprise deployment.
See DEVELOPMENT_PLAN_V2.1.md for detailed roadmap.
Track costs, performance, and ROI with the built-in analytics dashboard.
# Generate interactive HTML dashboard
mpr analytics generate
# View summary in terminal
mpr analytics summary
# Generate CSV export for spreadsheets
mpr analytics generate --format csv- Cost Trends: Daily cost and review count over time
- Performance: Review speed, cache hit rates, optimization trends
- ROI Analysis: Automatic calculation of cost vs time saved
- Provider Performance: Success rates, costs, and reliability by provider
- Findings Distribution: Issues by severity and category
- Summary Cards: Total reviews, costs, findings, cache effectiveness
reports/analytics-dashboard.html- Interactive HTML dashboard (open in browser)reports/analytics-export.csv- Spreadsheet-compatible datareports/analytics-metrics.json- Raw metrics for custom processing
# Enable analytics (default: true)
ANALYTICS_ENABLED: 'true'
# Maximum reviews to store (default: 1000)
ANALYTICS_MAX_REVIEWS: '1000'See Analytics Guide for complete documentation including:
- GitHub Actions integration for automated reports
- Slack/email notifications
- Cost optimization strategies
- Custom data processing examples
- User Guide - Dismissing findings, feedback learning, and usage tips
- Performance Guide - Optimization strategies and configuration tuning
- Security Guide - Security features, best practices, and threat model
- Error Handling Guide - Error recovery and debugging strategies
- Troubleshooting Guide - Common issues and solutions
- Improving Code Reviews - Reducing false positives and improving review accuracy
- Auto-Detection System - How auto-detection reduces false positives by 60%
- Self-Hosted Deployment - Docker deployment and webhook setup
- Plugin Development - Create custom LLM provider plugins
- Analytics Guide - Track costs, performance, and ROI
- DEVELOPMENT_PLAN_V2.1.md - Complete development roadmap and status
- INCREMENTAL_REVIEW.md - Incremental review system documentation
- scripts/README.md - Development scripts and hooks
__tests__/benchmarks/README.md- Performance benchmarking guide