gcm is a command-line tool that generates meaningful Git commit messages with appropriate emojis based on your Git diff, powered by local LLMs through Ollama.
This tool pipes your Git diff into an Ollama instance running locally to generate semantically relevant commit messages that follow conventional commit formats with emoji prefixes. It's perfect for developers who want consistent, meaningful commit messages without the mental overhead of crafting them each time.

- Generates commit messages with appropriate emoji prefixes
- Analyzes Git diff content to create contextual commits
- Follows conventional commit standards
- Runs completely locally (no data sent to external APIs)
- Fast and lightweight
git clone https://github.com/vinodnimbalkar/gcm.git
cd gcm
cargo install --path .This one-line installation does not support every OS
curl -sL "https://github.com/vinodnimbalkar/gcm/releases/download/v1.0.2/gcm" | sudo tee ~/.local/bin/gcm >/dev/null && sudo chmod +x ~/.local/bin/gcmYou can directly use the pre-built Docker image from Docker Hub:
docker pull vinodnimbalkar/gcm:latestUsing with Gemini API via Docker
git diff | docker run -i --rm -e GEMINI_API_KEY=your_api_key_here vinodnimbalkar/gcm:latestCreating a Shell Alias for Docker
# Add to .bashrc, .zshrc, etc.
alias docker-gcm='commit_message=$(git diff --staged | docker run -i --rm -e GEMINI_API_KEY=your_api_key_here vinodnimbalkar/gcm:latest); git commit -m "$(echo "$commit_message" | head -n 1)" -m "$(echo "$commit_message" | tail -n +2)"'Simply pipe your Git diff to the tool:
git diff | gcmOr for staged changes:
git diff --staged | gcmThen use the generated message to commit:
git commit -m "$(git diff --staged | gcm)"For convenience, you might want to add an alias to your shell configuration:
# Add to .bashrc, .zshrc, etc.
alias gcm='commit_message=$(git diff --staged | gcm); git commit -m "$(echo "$commit_message" | head -n 1)" -m "$(echo "$commit_message" | tail -n +2)"'
The tool supports two LLM services:
If no Gemini API key is set, gcm will use Ollama by default. Ollama must be installed and running locally.
You can configure the Ollama model using an environment variable:
export OLLAMA_MODEL=gemma3 # Default is "gemma3"To use Google's Gemini API:
- Obtain a Gemini API key from Google AI Studio
- Set the API key as an environment variable:
export GEMINI_API_KEY=your_api_key_heregcm will automatically use Gemini when the GEMINI_API_KEY environment variable is set.
<type>: <emoji><message>
<detailed description>
Example:
feat: ✨Add user authentication
Implement OAuth2 login flow with Google and GitHub providers
| Type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| Metadata | 📇 :card_index: |
| Documentation | 📚 :books: |
| Documenting source code | 💡 :bulb: |
| Performance | 🐎 :racehorse: |
| Cosmetic | 💄 :lipstick: |
| Tests | 🚨 :rotating_light: |
| Adding a test | ✅ :white_check_mark: |
| Make a test pass | ✔️ :heavy_check_mark: |
| General update | ⚡ :zap: |
| Improve format/structure | 🎨 :art: |
| Refactor code | 🔨 :hammer: |
| Removing code/files | 🔥 :fire: |
| Continuous Integration | 💚 :green_heart: |
| Security | 🔒 :lock: |
| Upgrading dependencies | ⬆️ :arrow_up: |
| Downgrading dependencies | ⬇️ :arrow_down: |
| Lint | 👕 :shirt: |
| Translation | 👽 :alien: |
| Text | ✏️ :pencil: |
| Critical hotfix | 🚑 :ambulance: |
| Deploying stuff | 🚀 :rocket: |
| Fixing on MacOS | 🍎 :apple: |
| Fixing on Linux | 🐧 :penguin: |
| Fixing on Windows | 🏁 :checkered_flag: |
| Work in progress | 🚧 :construction: |
| Adding CI build system | 👷 :construction_worker: |
| Analytics or tracking code | 📈 :chart_with_upwards_trend: |
| Removing a dependency | ➖ :heavy_minus_sign: |
| Adding a dependency | ➕ :heavy_plus_sign: |
| Docker | 🐳 :whale: |
| Configuration files | 🔧 :wrench: |
| Package.json in JS | 📦 :package: |
| Merging branches | 🔀 :twisted_rightwards_arrows: |
| Bad code / needs improvement | 💩 :hankey: |
| Reverting changes | ⏪ :rewind: |
| Breaking changes | 💥 :boom: |
| Code review changes | 👌 :ok_hand: |
| Accessibility | ♿ :wheelchair: |
| Move/rename repository | 🚚 :truck: |
The tool currently uses "gemma3" as the default model. You can modify the source code to use different Ollama models.
MIT License
Contributions are welcome! Please feel free to submit a Pull Request. Contributions are very welcome!! 😄