🧠 A lightweight CLI tool that analyzes your staged changes and suggests professional commit messages following Conventional Commits format.
- Intelligent Analysis: Analyzes git status and diff to understand your changes
- Conventional Commits: Follows the Conventional Commits specification
- Multiple Commit Types: Supports feat, fix, refactor, chore, test, docs, style, perf, ci, build, security, config, deploy, revert, and wip
- Interactive Mode: Customize commit messages with an interactive prompt
- Quick Commits: Fast commits without interaction
- Smart Analysis: Advanced commit history analysis and insights
- Amend Support: Easily amend previous commits with smart suggestions
- Custom Messages: Use custom messages with scope and breaking change support
- Zero Configuration: Works out of the box
- Lightning Fast: Complete offline operation
Gitmit is designed to run everywhere.
Download the latest release for your platform from the releases page.
git clone https://github.com/andev0x/gitmit.git
cd gitmit
go build -o gitmitAfter building, you can install gitmit to your system's PATH.
To install gitmit to /usr/local/bin:
sudo mv gitmit /usr/local/binTo determine where go binaries are typically installed on your system, use which go. This will help you decide where to move the gitmit executable. For example, if which go returns /usr/local/bin/go, you might move gitmit there:
sudo mv gitmit /Users/username/go/binAlternatively, you can add the directory containing the gitmit executable to your shell's PATH environment variable.
# Stage your changes
git add .
# Generate and commit with smart message
gitmit# Show suggested message without committing
gitmit --dry-run
# Show detailed analysis
gitmit --verbose
# Quick commit without interaction
gitmit --quick
# Use OpenAI for enhanced message generation
gitmit --openai
# Amend the last commit
gitmit --amend
# Force interactive mode
gitmit --interactive
# Custom commit message
gitmit --message "your custom message"
# Specify commit scope
gitmit --scope "api"
# Mark as breaking change
gitmit --breaking# Analyze commit history and get insights
gitmit analyze
# Get smart commit suggestions
gitmit smart# Propose commit message from diff
git diff --cached | gitmit proposeGitmit automatically detects and suggests appropriate commit types:
- feat: New features
- fix: Bug fixes
- refactor: Code refactoring
- chore: Maintenance tasks
- test: Adding or updating tests
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- perf: Performance improvements
- ci: CI/CD changes
- build: Build system changes
- security: Security improvements
- config: Configuration changes
- deploy: Deployment changes
- revert: Reverting previous commits
- wip: Work in progress
git add new-feature.js
gitmit
# Suggests: feat: add new-feature.jsgit add bug-fix.js
gitmit
# Suggests: fix: resolve issue in bug-fix.jsgit add README.md
gitmit
# Suggests: docs: update READMEgit add .
gitmit --quick
# Commits immediately with auto-generated messagegit add .
gitmit --message "improve performance" --scope "api" --breaking
# Creates: feat(api)!: improve performancegit add additional-changes.js
gitmit --amend
# Amends the last commit with new changesgitmit analyzeProvides insights on:
- Commit patterns and trends
- Most active files and directories
- Commit type distribution
- Development velocity
- Potential improvements
gitmit smartOffers:
- Multiple commit suggestions with confidence levels
- Context-aware reasoning
- File operation analysis
- Scope detection
- Breaking change identification
Gitmit works out of the box with zero configuration. However, you can enhance it with:
Set your OpenAI API key for enhanced commit message generation:
export OPENAI_API_KEY="your-api-key"
gitmit --openaiContributions are welcome! Please see CONTRIBUTING.md for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Git hooks integration
- Team commit templates
- Commit message validation
- Integration with issue trackers
- Multi-language support
- Commit message templates
- Branch-based suggestions
- Commit message history learning
