AI-powered git commit message generator โ powered by local LLMs
Hermes analyzes your staged git changes and generates perfectly formatted conventional commit messages using locally running AI models via Ollama.
- ๐ค Local AI โ Runs on your machine via Ollama (Mistral/Phi4)
- โก Fast โ Smart diff trimming keeps responses quick
- ๐จ Beautiful UI โ Rich terminal interface with arrow key selection
- โฑ๏ธ Live Timer โ See exactly how long generation takes
- ๐ Conventional Commits โ Follows industry-standard format
- ๐ Global Command โ Run
hermesfrom any git repository
-
Python 3.12+
python3 --version
-
Ollama with models installed
ollama pull gemma4:e4b-it-q4_K_M # Recommended (9.6GB) ollama pull mistral ollama pull phi4-mini -
Clipboard tool (for copy-to-clipboard)
sudo apt-get install xclip
xclip is built-in
Built-in
# Clone the repository
git clone https://github.com/VarunKvK/hermes-cli.git
cd hermes-cli
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
pip install -e .
# Make it global (Linux/macOS only)
chmod +x hermes.sh
sudo ln -s $(pwd)/hermes.sh /usr/local/bin/hermes
That's it! Now you can run hermes from anywhere.
git clone https://github.com/VarunKvK/hermes-cli.git
cd hermes-cli
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .chmod +x hermes.sh
sudo ln -s $(pwd)/hermes.sh /usr/local/bin/hermes# Make some changes in any git repo
cd your-project
git add .
# Run hermes
hermesOutput:
๐ชฝ Hermes โ starting...
โ Analyzing staged changes (0.12s)
โ Crafting prompt (0.03s)
โ น Consulting mistral thinking deeply... (8.4s)
โ Consulting mistral (12.45s)
โ Parsing commits (0.02s)
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ชฝ Hermes โ AI-generated commit messages โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ # โ Commit Message โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 1 โ feat(auth): add JWT token validation โ
โ 2 โ feat(api): implement user authentication โ
โ 3 โ chore(deps): update security dependencies โ
โโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
? Choose a commit message: (Use arrow keys)
ยป feat(auth): add JWT token validation
feat(api): implement user authentication
chore(deps): update security dependencies
โ Cancel
โ
Selected: feat(auth): add JWT token validation
Copy the message and use it:
git commit -m "feat(auth): add JWT token validation"Run Hermes in the background to get automatic suggestions:
hermes --daemonHow it works:
Daemon watches your git repo every 5 seconds
When you stage changes (git add), daemon detects it
Automatically generates commit suggestions
You pick one with arrow keys
If auto_commit: true in config, commits automatically
Perfect for continuous development:
Stage code โ get suggestions instantly
No need to manually run hermes
Seamless workflow integration
Hermes uses Mistral by default. Models are defined in hermes/model.py:
SUPPORTED_MODELS = {
"mistral": "mistral:latest",
"phi4": "phi4-mini:latest",
}
DEFAULT_MODEL = "mistral"# Install in editable mode
pip install -e .
# Run from source
python main.py
# Run tests (coming in V2)
pytestHermes generates messages following the Conventional Commits specification:
type(scope): description
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc)
- refactor: Code refactoring
- test: Adding tests
- chore: Maintenance tasks
- Local LLM integration via Ollama
- Smart diff analysis
- Beautiful terminal UI
- Arrow key selection
- Global CLI command
- Gemma4 AI model support
- Model selection (--model flag)
- In-place commit editing
- Copy to clipboard
- Questionary integration
- Intelligent diff caching (174x speed improvement)
- Cache management (--no-cache, --clear-cache)
- Binary file detection
- Edge case handling
- Business-focused commit scopes
- --all flag for unstaged changes
- Production-grade error handling
- Auto-commit feature (--auto-commit/-c)
- Configuration file (~/.hermes/config.json)
- Learn from commit history for personalization
- Daemon mode for real-time suggestions
- Graceful background watching
- Multiple model comparison
- Custom prompt templates
- Commit message templates library
- Integration with GitHub/GitLab
- Web UI for remote repos
- First run: ~125 seconds (generates + caches)
- Subsequent runs: <1 second (from cache)
- Speed improvement: 174x faster
- Gemma4 E4B: 78-125s (recommended)
- Mistral 7.2B: 112-235s
- Phi4-mini: Similar to Mistral
Gemma4 is 30% faster with better reasoning.
Contributions are welcome! This is a learning project built to explore:
- Agentic AI development
- Local LLM integration
- Production-quality Python CLIs
- Terminal UI/UX best practices
MIT License - feel free to use and modify
Made with โก by VarunKvK