This blueprint guides you to easily generate AI-powered git commit messages based on your code changes. It uses local LLMs via Jan AI or Ollama to analyze git diffs and suggest concise, relevant commit messages.
📘 To explore this project further and discover other Blueprints, visit the Blueprints Hub.
👉 📖 For more detailed guidance on using this project, please visit our Docs here
- Python 3.10+
- Jan AI for a user-friendly local AI experience
- Open-source LLMs via Ollama as an alternative
- fzf for terminal UI
-
Make sure you have Git, Python 3.10+, and pip installed
-
Install the package:
pip install llm-commit-generator
-
Choose one of the following local inference options:
Option 1: Jan AI (Default)
- Install Jan AI and download a model (like Llama 3.1) through its interface
- Start the Jan AI application and ensure it's running
Option 2: Ollama
- Install Ollama and pull a model:
ollama pull llama3.1
-
After adding your changes to your git repo, run:
lcm
For Ollama, use:
lcm --ollama
- The tool extracts your git diff (staged changes, or unstaged if no staged changes)
- Sends the diff to an AI model with a prompt to generate concise commit messages
- Presents you with message suggestions in a terminal UI using fzf
- After selecting a message, commits your changes with the selected message
-
System requirements:
- OS: Windows, macOS, or Linux
- Python 3.10 or higher
- Git
- fzf (for terminal UI)
- Jan AI or Ollama for local inference
-
Dependencies:
- Dependencies listed in
pyproject.toml
- Dependencies listed in
- If you get
fzf: command not found
, install fzf: fzf installation guide - For Jan AI issues, ensure the Jan AI application is running
- For Ollama issues, ensure the Ollama service is running and your model is pulled
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Contributions are welcome! To get started, you can check out the CONTRIBUTING.md file.