AI-powered Git commit message generator that uses Ollama to create conventional commit messages from your staged changes.
- AI-powered: Uses local Ollama LLM to generate commit messages
- Conventional Commits: Follows Conventional Commits format
- Rich Terminal UI: Beautiful, modern terminal interface with progress bars and styled output
- Untracked file warnings: Alerts you about files not included in the commit
- Interactive confirmation: Review and edit AI-generated messages before committing
- Progress indicators: Real-time progress bars and spinner animations
- Cross-platform: Works on macOS, Linux, and Windows (WSL)
- Virtual environment: Uses isolated Python environment via wrapper script
Download and install Ollama from ollama.ai, then pull the recommended model:
ollama pull gemma3:4b-it-qat # recommended modelgit clone <your-repo-url>
cd gcommitYou need to manually set up the Python virtual environment:
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Make wrapper executable
chmod +x gcommitTo use gcommit from any project directory, add it to your PATH:
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export PATH="$PATH:/path/to/gcommit"
# Or create a symlink
sudo ln -s /path/to/gcommit/gcommit /usr/local/bin/gcommitgcommit <your_initial_commit_message># Make some changes
echo "console.log('hello')" > app.js
# Stage the changes
git add app.js
# Generate commit message
gcommit "add console log message: hello"
# Output:
# ┌─────────────────────────────────────────────────────┐
# │ Welcome │
# │ 🤖 gcommit - AI-powered Git commit message generator │
# └─────────────────────────────────────────────────────┘
#
# ─────── Analyzing Staged Files ───────
# Processing files... ━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1/1
# Analyzing app.js...
#
# ─────── File Analysis Results ───────
# ┌────────────┬─────────────────────────────────────────┐
# │ File │ Summary │
# ├────────────┼─────────────────────────────────────────┤
# │ app.js │ Added console.log statement for debugging│
# └────────────┴─────────────────────────────────────────┘
#
# ─────── Generating Commit Message ───────
# Creating commit message...
#
# ─────── Commit Message Preview ───────
# ┌─────────────────────────────┐
# │ Generated Commit Message │
# │ │
# │ feat: add console log for │
# │ debugging │
# │ │
# │ - Added console.log │
# │ statement to app.js for │
# │ debugging purposes │
# └─────────────────────────────┘
#
# What would you like to do? (accept/reject/edit) [accept]: accept
# ─────── Committing Changes ───────
# Committing...
# ✅ Changes committed successfully!- Python 3.7+ (automatically handled by venv)
- Git (must be in PATH)
- Ollama (must be running locally)
- Rich UI Display - Shows beautiful welcome header and organized sections
- Checks for untracked files - Displays warnings in styled tables
- Reads staged changes - Gets diff of staged files via
git diff --staged - Progress Tracking - Shows real-time progress bars and spinners during processing
- AI generation - Sends diff to Ollama LLM for conventional commit generation
- Interactive Preview - Displays commit message in styled panels
- User confirmation - Rich interactive prompts for approval/editing
- Commits changes - Executes
git commitwith final message
MIT License - see LICENSE file for details.