Skip to main content

AI-powered PR review agent that reviews pull requests with the depth of a senior engineer

Project description

โšก VibePR

AI-Powered PR Review Agent

Reviews pull requests with the depth, care, and directness of a senior engineer.

Python 3.10+ License: MIT Code style: ruff


๐Ÿš€ What is VibePR?

VibePR is an intelligent, opinionated PR review tool that combines built-in static analysis with LLM-powered semantic review to catch bugs, security vulnerabilities, and code quality issues that other tools miss.

Unlike linters, VibePR thinks at the level of logic, architecture, security, and intent.

Key Features

  • ๐Ÿ” Multi-dimensional analysis โ€” Security, logic, performance, and maintainability checks
  • ๐Ÿค– AI-powered deep review โ€” Optional LLM integration (OpenAI / Anthropic) for semantic analysis
  • ๐ŸŽฏ Smart verdicts โ€” Automatically determines APPROVE, REQUEST_CHANGES, or COMMENT
  • ๐Ÿ“Š Beautiful output โ€” Rich terminal UI, JSON for CI/CD, and Markdown for GitHub comments
  • ๐ŸŒ Web dashboard โ€” Browse and search past reviews with a premium dark-mode UI
  • ๐Ÿ“ฆ GitHub integration โ€” Fetch PRs directly, post reviews as comments
  • ๐Ÿ’พ Review history โ€” SQLite-backed storage for all past reviews
  • ๐Ÿ”ง Configurable โ€” YAML configuration with per-project overrides

๐Ÿ“ฆ Installation

pip install vibepr

Or install from source:

git clone https://github.com/chandanhastantram/vibepr.git
cd vibepr
pip install -e .

โšก Quick Start

Review a GitHub PR

# Review a public PR (no token needed)
vibepr review https://github.com/owner/repo/pull/123

# Review with GitHub token for private repos
export GITHUB_TOKEN=ghp_your_token
vibepr review https://github.com/owner/repo/pull/123

# Shorthand format
vibepr review owner/repo#123

Review Local Changes

# Review all uncommitted changes
vibepr review --local

# Review against a specific branch
vibepr review --local --base main

# Review only staged changes
vibepr review --local --staged

Deep AI Review

# Enable LLM-powered analysis (requires API key)
export OPENAI_API_KEY=sk-your-key
vibepr review https://github.com/owner/repo/pull/123 --deep

# Or use Anthropic
export ANTHROPIC_API_KEY=sk-ant-your-key
vibepr review --local --deep

Output Formats

# Beautiful terminal output (default)
vibepr review --local

# JSON for CI/CD pipelines
vibepr review --local --format json

# Markdown for GitHub comments
vibepr review --local --format markdown

# Post review directly to GitHub
vibepr review <PR_URL> --post

๐Ÿ” What VibePR Checks

๐Ÿ”ด Security

Check Languages Severity
Hardcoded secrets (AWS, Stripe, GitHub, OpenAI, etc.) All BLOCKER
SQL injection via string interpolation Python, JS BLOCKER
Command injection (os.system, subprocess shell=True) Python BLOCKER
Unsafe functions (eval, exec, pickle.loads) Python, JS BLOCKER
XSS via innerHTML JavaScript BLOCKER
Path traversal vulnerabilities Python WARNING
Database connection strings in code All BLOCKER

๐ŸŸก Logic & Correctness

Check Languages Severity
Bare except clauses Python WARNING
Swallowed exceptions (except + pass) Python WARNING
== None instead of is None Python SUGGESTION
== instead of === JavaScript WARNING
Floating promises (missing await) JavaScript WARNING
Empty catch blocks JavaScript WARNING

๐Ÿ”ต Performance

Check Languages Severity
N+1 query patterns in loops Python, JS WARNING
File opened without context manager Python WARNING
Sync fs operations blocking event loop JavaScript WARNING
HTTP requests inside loops Python, JS WARNING
useEffect without dependency array React WARNING
Event listeners without cleanup JavaScript SUGGESTION

๐ŸŸข Maintainability

Check Languages Severity
Magic numbers in logic All SUGGESTION
Deep nesting (>4 levels) All WARNING
Long functions (>50 lines) Python SUGGESTION
Missing docstrings on public APIs Python SUGGESTION
TODO/FIXME/HACK in new code All SUGGESTION/WARNING
Good type hints (praise) Python PRAISE
Good test coverage (praise) All PRAISE

โš™๏ธ Configuration

Create a .vibepr.yml in your project root or home directory:

github:
  token: ""  # Or set GITHUB_TOKEN env var

llm:
  provider: "none"     # "openai", "anthropic", or "none"
  api_key: ""          # Or set OPENAI_API_KEY / ANTHROPIC_API_KEY
  model: "gpt-4o"

review:
  security: true
  logic: true
  performance: true
  maintainability: true
  min_level: "suggestion"  # "blocker", "warning", "suggestion", "praise"
  ignore_patterns:
    - "*.min.js"
    - "package-lock.json"
    - "*.lock"

output:
  format: "terminal"    # "terminal", "json", "markdown"
  show_praise: true
  color: true

dashboard:
  host: "127.0.0.1"
  port: 8777
  db_path: "~/.vibepr/reviews.db"

๐Ÿ“Š Web Dashboard

Launch the built-in web dashboard to browse and search past reviews:

vibepr dashboard

Opens at http://127.0.0.1:8777 with:

  • ๐Ÿ“Š Aggregate statistics across all reviews
  • ๐Ÿ“œ Review history with filtering
  • ๐Ÿ” Detailed finding view per review
  • ๐ŸŽจ Premium dark-mode UI

๐Ÿ“œ Review History

# View recent reviews
vibepr history

# Filter by repo
vibepr history --repo owner/repo

# Filter by verdict
vibepr history --verdict REQUEST_CHANGES

# Limit results
vibepr history --limit 5

๐Ÿ—๏ธ Architecture

vibe_pr/
โ”œโ”€โ”€ cli.py              # Click CLI โ€” entry point
โ”œโ”€โ”€ config.py           # YAML config + env vars
โ”œโ”€โ”€ models.py           # Pydantic data models
โ”œโ”€โ”€ reviewer.py         # Core orchestrator
โ”œโ”€โ”€ github_client.py    # GitHub API (PyGithub)
โ”œโ”€โ”€ diff_parser.py      # Unified diff parsing
โ”œโ”€โ”€ storage.py          # SQLite review history
โ”œโ”€โ”€ utils.py            # Shared utilities
โ”œโ”€โ”€ analyzers/          # Static analysis engines
โ”‚   โ”œโ”€โ”€ security.py     # Secret, injection, unsafe function detection
โ”‚   โ”œโ”€โ”€ logic.py        # Error handling, edge cases, comparisons
โ”‚   โ”œโ”€โ”€ performance.py  # N+1, memory leaks, blocking ops
โ”‚   โ””โ”€โ”€ maintainability.py # Complexity, naming, documentation
โ”œโ”€โ”€ llm/                # LLM providers
โ”‚   โ”œโ”€โ”€ openai_provider.py
โ”‚   โ”œโ”€โ”€ anthropic_provider.py
โ”‚   โ””โ”€โ”€ prompts.py      # Review prompt templates
โ”œโ”€โ”€ formatters/         # Output renderers
โ”‚   โ”œโ”€โ”€ terminal.py     # Rich terminal UI
โ”‚   โ”œโ”€โ”€ json_formatter.py
โ”‚   โ””โ”€โ”€ markdown.py
โ””โ”€โ”€ dashboard/          # Web dashboard (Flask)
    โ”œโ”€โ”€ app.py
    โ”œโ”€โ”€ templates/
    โ””โ”€โ”€ static/

๐Ÿงช Testing

# Install dev dependencies
pip install -e ".[dev]"

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ -v --cov=vibe_pr --cov-report=term-missing

๐Ÿ“‹ Finding Levels

Level Icon Meaning
BLOCKER ๐Ÿ”ด Must fix before merge. Logic errors, security vulnerabilities, data loss risks.
WARNING ๐ŸŸก Should fix. Performance issues, missing error handling, unclear naming.
SUGGESTION ๐Ÿ”ต Consider changing. Better patterns, simpler approaches, future-proofing.
PRAISE ๐ŸŸข What is done well. Good abstractions, smart optimizations, clean coverage.

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


Built with โค๏ธ by the VibePR team

โšก Review code like a senior engineer, every time.

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

vibepr-1.0.0.tar.gz (46.3 kB view details)

Uploaded Source

Built Distribution

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

vibepr-1.0.0-py3-none-any.whl (49.4 kB view details)

Uploaded Python 3

File details

Details for the file vibepr-1.0.0.tar.gz.

File metadata

  • Download URL: vibepr-1.0.0.tar.gz
  • Upload date:
  • Size: 46.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for vibepr-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6d4dffedbb2add70e87ffd9c4d61284a162dac1c358e14d2067b727a5654f669
MD5 74262ee73df9b79a0f9390d35688a41e
BLAKE2b-256 47372e6d684f585b931eecb4d930d5be625c9b17bad24d97cd8dd874c971205d

See more details on using hashes here.

File details

Details for the file vibepr-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vibepr-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for vibepr-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4683ace3a58411e1101ab1eac5a5188b1b90a9fbf59eb25d0ae09c5bedfacb1
MD5 3214257585eebed2cfa924e19f63a3b7
BLAKE2b-256 0bddacbd61f23389428b1d89ab8a979b8bf7fa3c2ef2701c4d2a6acf5b042244

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