PR Review CLI
An AI-powered code review tool that analyzes your git diff and routes it through the right level of LLM scrutiny.
How it works
git diff → LLM classifies change size
│
├── Small change ──→ Focused review (old vs new code)
│
└── Big change ──→ AST analysis finds all callers
└──→ Deep review (diff + impacted files)
Install
# Install the OpenAI client
pip install openai python-dotenv
# Run directly
python reviewer.py
# Or install as a CLI command
pip install -e .
git-ai-pr-review
Usage
# Set your API key
export OPENAI_API_KEY=sk-... # macOS / Linux
setx OPENAI_API_KEY "sk-..." # Windows (PowerShell)
# Review changes vs HEAD (default — unstaged/staged changes)
git-ai-pr-review
# Review feature branch against main
git-ai-pr-review --base main
# Review against remote main
git-ai-pr-review --base origin/main
# Review against a specific commit
git-ai-pr-review --base abc1234
Output
- Prints the review to stdout
- Saves a
pr_review_output.mdfile in the current directory
What the LLM looks for
Small change review:
- Summary of what changed
- Bugs & edge cases
- Code quality & naming
- Concrete improvement suggestions
- Final verdict (approve / approve with suggestions / request changes)
Big change review (+ AST impact analysis):
- Everything above, plus:
- Breaking change detection (are callers still compatible?)
- Per-file impact analysis of all call sites found via AST
- Migration notes — what else needs updating
Notes
- AST analysis is Python-only (uses the
aststdlib module) - Skips
.venvandnode_modulesdirectories - The diff-size LLM call uses OpenAI (model example:
gpt-4o-mini) - The codebase was refactored: core modules now include
llm/openai.py,ast_analyzer.py,diff_parser.py,git.py, andcli.pywithreviewer.pyacting as the orchestrator - Reviews are also saved to
pr_review_output.md
Metadata
Release files for git-ai-pr-review 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| git_ai_pr_review-0.1.3.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| git_ai_pr_review-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / git_ai_pr_review-0.1.3.tar.gz
| Download URL | git_ai_pr_review-0.1.3.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7bfcce8a01430eff859c390d0887b575c780968627ad096eaf85a9b61ab98ad
|
|
BLAKE2b-256 checksum How to use checksums |
07bac22b17606ccc1d827d9c46e913f5cae11bd352905c03f2827a655bed4a58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / git_ai_pr_review-0.1.3-py3-none-any.whl
| Download URL | git_ai_pr_review-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddb7db64db3811f4a3bcacfba0c11b33f86d3f4d12b0735ff60751b9f91950f4
|
|
BLAKE2b-256 checksum How to use checksums |
0822aa00cfb519f834a5d979dcfe10a493581af00107fbad1e91d699c639e193
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for git-ai-pr-review 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.