aimit
is a command-line tool designed to automate the creation of commit messages using AI models. It analyzes the staged changes in your Git repository and generates a concise and meaningful commit message based on the changes.
- AI-Powered Commit Messages: Uses AI models (currently supports Gemini) to generate commit messages.
- Customizable Prompt: Allows you to customize the prompt used to generate commit messages.
- Multiple AI Models: Supports multiple AI models (currently only Gemini is implemented).
- API Key Management: Easily manage API keys for different AI models.
- Default Model Selection: Set a default AI model to use for generating commit messages.
- Interactive Model Selection: If you're unsure which models are supported, you can run commands without specifying a value to trigger an interactive selection menu.
- Easy Installation: Install the tool system-wide with a single command.
You can install aimit
system-wide by running the following command:
wget -qO- https://raw.githubusercontent.com/TutTrue/Aimit/refs/heads/main/install_aimit.sh | sudo bash
This script will download and install the aimit
binary to your system, making it available globally.
-
Clone the repository:
git clone https://github.com/your-repo/aimit.git cd aimit
-
Build the project:
cargo build --release
-
Install the binary:
cargo install --path .
To generate a commit message for the staged changes in your Git repository, simply run:
aimit
This will use the default AI model to generate a commit message.
You can specify a different AI model using the -m
or --model
flag:
aimit -m gemini
If you're unsure which models are supported, you can run the command without specifying a value to trigger an interactive selection menu:
aimit -m
To set the API key for a specific AI model, use the -k
or --key
flag:
aimit -k YOUR_API_KEY -m gemini
If you're unsure which models are supported, you can run the command without specifying a value to trigger an interactive selection menu:
aimit -k YOUR_API_KEY -m
You can update the default AI model using the -d
or --default
flag:
aimit -d gemini
If you're unsure which models are supported, you can run the command without specifying a value to trigger an interactive selection menu:
aimit -d
To customize the prompt used to generate commit messages, use the -p
or --prompt
flag:
aimit -p
This will open your default text editor, allowing you to edit the prompt.
You can update Aimit using the -u
or --update
flag:
aimit -u
The tool uses a Config.toml
file to store settings such as the default AI model, API keys, and the prompt. This file is automatically created the first time you run the tool and is located in the ~/.config/aimit/
directory.
default_model = "GEMINI"
prompt = "Analyze the following git diff and generate a concise and meaningful commit message summarizing the changes.\nThe commit message should follow best practices, including a short title and an optional detailed description if necessary.\ngit diff:\n{}\nRequirements:\n Title: 50 characters or less, summarizing the change.\n Optional Description: If the change requires context, provide a brief explanation in the body."
[api_keys]
gemini_api_key = "YOUR_GEMINI_API_KEY"
The configuration file (Config.toml
) is stored in the following directory:
~/.config/aimit/Config.toml
You can manually edit this file to update settings such as the default model, API keys, or prompt.
Currently, the tool supports the following AI models:
- Gemini: A powerful AI model for generating commit messages.
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or new features to suggest.
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy automating your commit messages with aimit
! 🚀