Skip to main content

AI-powered Git workflow assistant โ€” commit, review, recover, and more with a single command

Project description

GitDude ๐Ÿง 

PyPI version Python 3.10+ License: MIT Downloads

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 whoops diagnoses 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)

  1. Get an API key from Google AI Studio
  2. Run gitwise config โ†’ choose gemini โ†’ paste key

Groq (Fastest Free Tier)

  1. Get a key at console.groq.com/keys
  2. Run gitwise config โ†’ choose groq โ†’ paste key

Ollama (100% Local/Offline)

  1. Install Ollama: ollama.ai
  2. Pull a model: ollama pull llama3
  3. Run gitwise config โ†’ choose ollama (no key needed)

OpenAI

  1. Get a key at platform.openai.com
  2. Run gitwise config โ†’ choose openai โ†’ 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 (main or master)
  • Commit style (conventional or freeform)

๐Ÿ—๏ธ 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-run flag 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

  1. Fork the repo
  2. Create a feature branch: git checkout -b feat/amazing-feature
  3. Make your changes
  4. Run linting: ruff check .
  5. Open a PR โ€” or just use gitwise pr to 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

gitdude-1.0.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

gitdude-1.0.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file gitdude-1.0.0.tar.gz.

File metadata

  • Download URL: gitdude-1.0.0.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

Hashes for gitdude-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fbec4776e267689922f5800bc5fb62a70e27502164c881860ab4941bd2b54a3f
MD5 e7d2015090dd89ee359913ae116f02b7
BLAKE2b-256 3478bf4e07fcced09826a8b968dedd6751692b183642078317862333ee6c46b0

See more details on using hashes here.

File details

Details for the file gitdude-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gitdude-1.0.0-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

Hashes for gitdude-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6069d584248b17485013e2b25feb50f276db16eec0dfeb1c5ad4d4397a0b9ae
MD5 5ca9002d860dd46a8d235f0900f093cd
BLAKE2b-256 55a9905822f6b4da76a6f5ceb73d0a1a9745fe3f3aad64f68b2012732c24b257

See more details on using hashes here.

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