Skip to main content

AI-powered code reviewer with OWASP Top 10 checks

Project description

๐Ÿค– 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 .

๐Ÿณ Docker

Run without installing anything:

# Build image
docker build -t ai-reviewer https://github.com/briej/ai-reviewer.git#main

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

# 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

# Cloud mode โ€” AI-powered analysis
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
      - run: ai-review . --mode fast --format sarif --output report.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: 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

Project details


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.2.1.tar.gz (13.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.2.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_reviewer_cli-1.2.1.tar.gz
  • Upload date:
  • Size: 13.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.2.1.tar.gz
Algorithm Hash digest
SHA256 6003ca92349b9ee4456aede9ec9ec92aed60aa77beba4712a11a03f6ed3e1b8c
MD5 bddf262fed18758ba04cdc0744152516
BLAKE2b-256 634be5d5b97333213c3309388679be081fdace4be653c577c6ab9d14346f50c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ai_reviewer_cli-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a570867fb5f7cb8d78a0ca67bd65220fa17b8cb14a55d737e62cfb21d4fa694d
MD5 1bdc20c1bb0d426af3e692acca2415b1
BLAKE2b-256 97080fcadddbc3c20befcf3d033343ace20e1c4ff2431126a538b0a1c7f4dd33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page