GIMI is a command-line interface (CLI) tool that uses AI to automatically generate conventional commit messages from your staged git changes. It's designed to streamline your workflow and help you write clear, concise, and well-formatted commit messages.
You can install GIMI using go install or npm.
go install github.com/shivgitcode/gimi@v0.1.0Make sure you have Go installed on your system and that your $GOPATH/bin is included in your system's PATH.
npm install -g gimi-cliGIMI is simple to use and has three main commands: init, generate, and reset.
Before you can start generating commit messages, you need to initialize the configuration. This is where you'll choose your AI backend (Ollama, OpenAI or Gemini) and provide your API key if necessary.
gimi initThis command will prompt you to select a backend.
- Ollama: If you have a local Ollama instance running, you can use it to generate commit messages. This is a free and fast option.
- OpenAI: If you prefer to use OpenAI's models, you can select this option. You'll be prompted to enter your OpenAI API key.
- Gemini: If you prefer to use Google's models, you can select this option. You'll be prompted to enter your Gemini API key.
The configuration will be saved in ~/.gimi/config.json.
Once you've staged your changes with git add, you can generate a commit message:
gimi generateGIMI will read your staged changes, send them to the configured AI backend, and then print the generated commit message to the console.
If you want to reset your configuration, you can use the reset command:
gimi resetThis will clear your backend and API key settings.
GIMI's configuration is stored in ~/.gimi/config.json. Here's an example of what the file might look like:
{
"Backend": "ollama"
}{
"Backend": "openai",
"apiKey": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}{
"Backend": "gemini",
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}You can manually edit this file if you need to change your backend or update your API key.
GIMI supports the following AI backends:
- Ollama: For using local language models.
- OpenAI: For using OpenAI's powerful language models.
- Gemini: For using Google's powerful language models.
If you want to contribute to GIMI, you can clone the repository and build the project from source.
git clone https://github.com/shivgitcode/gimi.git
cd gimi
go build .This project is licensed under the MIT License.