AI Commit using Ollama and Kaizen Cli
Revolutionize Your Git Workflow: Autogenerate Commits with Local LLMs
Have you ever found yourself staring at your terminal, struggling to come up with a meaningful commit message? We've all been there. Crafting clear, concise, and informative commit messages can be a real challenge, especially when you're in the flow of coding. But what if I told you there's a way to automate this process using the power of AI, right on your local machine?
The Problem
Git commit messages are crucial for maintaining a clean and understandable project history. They help team members (and your future self) understand the context and purpose of changes. However, writing good commit messages takes time and mental effort, often breaking your coding momentum.
The Solution: Kaizen-CLI
Enter Kaizen-CLI, an innovative tool that leverages local Large Language Models (LLMs) to automatically generate high-quality commit messages based on your code changes. Here's how you can set it up in just a few simple steps:
-
Install Ollama and run the Phi3 model: Ollama is a lightweight tool for running LLMs locally. The Phi3 model is particularly well-suited for code-related tasks.
ollama serve
-
Install Kaizen-CLI:
pip install kaizen-cli
-
Install Kaizen-CLI:
kaizen-cli config add-model --name default --model ollama/phi3
-
Set up the Git hook:
kaizen-cli hooks install prepare-commit-msg
That's it! Now, every time you push your code, Kaizen will analyze the diff and generate a comprehensive commit message, complete with a description of the changes.
How It Works
Kaizen uses the power of the Phi3 model to understand your code changes and generate contextually relevant commit messages. It looks at the diff between your current code and the last commit, interprets the changes, and crafts a message that accurately describes what you've done.
This approach not only saves you time but also ensures consistency in your commit history, making it easier for everyone to understand the evolution of your project.
Checkout the demo here: https://youtu.be/U5I7LCmZpcw
Benefits
- Time-saving: No more time wasted thinking about how to phrase your commits.
- Consistency: Maintain a standardized format for all commit messages.
- Clarity: AI-generated messages can often capture nuances that humans might overlook.
- Focus: Stay in your coding flow without breaking concentration to write commits.
Support Open Source AI Development
Kaizen is an open-source project aimed at improving developer productivity through AI. If you find this tool useful, consider supporting our efforts:
- Star our repository: https://github.com/Cloud-Code-AI/kaizen
- Contribute to the project
- Spread the word to fellow developers
By embracing tools like Kaizen, we're stepping into a future where AI assists and enhances our development processes, allowing us to focus more on creating and less on the minutiae of documentation.
Give Kaizen a try today and experience the future of streamlined Git workflows!
Are you looking for ways to optimize your software development process? Cloud Code AI introduces Kaizen, an AI tool to automate grunt work involved in software development.