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
- 🌿 Smart branch naming —
gitdude branch "fix login problem" - 💾 Commit only —
gitdude commitgenerates messages without pushing - 💬 Codebase chat —
gitdude chat "how does X work?" - 🚑 Emergency recovery —
gitdude whoopsdiagnoses and fixes git disasters - 📋 PR generation — full GitHub PR description, auto-copied to clipboard
- 🏷️ Automated Tagging —
gitdude tagsuggests versions and generates release notes - 🎨 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. Ask about your code
gitdude chat "what does this project do?"
# 5. Review your code before merging
gitdude review
# 6. 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 commit
AI-generates a commit message for your changes, lets you confirm/edit, and commits (but does NOT push).
gitdude commit # Stage all → AI commit
gitdude commit --no-confirm # Skip confirmation
gitdude commit --dry-run # Preview only, don't execute
gitdude commit --style freeform # Use freeform commit style
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 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 branch "<description>"
AI-generates a clean, conventional branch name from your description.
gitdude branch "fix the login timeout bug"
# → Suggests: fix/login-timeout-bug
# → Prompts: create branch / edit name / cancel
gitdude chat "<question>"
Ask questions about your codebase. It reads your file tree, README, and recent history to provide specific answers.
gitdude chat "how do I add a new command to this app?"
gitdude chat "where is the AI provider logic located?"
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 tag
Scans commits since last tag, suggests next version, and generates release notes.
gitdude tag
gitdude tag --no-confirm # Skip confirmation
gitdude tag --dry-run # Preview only
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
Metadata
Release files for gitdude 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gitdude-1.5.0.tar.gz | 24.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitdude-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.1 kB
Release files / gitdude-1.5.0.tar.gz
| Download URL | gitdude-1.5.0.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5aee567b58b12893bbc0a8fe51d3d18fc01f56c1efc205676dfefa4d46a88cbe
|
|
BLAKE2b-256 checksum How to use checksums |
c217419d11421fb41bb75f5593e6fff56ffbf907e7005b10224ec9e55128993c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / gitdude-1.5.0-py3-none-any.whl
| Download URL | gitdude-1.5.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06f1421b4818695505424d547feeed41ea1547263354e3ed21604974048fea55
|
|
BLAKE2b-256 checksum How to use checksums |
13c929f9f42b1e88020017c247c02f61e8008935b7e16f5f63eb9b3cb3b7da9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|