🧠 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
- OpenAI Integration: Optional AI-powered commit message generation
Download the latest release for your platform from the releases page.
git clone https://github.com/andev0x/gitmit.git
cd gitmit
go build -o gitmit
./gitmit
# 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 propose
Gitmit 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.js
git add bug-fix.js
gitmit
# Suggests: fix: resolve issue in bug-fix.js
git add README.md
gitmit
# Suggests: docs: update README
git add .
gitmit --quick
# Commits immediately with auto-generated message
git add .
gitmit --message "improve performance" --scope "api" --breaking
# Creates: feat(api)!: improve performance
git add additional-changes.js
gitmit --amend
# Amends the last commit with new changes
gitmit analyze
Provides insights on:
- Commit patterns and trends
- Most active files and directories
- Commit type distribution
- Development velocity
- Potential improvements
gitmit smart
Offers:
- 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 --openai
Contributions 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