Skip to main content

AI-powered Pull Request Generator & Reviewer - Automate PR titles, descriptions, and code reviews

Project description

AutoPR — AI-powered Pull Request Generator & Reviewer

PyPI version Python 3.8+ License: MIT

AutoPR automates the repetitive parts of pull requests: it writes concise PR titles & descriptions, validates CI/tests, runs deterministic static and lint checks, and provides an AI-assisted review summary.

Quickstart

1. Install

pip install autopr-core

2. Configure your API key

AutoPR requires your own OpenAI or Anthropic API key. Run the interactive setup:

autopr configure

This will prompt you to:

  • Choose a provider (openai or anthropic)
  • Enter your API key (stored locally in .env, never shared)

Or set environment variables manually:

# For OpenAI
export OPENAI_API_KEY="your-openai-api-key"
export AUTOPR_PROVIDER="openai"

# For Anthropic
export ANTHROPIC_API_KEY="your-anthropic-api-key"
export AUTOPR_PROVIDER="anthropic"

3. Use AutoPR

# Generate a PR title & description
autopr gen --diff "$(git diff)" --commits "feat: add helper"

# AI-assisted code review
autopr review --diff "$(git diff)"

# Run static analysis
autopr analyze --diff "$(git diff)" --summary

Command Cheat Sheet

Command Description
autopr configure Interactive setup — set your AI provider and API key
autopr gen Generate PR title and description
autopr review Perform AI-assisted code review
autopr analyze Run static analysis on code diffs
autopr analyze-files Batch-analyze files in a directory
autopr ci-parse Parse CI/test logs
autopr coverage-compare Compare coverage reports
autopr validate-issue Check if changes align with an issue
autopr doctor Check system health and configuration
autopr init Initialize AutoPR config in your repo
autopr suggest-reviewers Suggest reviewers based on git history

Features

  • AI-Powered PR Generation — Titles, descriptions, and risk assessments
  • AI Code Review — Senior-engineer-level review with actionable findings
  • Static Analysis — Deterministic Python code analysis (security, complexity, style)
  • CI/Test Parsing — Parse pytest, unittest, and GitHub Actions logs
  • Coverage Comparison — Diff coverage reports before and after changes
  • Multiple LLM Providers — OpenAI and Anthropic with robust error handling
  • FastAPI Backend — REST API with /generate and /review endpoints
  • CLI Tool — Full-featured command-line interface

API Server

Run the FastAPI server for REST API access:

uvicorn autopr.main:app --reload --port 8000

Visit http://127.0.0.1:8000/docs for interactive API docs.

Install from Source

git clone https://github.com/surenkotian/AutoPR.git
cd AutoPR
pip install -e .
autopr configure

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

autopr_core-0.5.1.tar.gz (53.0 kB view details)

Uploaded Source

Built Distribution

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

autopr_core-0.5.1-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

Details for the file autopr_core-0.5.1.tar.gz.

File metadata

  • Download URL: autopr_core-0.5.1.tar.gz
  • Upload date:
  • Size: 53.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for autopr_core-0.5.1.tar.gz
Algorithm Hash digest
SHA256 d84a7773ebca943bd185ab6ddb36aaf991db43a0fef575579b12e73f7bdb597d
MD5 7522930632f868b6ac4e491d0e181b85
BLAKE2b-256 22f34d5f38f75690860a30b779c1655909f05034bb060e3004fe87e611aca38b

See more details on using hashes here.

File details

Details for the file autopr_core-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: autopr_core-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 52.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for autopr_core-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd143c705c9951fb5c199bffe14dcc8dde16aea771ef4e2120fb272f81a0ec0f
MD5 52192ac2673f0a1d7bcf4a826c486eb0
BLAKE2b-256 22a72794e81e625d9cb43e981526f97500805cea60e127671906f1b1d06c9ce7

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