Skip to main content

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

Metadata

Release files for autopr-core 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autopr-core 0.5.1
File Size Uploaded
autopr_core-0.5.1.tar.gz 53.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autopr-core 0.5.1
File Interpreter ABI Platform
autopr_core-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 105.8 kB

Release files / autopr_core-0.5.1.tar.gz

Download URL autopr_core-0.5.1.tar.gz
Size 53.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d84a7773ebca943bd185ab6ddb36aaf991db43a0fef575579b12e73f7bdb597d
BLAKE2b-256 checksum
How to use checksums
22f34d5f38f75690860a30b779c1655909f05034bb060e3004fe87e611aca38b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release files / autopr_core-0.5.1-py3-none-any.whl

Download URL autopr_core-0.5.1-py3-none-any.whl
Size 52.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd143c705c9951fb5c199bffe14dcc8dde16aea771ef4e2120fb272f81a0ec0f
BLAKE2b-256 checksum
How to use checksums
22a72794e81e625d9cb43e981526f97500805cea60e127671906f1b1d06c9ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release 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