ai-commit is a Lua-based, Ollama-driven Git commit message assistant that streamlines your workflow by generating commit messages for you.
CleanShot.2025-06-27.at.21.49.20.mp4
brew install fiqryq/ai-commit/ai-commit-
Clone the repository:
git clone https://github.com/fiqryq/ai-commit.git cd ai-commit -
Install dependencies:
Make sure you have Lua and LuaRocks installed. Then, install the required Lua modules:
luarocks install argparse luarocks install dkjson luarocks install luasocket
-
Make the script executable:
chmod +x bin/ai-commit
-
Add to your PATH:
For ease of use, add the
bindirectory to your system'sPATH:export PATH=$PATH:/path/to/ai-commit/bin
To generate a commit message for your staged changes, simply run:
ai-commitTo automatically commit the generated message, use the --commit flag:
ai-commit --commit| Command | Description |
|---|---|
ai-commit |
Generate a commit message for staged changes |
ai-commit --commit |
Generate and automatically commit the message |
ai-commit --config |
Run the interactive configuration setup |
ai-commit --show-config |
Show the current ai-commit configuration |
ai-commit can be configured by running the interactive setup:
ai-commit --configThis will guide you through setting up:
- Default Provider: The AI provider to use (e.g.,
ollama). - Default Model: The specific model to use for generating messages.
- Ollama Host: The hostname or IP address of your Ollama instance.
Your configuration will be saved at ~/.config/ai-commit/config.json.
If you're contributing to ai-commit or need to debug it locally, follow these steps:
-
Clone the repository and navigate into the directory.
-
Run the script directly:
You can run the
ai-commitscript from thebindirectory to test your changes:lua bin/ai-commit
-
Build on local:
luarocks make