English | 中文
AI-powered code review assistant for GitHub with customizable rules and multi-provider support
- ✨ Features
- 🚀 Quick Start
- 📦 Installation
- ⚙️ Configuration
- 🤖 AI Providers
- 🔧 Usage
- 🏗️ CI/CD Integration
- 📚 Examples
- 🖼️ Screenshots
- 🐛 Troubleshooting
- 🤝 Contributing
- 📄 License
|
🤖 AI-Powered Reviews
|
📝 Smart Rules
|
|
🔧 Easy Integration
|
🎯 Flexible & Secure
|
Get ReviewCopilot running in under 2 minutes:
# 1. Install
npm install -D review-copilot
# 2. Initialize
npx review-copilot init
# 3. Set your API key
echo "AI_API_KEY_DEEPSEEK=your-api-key" >> .env
# 4. Run review
npx review-copilot review💡 Tip: DeepSeek is recommended for stability. OpenAI support is in beta.
- ✅ Automated code quality analysis
- ✅ Security vulnerability detection
- ✅ Performance optimization suggestions
- ✅ Best practices enforcement
- ✅ Direct PR comments integration
|
⏰ Save Time
|
🔧 Easy Setup
|
|
📈 Improve Quality
|
💰 Cost Effective
|
npm install -D review-copilotpnpm add -D review-copilotyarn add -D review-copilotAfter running npx review-copilot init, you'll get a .review-copilot.yaml file:
providers:
deepseek:
enabled: true
apiKey: ${AI_API_KEY_DEEPSEEK}
model: deepseek-chat
rules:
commitMessage:
enabled: true
pattern: '^(feat|fix|docs|style|refactor|test|chore|ci)(\\(.+\\))?: .{1,50}'
branchName:
enabled: true
pattern: '^(feature|bugfix|hotfix|release)/[A-Z]+-[0-9]+-.+'
codeChanges:
enabled: true
filePatterns:
- '**/*.{ts,tsx,js,jsx}'
- '!**/dist/**'
- '!**/node_modules/**'Create a .env file in your project root:
# Choose your AI provider
AI_API_KEY_DEEPSEEK=your-deepseek-api-key
AI_API_KEY_OPENAI=your-openai-api-key📖 Click to expand advanced configuration options
providers:
openai:
enabled: false
apiKey: ${AI_API_KEY_OPENAI}
model: gpt-4o-mini
baseURL: https://api.openai.com/v1
deepseek:
enabled: true
apiKey: ${AI_API_KEY_DEEPSEEK}
model: deepseek-chat
baseURL: https://api.deepseek.com/v1
customReviewPoints:
- name: 'Security Check'
prompt: 'Review code for potential security vulnerabilities, focusing on input validation, authentication, and data handling.'
- name: 'Performance Review'
prompt: 'Analyze code for performance bottlenecks, memory usage, and optimization opportunities.'
- name: 'Accessibility Check'
prompt: 'Review frontend code for accessibility compliance and best practices.'
rules:
commitMessage:
enabled: true
pattern: '^(feat|fix|docs|style|refactor|test|chore|ci)(\\(.+\\))?: .{1,50}'
prompt: 'Ensure commit messages follow Conventional Commits specification.'
branchName:
enabled: true
pattern: '^(feature|bugfix|hotfix|release)/[A-Z]+-[0-9]+-.+'
prompt: 'Check if branch name follows the pattern: <type>/<ticket-id>-<description>'
codeChanges:
enabled: true
filePatterns:
- '**/*.{ts,tsx,js,jsx,py,java,go,rs}'
- '!**/test/**'
- '!**/tests/**'
- '!**/*.test.*'
- '!**/*.spec.*'
- '!**/dist/**'
- '!**/build/**'
- '!**/node_modules/**'
- '!**/coverage/**'
prompt: 'Review code changes focusing on code quality, potential bugs, performance, security, and best practices.'- ✅ Stable and reliable
- ✅ Cost-effective
- ✅ Good code understanding
- 🔑 Get your API key: DeepSeek Platform
⚠️ Beta support- ✅ High-quality reviews
⚠️ Higher cost- 🔑 Get your API key: OpenAI Platform
# Review current branch changes
npx review-copilot review
# Review specific pull request
npx review-copilot review --pr 123
# Initialize configuration
npx review-copilot init
# Show help
npx review-copilot --helpControl which files are reviewed using glob patterns:
filePatterns:
# Include patterns
- '**/*.{ts,tsx,js,jsx}'
- '**/*.{py,java,go,rs}'
# Exclude patterns
- '!**/node_modules/**'
- '!**/dist/**'
- '!**/build/**'
- '!**/*.test.*'
- '!**/*.spec.*'Create .github/workflows/review.yml:
name: Code Review
on:
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created]
jobs:
review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || contains(github.event.comment.body, '@review-copilot')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: npm install -g review-copilot
- name: Run Review
env:
AI_API_KEY_DEEPSEEK: ${{ secrets.AI_API_KEY_DEEPSEEK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: review-copilot reviewAdd your API key to GitHub repository secrets:
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
AI_API_KEY_DEEPSEEK - Value: Your DeepSeek API key
🔒 Security Note: Never commit API keys directly to your repository. Always use GitHub Secrets or environment variables.
Comment @review-copilot on any pull request to trigger a manual review:
ReviewCopilot automatically reviews code changes and posts detailed feedback:
For complete setup instructions, see our examples directory.
📸 Click to view more screenshots
See a real review comment: ReviewCopilot PR Review Example
🔧 Common Issues and Solutions
# Error: No API key found
# Solution: Check your .env file
echo "AI_API_KEY_DEEPSEEK=your-key" >> .env# Add to your workflow if needed
permissions:
contents: read
pull-requests: write
issues: write# Make sure to escape special characters
filePatterns:
- '**/*.{ts,tsx}' # ✅ Correct
- '**/*.{ts,tsx}' # ❌ May cause issues without quotes| Error | Solution |
|---|---|
No changes detected |
Ensure you're in a git repository with changes |
API key not found |
Check your .env file and environment variables |
Rate limit exceeded |
Wait a moment and try again, or upgrade your API plan |
File pattern error |
Verify your glob patterns in configuration |
We welcome contributions! Here's how you can help:
# Clone the repository
git clone https://github.com/AlexShan2008/review-copilot.git
cd review-copilot
# Install dependencies
pnpm install
# Run tests
pnpm test
# Build the project
pnpm build- 🐛 Report bugs by opening an issue
- ✨ Suggest features or improvements
- 📖 Improve documentation
- 🔧 Submit pull requests
- 🧪 Add test cases
Please read our Contributing Guide for detailed guidelines.
Current Status
- ✅ GitHub integration: Fully supported
- 🚧 GitLab integration: In development
- ✅ DeepSeek provider: Stable
⚠️ OpenAI provider: Beta (PRs welcome!)
- 📋 Documentation: Check our examples
- 🐛 Bug Reports: Open an issue
- 💡 Feature Requests: Request a feature
- 💬 Questions: Ask in Issues
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the ReviewCopilot team

