Skip to content

peppa486/reviewx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– ReviewX

δΈ­ζ–‡ζ–‡ζ‘£ | English

License: MIT Python 3.9+ GitHub Action Powered by MiMo

Automated AI-powered code review for your pull requests. Works with any OpenAI-compatible API β€” just provide a base_url and API key. Also supports Anthropic Claude.

πŸ“Έ Screenshot: ReviewX posting inline comments on a PR


✨ Features

  • πŸ”„ GitHub Action β€” Auto-reviews PRs on open/sync
  • πŸ€– Universal Provider Support β€” Any OpenAI-compatible API (MiMo, OpenAI, DeepSeek, Qwen, Kimi, etc.) + Anthropic Claude
  • πŸ“ Inline Comments β€” Reviews specific lines in your diff
  • πŸ“Š Review Scoring β€” 0-100 score with severity breakdown
  • πŸ” Smart Detection β€” Bugs, security, performance, style
  • βš™οΈ Configurable β€” Exclude patterns, severity filters, custom rules
  • πŸ–₯️ CLI Mode β€” Review files and diffs from terminal
  • 🌐 Webhook Server β€” Standalone mode with GitHub webhooks
  • πŸ“ˆ Dashboard β€” Flask web UI for review history & stats

πŸš€ Quick Start

As a GitHub Action (Recommended)

  1. Add secrets to your repository:

    • MIMO_API_KEY β€” Your MiMo/OpenAI API key
  2. Create .github/workflows/review.yml:

name: AI Code Review
on:
  pull_request:
    types: [opened, synchronize, reopened]

permissions:
  contents: read
  pull-requests: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: peppa486/reviewx@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          ai-provider: openai
          openai-api-key: ${{ secrets.MIMO_API_KEY }}
          openai-base-url: https://token-plan-sgp.xiaomimimo.com/v1
          openai-model: mimo-v2.5-pro
  1. Open a PR and watch the magic! ✨

CLI Mode

# Install
pip install -r requirements.txt

# Review a PR
python cli.py review-pr --repo owner/repo --pr 42 --post-comments

# Review a single file
python cli.py review-file src/main.py

# Review a git diff
git diff HEAD~1 | python cli.py review-diff

# Start webhook server
python cli.py serve

Standalone Webhook Server

# Copy and edit config
cp config.yaml.example config.yaml

# Start server
python bot.py

Configure a GitHub webhook pointing to https://your-server:8080/webhook.


πŸ”§ Configuration

Environment Variables

Variable Description Default
AI_REVIEW_PROVIDER openai or anthropic openai
OPENAI_API_KEY API key for OpenAI-compatible providers β€”
OPENAI_BASE_URL API base URL https://token-plan-sgp.xiaomimimo.com/v1
OPENAI_MODEL Model name mimo-v2.5-pro
ANTHROPIC_API_KEY Anthropic API key β€”
GITHUB_TOKEN GitHub personal access token β€”

Config File

See config.yaml.example for full options including:

  • Severity level filters
  • File exclusion patterns
  • Review categories
  • Server settings

πŸ€– Supported AI Providers

ReviewX works with any OpenAI-compatible API β€” just provide a base_url and API key. No need for provider-specific code.

OpenAI-Compatible Providers (use openai provider)

Any service that implements the OpenAI chat completions API works out of the box:

  • Xiaomi MiMo β€” MiMo-V2.5 Pro (https://token-plan-sgp.xiaomimimo.com/v1)
  • OpenAI β€” GPT-5.5 (https://api.openai.com/v1)
  • DeepSeek β€” DeepSeek V4 Pro, DeepSeek V4 Flash (https://api.deepseek.com)
  • Moonshot / Kimi β€” Kimi K2.6 (https://api.moonshot.cn/v1)
  • Zhipu GLM β€” GLM-5.1 (https://open.bigmodel.cn/api/paas/v4)
  • Alibaba Qwen β€” Qwen 3.6 Max (https://dashscope.aliyuncs.com/compatible-mode/v1)
  • ByteDance Doubao β€” Doubao Seed 2.0 Pro (https://ark.cn-beijing.volces.com/api/v3)
  • xAI β€” Grok 4.3 (https://api.x.ai/v1)
  • MiniMax β€” M2.7 (https://api.minimaxi.com/v1)
  • Mistral β€” Medium 3.5 (https://api.mistral.ai/v1)
  • Any self-hosted β€” Ollama, vLLM, LiteLLM, etc.

Anthropic Claude (uses anthropic provider)

Claude uses the Anthropic API format (not OpenAI-compatible), so it needs a separate provider config:

  • Claude Opus 4.7 (claude-opus-4-7)
  • Set ai-provider: anthropic and provide ANTHROPIC_API_KEY

πŸ“Š Dashboard

The optional Flask dashboard shows review history and statistics:

python dashboard/app.py

Visit http://localhost:5000 to see:

  • Total reviews and average scores
  • Issue severity breakdown
  • Recent review history

πŸ“ Project Structure

reviewx/
β”œβ”€β”€ action.yml              # GitHub Action definition
β”œβ”€β”€ bot.py                  # Webhook server entry point
β”œβ”€β”€ cli.py                  # CLI entry point
β”œβ”€β”€ config.yaml.example     # Configuration template
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ reviewer.py         # Core review orchestration
β”‚   β”œβ”€β”€ providers/
β”‚   β”‚   β”œβ”€β”€ base.py         # Provider interface & prompts
β”‚   β”‚   β”œβ”€β”€ openai_provider.py
β”‚   β”‚   └── anthropic_provider.py
β”‚   β”œβ”€β”€ github_client.py    # GitHub API client
β”‚   β”œβ”€β”€ diff_parser.py      # Git diff parser
β”‚   β”œβ”€β”€ comment_formatter.py
β”‚   └── config.py           # Configuration management
β”œβ”€β”€ dashboard/              # Flask web dashboard
β”œβ”€β”€ tests/                  # Test suite
└── .github/workflows/      # Example workflow

πŸ§ͺ Testing

pip install pytest
pytest tests/ -v

πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ™ Credits

Built with ❀️ by peppa486

Powered by Xiaomi MiMo and other leading AI models.

About

πŸ€– AI-powered code review bot β€” supports MiMo, OpenAI, Claude, DeepSeek. GitHub Action + CLI + Webhook Server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors