agent-gitv1
AI-powered Git CLI for commit, push, explain, and pull-request workflows using MCP + LLMs.
What It Does
agent-gitv1 helps developers move faster in git workflows by generating commit messages, explaining large diffs, diagnosing push failures, and drafting PR titles/descriptions.
Supported LLM providers:
- Google Gemini
- OpenAI
- Ollama (local or same network)
Quick Start
- Install:
pip install agent-gitv1
- Configure your provider:
agent config
- Run in any git repo:
agent commit
agent explain
agent pr
agent push
Key Features
- AI-assisted commit messages with multiple suggestions
- Smart staging mode that can split work into logical commit groups
- Repository-aware commit style adaptation from recent commit history
agent explainfor change intent, risk, and impacted filesagent pushwith live command output and LLM-driven failure diagnosis- Adaptive push diagnostics (light or full evidence collection)
- Interactive PR drafting with remote detection and branch selection
- Optional PR creation via GitHub CLI (
gh pr create) - Ollama LAN auto-discovery (
/24subnet on port11434)
Requirements
- Python 3.10+
- Git
uvx(install withpip install uv)- Provider credentials for Gemini/OpenAI, or a reachable Ollama instance
- GitHub CLI (
gh) if you wantagent pr --create
Installation
pip install agent-gitv1
Verify installation:
agent --version
agent --help
Configuration
agent config
Provider notes:
- Gemini: uses
GEMINI_API_KEYenv var or key entered during config - OpenAI: uses
OPENAI_API_KEYenv var or key entered during config - Ollama: can auto-detect URLs such as
http://192.168.1.35:11434
Commands
agent commit
Generate AI commit messages and commit changes.
Examples:
agent commit
agent commit --suggestions 3
agent commit --no-smart-stage
agent commit --repo /path/to/repo
agent commit --verbose
Behavior highlights:
- Uses MCP git diff for normal commit flow
- Can auto-group changed files and create multiple commits
- Adapts commit style to recent repository history
agent explain
Explain current uncommitted changes in a developer-friendly format.
Examples:
agent explain
agent explain --repo /path/to/repo
Output includes:
- What changed
- Why it likely changed
- Risk areas
- Files impacted
agent pr
Generate PR title/body from commits + diff, then optionally create PR via GitHub CLI.
Examples:
agent pr
agent pr --create
agent pr --draft --create
agent pr --target-remote upstream
agent pr --target-remote upstream --base develop --head feature/my-branch --create
Interactive flow (default):
- Detect remotes (
origin,upstream, etc.) - Let user choose PR target remote if multiple exist
- Fetch and let user choose base branch
- Compare ahead/behind status and warn if branch is behind target
- Generate PR title and description with LLM
- Optionally create PR with
gh pr create
agent push
Push current branch (or explicit branch) with live output.
Examples:
agent push
agent push --branch main
agent push --remote origin --branch feature/my-branch
Behavior highlights:
- Auto-detects and pushes current local branch when
--branchis omitted - If no upstream exists, offers
git push --set-upstream - On failure, collects live git evidence and generates LLM diagnosis with fix commands
agent config
Configure provider, model, and Ollama endpoint/model.
agent --help
List all commands and options.
Environment Variables
GEMINI_API_KEYOPENAI_API_KEY
GitHub CLI Requirement for PR Creation
agent pr --create requires authenticated GitHub CLI.
gh auth status
gh auth login
Developer Setup (Optional)
Only if you are modifying this codebase locally:
git clone <repo-url>
cd Agent_bhai
pip install -e .
Build and Publish (PyPI)
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*
License
MIT
Metadata
Release files for agent-gitv1 0.1.15
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 | Actions |
|---|---|---|---|---|
| agent_gitv1-0.1.15.tar.gz | 26.3 kB | Without provenance | Details for agent_gitv1-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_gitv1-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for agent_gitv1-0.1.15-py3-none-any.whl |
Total release size: 57.9 kB
Release files / agent_gitv1-0.1.15.tar.gz
| Download URL | agent_gitv1-0.1.15.tar.gz |
|---|---|
| Size | 26.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef510b3fd4b7ef83b1aede7c3154c5ea85d332e05d5ab010260f0961ffe60bbc
|
|
BLAKE2b-256 checksum How to use checksums |
64a096711565e75897d5a49b6aa399ba4422326762430b366562562e47ce8bed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / agent_gitv1-0.1.15-py3-none-any.whl
| Download URL | agent_gitv1-0.1.15-py3-none-any.whl |
|---|---|
| Size | 31.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fd2804f095b88cea4d73e81c400e4f5cce757f067c13ee3425e6f5e9fec7dac
|
|
BLAKE2b-256 checksum How to use checksums |
799a233ec492089aec7e27cfa770722d196d7fa01e1324a9ed439036d3edcdd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for agent-gitv1 0.1.15
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.