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 โ
gitwise do "stash, switch to main, pull" - ๐ AI code review โ bugs, security issues, quality flags before you push
- ๐ Emergency recovery โ
gitwise 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)
gitwise config
# 3. Generate an AI commit message and push
gitwise push
# 4. Review your code before merging
gitwise review
# 5. Something went wrong? Ask for help
gitwise whoops
๐ฆ Installation
pip install gitdude
Python 3.10+ required.
๐ Provider Setup
Google Gemini (Default โ Free)
- Get an API key from Google AI Studio
- Run
gitwise configโ choosegeminiโ paste key
Groq (Fastest Free Tier)
- Get a key at console.groq.com/keys
- Run
gitwise configโ choosegroqโ paste key
Ollama (100% Local/Offline)
- Install Ollama: ollama.ai
- Pull a model:
ollama pull llama3 - Run
gitwise configโ chooseollama(no key needed)
OpenAI
- Get a key at platform.openai.com
- Run
gitwise configโ chooseopenaiโ paste key
๐ Command Reference
gitwise push
AI-generates a commit message for your changes, lets you confirm/edit, then commits and pushes.
gitwise push # Stage all โ AI commit โ push
gitwise push --no-confirm # Skip confirmation
gitwise push --dry-run # Preview only, don't execute
gitwise push --style freeform # Use freeform (not conventional) commit style
Commit types (conventional): feat, fix, chore, docs, refactor, style, test, perf, ci
gitwise sync
Fetch + rebase. If there are merge conflicts, AI explains what's conflicting and gives exact resolution steps.
gitwise sync
gitwise sync --dry-run
gitwise back
Shows last 30 commits in a table. Pick one to go back to, choose a mode.
gitwise back
gitwise back --dry-run
Modes: soft (keep changes staged), hard (discard changes), checkout (detached HEAD), branch (new branch from that commit)
gitwise undo "<description>"
Describe what went wrong โ AI reads your log and reflog to determine the safest recovery.
gitwise undo "I accidentally committed my .env file"
gitwise undo "I deleted the wrong branch"
gitwise undo "I made a mess of the last 3 commits" --dry-run
gitwise do "<natural language>"
Convert plain English into a sequence of git commands, preview, then execute.
gitwise do "stash my changes, switch to main, pull latest"
gitwise do "create a new branch called feature/auth and push it"
gitwise do "squash my last 3 commits" --dry-run
If any command fails, AI reads the error and suggests a fix.
gitwise review
Diffs your current branch vs main/master, then AI reviews for bugs, security issues, and quality.
gitwise review
gitwise review --base develop # Compare against a different branch
gitwise review --dry-run # Show diff without AI review
Review sections: Summary ยท โ ๏ธ Potential Bugs ยท ๐ Security Issues ยท ๐ Code Quality ยท ๐ Things to Check ยท โ Overall Assessment
gitwise pr
Generates a complete PR title + description + bullet list + testing notes. Auto-copies to clipboard.
gitwise pr
gitwise pr --base develop # Compare against develop
gitwise pr --no-copy # Don't copy to clipboard
gitwise explain
Reads your last 5 reflog entries and explains in plain English what happened.
gitwise explain
gitwise whoops
Emergency recovery. Feeds git status + log + reflog to AI. Diagnoses what went wrong and gives step-by-step recovery.
gitwise whoops
gitwise whoops --dry-run # Diagnose only, don't execute
gitwise config
Interactive configuration wizard.
gitwise config # Run setup
gitwise config --show # Print current config (keys masked)
gitwise 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
gitwise/
โโโ 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
gitwise prto generate your PR description! ๐
Dev setup:
git clone https://github.com/gitwise/gitwise
cd gitwise
pip install -e ".[dev]"
๐ License
MIT ยฉ GitWise 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.1.tar.gz.
File metadata
- Download URL: gitdude-1.0.1.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 |
2ed0c37ba7f73975aebd8dd31a072cbf74b9b1e1cb64e8a2b5625aadeb047092
|
|
| MD5 |
93851b9c90c05257a0e0ce42de555b04
|
|
| BLAKE2b-256 |
1324969829676f289fca1eb1f1cce9852e8a8ba1014acac1a6c0e006c84eab4a
|
File details
Details for the file gitdude-1.0.1-py3-none-any.whl.
File metadata
- Download URL: gitdude-1.0.1-py3-none-any.whl
- Upload date:
- Size: 19.4 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 |
d999f909c2729f1006eb4b13c39e4ef0c5f4215f3b7a7270cedc6b20c9d548fd
|
|
| MD5 |
2ad4226933a98c6084b0b33a880c671b
|
|
| BLAKE2b-256 |
14cbc8023423256bf0bf1d6265f4a7096dd6d8c9ddf44a52a28e0a94d76bb701
|