AI-powered Git workflow assistant โ commit, review, recover, and more with a single command
Project description
GitDude ๐ง
GitDude is an AI-powered Git workflow assistant that turns plain English into git actions โ commit, review, recover, and understand your repo from the terminal.
โจ Features
- ๐ค Multi-provider AI โ Gemini (default, free), Groq (fastest), Ollama (100% local), OpenAI
- ๐ฌ Natural language commands โ
gitdude do "stash, switch to main, pull" - ๐ AI code review โ bugs, security issues, quality flags before you push
- ๐ Emergency recovery โ
gitdude whoopsdiagnoses and fixes git disasters - ๐ PR generation โ full GitHub PR description, auto-copied to clipboard
- ๐จ Beautiful Rich UI โ tables, panels, spinners, color-coded output
- ๐ Secure config โ keys stored in
~/.gitdude/config.json, never in.env
๐ Quick Start
# 1. Install
pip install gitdude
# 2. Configure (takes 60 seconds)
gitdude config
# 3. Generate an AI commit message and push
gitdude push
# 4. Review your code before merging
gitdude review
# 5. Something went wrong? Ask for help
gitdude whoops
๐ฆ Installation
pip install gitdude
Python 3.10+ required.
๐ Provider Setup
Google Gemini (Default โ Free)
- Get an API key from Google AI Studio
- Run
gitdude configโ choosegeminiโ paste key
Groq (Fastest Free Tier)
- Get a key at console.groq.com/keys
- Run
gitdude configโ choosegroqโ paste key
Ollama (100% Local/Offline)
- Install Ollama: ollama.ai
- Pull a model:
ollama pull llama3 - Run
gitdude configโ chooseollama(no key needed)
OpenAI
- Get a key at platform.openai.com
- Run
gitdude configโ chooseopenaiโ paste key
๐ Command Reference
gitdude push
AI-generates a commit message for your changes, lets you confirm/edit, then commits and pushes.
gitdude push # Stage all โ AI commit โ push
gitdude push --no-confirm # Skip confirmation
gitdude push --dry-run # Preview only, don't execute
gitdude push --style freeform # Use freeform (not conventional) commit style
Commit types (conventional): feat, fix, chore, docs, refactor, style, test, perf, ci
gitdude sync
Fetch + rebase. If there are merge conflicts, AI explains what's conflicting and gives exact resolution steps.
gitdude sync
gitdude sync --dry-run
gitdude back
Shows last 30 commits in a table. Pick one to go back to, choose a mode.
gitdude back
gitdude back --dry-run
Modes: soft (keep changes staged), hard (discard changes), checkout (detached HEAD), branch (new branch from that commit)
gitdude undo "<description>"
Describe what went wrong โ AI reads your log and reflog to determine the safest recovery.
gitdude undo "I accidentally committed my .env file"
gitdude undo "I deleted the wrong branch"
gitdude undo "I made a mess of the last 3 commits" --dry-run
gitdude do "<natural language>"
Convert plain English into a sequence of git commands, preview, then execute.
gitdude do "stash my changes, switch to main, pull latest"
gitdude do "create a new branch called feature/auth and push it"
gitdude do "squash my last 3 commits" --dry-run
If any command fails, AI reads the error and suggests a fix.
gitdude review
Diffs your current branch vs main/master, then AI reviews for bugs, security issues, and quality.
gitdude review
gitdude review --base develop # Compare against a different branch
gitdude review --dry-run # Show diff without AI review
Review sections: Summary ยท โ ๏ธ Potential Bugs ยท ๐ Security Issues ยท ๐ Code Quality ยท ๐ Things to Check ยท โ Overall Assessment
gitdude pr
Generates a complete PR title + description + bullet list + testing notes. Auto-copies to clipboard.
gitdude pr
gitdude pr --base develop # Compare against develop
gitdude pr --no-copy # Don't copy to clipboard
gitdude explain
Reads your last 5 reflog entries and explains in plain English what happened.
gitdude explain
gitdude whoops
Emergency recovery. Feeds git status + log + reflog to AI. Diagnoses what went wrong and gives step-by-step recovery.
gitdude whoops
gitdude whoops --dry-run # Diagnose only, don't execute
gitdude config
Interactive configuration wizard.
gitdude config # Run setup
gitdude config --show # Print current config (keys masked)
gitdude config --reset # Wipe config and redo setup
Stored settings:
- AI provider (
gemini/groq/ollama/openai) - API key per provider
- Model name per provider
- Default branch (
mainormaster) - Commit style (
conventionalorfreeform)
๐๏ธ Architecture
gitdude/
โโโ main.py # Typer app โ all command definitions
โโโ ai.py # Unified AI provider wrapper (ask_ai)
โโโ git_ops.py # GitPython operations (diff, log, push, resetโฆ)
โโโ config.py # Config at ~/.gitdude/config.json
โโโ utils.py # Rich panels, tables, prompts, helpers
AI Providers (ai.py):
| Provider | SDK | Default Model | Speed | Cost |
|---|---|---|---|---|
gemini |
google-generativeai |
gemini-2.0-flash |
Fast | Free tier |
groq |
groq |
llama-3.3-70b-versatile |
Fastest | Free tier |
ollama |
ollama |
llama3 |
Local | Free (local) |
openai |
openai |
gpt-4o-mini |
Fast | Pay per use |
All providers go through a single interface: ask_ai(prompt) -> str with spinner feedback and unified error handling.
๐ก๏ธ Safety Features
- โ All destructive operations (hard reset, force push, etc.) require explicit confirmation
- โ
--dry-runflag available on all mutating commands - โ Color-coded risk levels โ green (safe), yellow (caution), red (destructive)
- โ No tracebacks โ all exceptions caught and shown as friendly Rich error panels
- โ
API keys stored privately in
~/.gitdude/config.json, never in project files
๐ค Contributing
- Fork the repo
- Create a feature branch:
git checkout -b feat/amazing-feature - Make your changes
- Run linting:
ruff check . - Open a PR โ or just use
gitdude prto generate your PR description! ๐
Dev setup:
git clone https://github.com/utkarshgupta188/gitdude
cd gitdude
pip install -e ".[dev]"
๐ License
MIT ยฉ GitDude Contributors
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitdude-1.0.2.tar.gz.
File metadata
- Download URL: gitdude-1.0.2.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a574eebdb243a8cab6e91619a3445ada548e452fa133bbabca9bcea978e402eb
|
|
| MD5 |
a7cb287ef85b9fc1b21868f3ef9eb650
|
|
| BLAKE2b-256 |
29196195ca040a810ae33867f6f414946645f22a5a8ed21ba08e4141626addd7
|
File details
Details for the file gitdude-1.0.2-py3-none-any.whl.
File metadata
- Download URL: gitdude-1.0.2-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b912e2a3a0b14ca88b799b95e0ea57518b3d78587cb76617e011a10af8a3595
|
|
| MD5 |
91ff3660f3ce62ad4d7fb7c1384cb884
|
|
| BLAKE2b-256 |
90aedf9248906f6548acbfe65f55b8567d13ba012923fe3d59253f7b60961f64
|