Skip to main content

AI-powered Git commit assistant and PR analyzer.

Project description

PromptGitX

PromptGitX is an AI-powered Git review assistant packaged as a Python CLI. It helps you inspect commits, staged changes, branches, and pull requests from the terminal, then produces structured review reports in terminal, JSON, TXT, DOCX, or PDF formats.

Highlights

  • Review staged changes, commits, commit ranges, pull requests, and recent history.
  • Generate structured AI review reports with risk, recommendation, grouped issues, and changed-line references.
  • Save reports as .txt, .json, .docx, or .pdf.
  • Configure Groq, OpenAI, Anthropic, Gemini, or local Ollama models from the CLI.
  • Use up to five fallback models per provider during one review run.
  • Ask PromptGitX usage questions through the scoped chat command.
  • Run as a normal Python package with a promptgitx console command.

Installation

Install from PyPI:

python3 -m pip install promptgitx

Check the installed version:

promptgitx --version

View available commands:

promptgitx --help

Quick Start

Configure an LLM provider:

promptgitx config

Review staged changes:

promptgitx analyze --staged

Review the latest commit:

promptgitx analyze --last

Save a PDF report:

promptgitx analyze --last --save review.pdf

Save to a specific path:

promptgitx analyze --staged --save ./reports/staged-review.pdf

Commands

promptgitx config

Configure the LLM provider used by PromptGitX.

Interactive setup:

promptgitx config

Configure directly with options:

promptgitx config --provider groq --models MODEL_NAME --api-key YOUR_API_KEY
promptgitx config --provider openai --models MODEL_NAME --api-key YOUR_API_KEY
promptgitx config --provider anthropic --models MODEL_NAME --api-key YOUR_API_KEY
promptgitx config --provider gemini --models MODEL_NAME --api-key YOUR_API_KEY
promptgitx config --provider ollama --models MODEL_NAME --base-url http://localhost:11434

Switch to an already configured provider:

promptgitx config --use groq

Reset saved PromptGitX configuration:

promptgitx config --reset

promptgitx analyze

Generate an AI review report for one Git target.

Examples:

promptgitx analyze --staged
promptgitx analyze --last
promptgitx analyze --last-n 3
promptgitx analyze --commit COMMIT_HASH
promptgitx analyze --compare main..feature-branch
promptgitx analyze --pr 123

Use only one review target at a time. For example, use --staged or --last, not both.

Output examples:

promptgitx analyze --last --summary
promptgitx analyze --last --json
promptgitx analyze --last --save report.txt
promptgitx analyze --last --save report.json
promptgitx analyze --last --save report.docx
promptgitx analyze --last --save report.pdf

If --save is not passed, PromptGitX displays the report and then asks whether you want to save it.

promptgitx chat

Start a scoped PromptGitX help chat:

promptgitx chat

The chat command answers questions about PromptGitX CLI usage. It does not execute Git or shell commands.

CLI Reference

Global options:

Option Description
--version Show the installed PromptGitX version and exit.
--help Show CLI help.

promptgitx config options:

Option Short Description
--provider -p Provider to configure: groq, openai, anthropic, gemini, or ollama.
--models -m Comma-separated list of up to five model names.
--api-key none API key for cloud providers.
--base-url none Base URL for local providers like Ollama.
--use -u Switch to an already configured provider.
--reset -r Remove saved PromptGitX configuration.

promptgitx analyze target options:

Option Short Description
--commit -c Review one commit by SHA, tag, or revision.
--commits -C Review multiple commits. Can be provided more than once.
--compare -p Review a range such as main..feature-branch.
--pr -P Review a GitHub pull request by number. Requires the GitHub CLI.
--last -l Review the latest commit.
--last-n -n Review the last N commits.
--staged -s Review currently staged changes.

promptgitx analyze output options:

Option Description
--json Print the raw structured JSON report.
--summary Print only the short summary and final recommendation.
--save Save the report to .txt, .json, .docx, or .pdf.

Configuration

PromptGitX stores its provider settings at:

~/.promptgitx/.env

This keeps your API keys in one user-level location instead of creating .env files in whichever project directory you run the CLI from.

To use a different config file intentionally, set PROMPTGITX_ENV_PATH:

PROMPTGITX_ENV_PATH=/path/to/promptgitx.env promptgitx analyze --last

The config file stores values such as:

CURRENT_PROVIDER=GROQ
GROQ_API_KEY=...
GROQ_MODEL_1=MODEL_NAME

The active model appears in the welcome screen as:

Model: <PROVIDER> | <MODEL_NAME>

Model Fallbacks

Each provider can store up to five model names. PromptGitX starts with model 1. If a model call fails during a review run, PromptGitX advances to the next configured model and continues the run with that fallback.

Example:

promptgitx config --provider groq --models MODEL_1,MODEL_2

Report Formats

PromptGitX can print or save reports in these formats:

Format Usage
Terminal Default formatted report in the terminal.
JSON --json or --save report.json. Useful for scripts.
TXT --save report.txt. Plain text report.
DOCX --save report.docx. Word-compatible document.
PDF --save report.pdf. Styled PDF report.

When saving to a path, PromptGitX creates missing parent folders when possible:

promptgitx analyze --last --save ./reports/latest-review.pdf

How Analysis Works

The analyze command uses a LangGraph workflow:

load_diff
  -> parse_diff
  -> split_large_chunks
  -> review_chunks
  -> merge_file_reviews
  -> final_report

What happens internally:

  • load_diff collects the requested Git diff using git or gh.
  • parse_diff turns raw diffs into file-level chunks and changed-line references.
  • split_large_chunks splits oversized diffs by hunks instead of silently trimming content.
  • review_chunks sends review chunks to the configured LLM.
  • merge_file_reviews combines chunk-level findings back into file-level findings.
  • final_report builds the final structured report and output data.

PromptGitX keeps large hunks intact where possible so line references do not get corrupted by arbitrary slicing.

Requirements

  • Python 3.10 or newer.
  • Git installed and available on PATH.
  • GitHub CLI gh for promptgitx analyze --pr.
  • An API key for a cloud LLM provider, or a running Ollama server for local models.

Local Development

Clone the repository:

git clone https://github.com/abhinava-max/promptGit.git
cd promptGit

Create a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install in editable mode:

python3 -m pip install -e .

Run from the installed console command:

promptgitx --help

Run directly from source:

python3 src/promptgitx/main.py --help

Build package distributions:

python3 -m build

Check distributions before publishing:

python3 -m twine check dist/*

Project Links

Status

PromptGitX is in early development. The review workflow and report exporters are functional, and the CLI surface may still evolve between minor versions.

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

promptgitx-0.7.1.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

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

promptgitx-0.7.1-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

Details for the file promptgitx-0.7.1.tar.gz.

File metadata

  • Download URL: promptgitx-0.7.1.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for promptgitx-0.7.1.tar.gz
Algorithm Hash digest
SHA256 945cb9d2395d56575a63876d05816f134dd952787861ee2c2664ebe7256a1df4
MD5 2a9aa6aef9e27c16f5c0c28b4456b24b
BLAKE2b-256 156dade9b460954a5f3d7ab727adc04170c77f474b19f6c2572f494657416e33

See more details on using hashes here.

Provenance

The following attestation bundles were made for promptgitx-0.7.1.tar.gz:

Publisher: publish.yml on abhinava-max/promptGit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file promptgitx-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: promptgitx-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 51.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for promptgitx-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0441232b19d8ef70e749e8027c0a0f59e7d8b192d4b448b4634d004b3194c61e
MD5 5802ac17239fd76fe3a918f2761cd135
BLAKE2b-256 7ee413598732d100f57bb590408ce2080c18bd2928c66281475289bbd6e6e143

See more details on using hashes here.

Provenance

The following attestation bundles were made for promptgitx-0.7.1-py3-none-any.whl:

Publisher: publish.yml on abhinava-max/promptGit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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