Skip to main content

🤖 ai-reviewer

AI-powered code reviewer with OWASP Top 10 checks. Fast. Local. Configurable.

Python 3.9+ License: MIT

  • ⚡ Works offline (Fast Mode) or with any AI provider (Cloud Mode)
  • 🔒 OWASP Top 10 security scanning
  • 🚀 Parallel processing
  • 📊 HTML / SARIF / JSON reports
  • 🎯 8 languages supported

🚀 Installation

pip install ai-reviewer-cli

Or from source:

git clone https://github.com/briej/ai-reviewer.git
cd ai-reviewer
pip install -e .

🤖 AI Mode

Use AI-powered analysis with Ollama or cloud providers:

# Ollama (local, free)
ai-review ./project --mode ai --provider ollama --model llama3.1

# DeepSeek (cloud, 1M free tokens)
ai-review ./project --mode cloud --provider deepseek --api-key sk-xxx

# OpenRouter (Anthropic Claude)
ai-review ./project --mode cloud --provider openrouter --api-key sk-xxx

# Groq (fast inference)
ai-review ./project --mode cloud --provider groq --api-key sk-xxx

Supported AI Providers:

  • Ollama - Local, unlimited, free (install separately)
  • DeepSeek - 1M free tokens/month
  • OpenRouter - Rate limited free tier
  • Groq - Rate limited free tier
  • Kimi - Trial available
  • Qwen - Trial available

🐳 Docker

Run without installing anything:

# Build image
docker build -t ai-reviewer .

# Run analysis on current directory
docker run -v $(pwd):/code ai-reviewer /code --mode fast

# AI mode with Ollama (requires Ollama running on host)
docker run -v $(pwd):/code --add-host host.docker.internal:host-gateway ai-reviewer /code --mode ai --provider ollama --model llama3.1

# Generate HTML report
docker run -v $(pwd):/code ai-reviewer /code --mode fast --format html --output /code/report.html

# With custom config
docker run -v $(pwd):/code -v $(pwd)/.ai-reviewer.yaml:/app/.ai-reviewer.yaml ai-reviewer /code

🎯 Quick Start

# Fast mode — instant analysis, no AI needed
ai-review ./my-project

# AI mode — Ollama-powered analysis (local)
ai-review ./my-project --mode ai --provider ollama --model llama3.1

# Cloud mode — AI-powered analysis (DeepSeek)
ai-review ./my-project --mode cloud --provider deepseek --api-key sk-xxx

# HTML report
ai-review ./my-project --format html --output report.html

# Parallel processing (8 threads)
ai-review ./my-project --threads 8

🔥 Features

Security (OWASP Top 10)

  • SQL Injection detection
  • XSS vulnerability scanning
  • Hardcoded secrets detection
  • Weak cryptography checks
  • CSRF protection validation

AI Providers

Provider Free Tier Setup
Ollama ✅ Unlimited Local install
DeepSeek ✅ 1M tokens API key
OpenRouter ✅ Rate limited API key
Kimi ✅ Trial API key
Qwen ✅ Trial API key
Groq ✅ Rate limited API key

Output Formats

  • CLI — Rich terminal output with tables
  • JSON — Machine-readable
  • HTML — Beautiful web report
  • SARIF — GitHub Code Scanning compatible

Supported Languages

Python, JavaScript, TypeScript, SQL, Go, Java, Rust, C/C++


📋 Usage Examples

Basic

ai-review ./project

Cloud with specific model

ai-review ./project \
  --mode cloud \
  --provider openrouter \
  --model qwen/qwen-2.5-coder-32b \
  --api-key sk-xxx

CI/CD Integration

ai-review . --mode fast --format sarif --output report.sarif

Filter severity

ai-review ./project --severity critical

Ignore patterns

ai-review ./project --ignore __pycache__ --ignore .git --ignore node_modules

⚙️ Configuration

Create .ai-reviewer.yaml in your project root:

mode: fast
threads: 4
severity: all

ignore:
  - __pycache__
  - .git
  - node_modules
  - "*.min.js"

cloud:
  provider: deepseek
  model: deepseek-coder
  timeout: 30

rules:
  - id: no-print
    pattern: "print("
    severity: info
    message: "Remove print statements"
    languages: [python]

🔄 GitHub Actions

name: Code Review
on: [push, pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - run: pip install ai-reviewer-cli
      - run: ai-review . --mode fast --format sarif --output report.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: report.sarif

AI-Powered CI/CD:

- run: pip install ai-reviewer-cli
- run: ai-review . --mode ai --provider ollama --model llama3.1 --format sarif --output report.sarif

🛠 Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/briej/ai-reviewer
    rev: v1.2
    hooks:
      - id: ai-reviewer

📊 Example Output

┌──────────────────────────────────────────────────┐
│ 🤖 ai-reviewer — v1.2                            │
│ OWASP Top 10 | Multi-Cloud | Parallel | Rich CLI │
└──────────────────────────────────────────────────┘

✓ Files found: 23

⚠️  CRITICAL (3)
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  hardcoded-secret   config.py:12   Hardcoded secret
  sql-injection      db.py:45       SQL Injection
  code-injection     utils.py:89    eval() is dangerous

🔶 WARNING (7)
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  weak-crypto        auth.py:34     Weak hash
  xss                frontend.js:67 innerHTML vulnerable

💡 INFO (12)
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  debug              main.py:23     console.log

──────────────────────────────────────────────────
┌────────────────┬───────┐
│ Files analyzed │ 23/23 │
│ Time           │ 0.45s │
│ Critical       │ 3     │
│ Warning        │ 7     │
│ Info           │ 12    │
│ Score          │ 4.2/10│
└────────────────┴───────┘

🤝 Contributing

See CONTRIBUTING.md


📜 License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_reviewer_cli-1.3.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_reviewer_cli-1.3.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file ai_reviewer_cli-1.3.0.tar.gz.

File metadata

  • Download URL: ai_reviewer_cli-1.3.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_reviewer_cli-1.3.0.tar.gz
Algorithm Hash digest
SHA256 56b096382ed16cebf68ba323a99e2321d5e4739ba7952bf44fdc46823ed41be0
MD5 3ea7ef1f2e0426326346f7feb9d59ed3
BLAKE2b-256 6a8c3cf501a719c26506b659007c2ca81fe5b587ed46cf8732db1d955304f0ce

See more details on using hashes here.

File details

Details for the file ai_reviewer_cli-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_reviewer_cli-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3b2f5d178dd0c5545c113c9cf5d9810e65eb05c02f99ca924821aec95d8cabc
MD5 93afb29b92b97698f4d9c58883bcda5c
BLAKE2b-256 dcedd333713122a3b254655048e168cbeb6d4212599e4006a734d97e4af3630d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page