CommitAI is a command-line tool built in Go that leverages Large Language Models (LLMs) to analyze your Git code changes and automatically generate semantic commit messages.
- 🤖 Automatic commit message generation - AI-powered commit analysis
- 🌐 Dual processing modes - Local and remote LLM processing
- 🔄 Easy configuration management - Simple setup and updates
- 🌍 Multi-language support - Commit messages in any language
- 🏷️ Custom commit tags - Force specific commit types
- 📋 Multiple commit formats - Support for native Git or custom standards
- 🎨 Personal prompts - Define your own commit patterns and styles
- 🔌 Universal model support - Any local model or free web version compatibility
- 📦 Easy installation - Available via NPM or compiled binaries
- 🔧 Native Git integration - Enhanced Git support with advanced customization
- 🖥️ Improved interface - Better menu navigation and user experience
- ⚡ Performance boost - Faster execution and optimized CLI performance
CommitAI offers multiple installation methods to suit your preferences:
Option 1: NPM Global Install
npm install -g commit-ai-hublast
Option 2: From Repository
git clone https://github.com/HublastX/Commit-IA
cd Commit-IA
npm install -g
Prerequisites:
- Go 1.24 or higher
- Node.js 20+ (for NPM installation)
Steps:
-
Clone the repository:
git clone https://github.com/HublastX/Commit-IA cd Commit-IA
-
Compile for your platform using Go:
go build -o commitai ./cmd
-
Move binary to your PATH or use local installer scripts
Legacy Installer Scripts (Linux/macOS):
chmod +x ./install.sh
./install.sh
Legacy Installer Scripts (Windows):
.\install.bat
If you encounter build errors during manual compilation, install the required development packages:
Windows
-
Install Scoop package manager (PowerShell):
Set-ExecutionPolicy RemoteSigned -scope CurrentUser iwr -useb get.scoop.sh | iex
-
Install dependencies:
scoop install mingw
Ubuntu/Debian
sudo apt update && sudo apt install -y \
gcc libc6-dev libx11-dev xorg-dev \
libxtst-dev libpng-dev libxcursor-dev \
libxrandr-dev libxinerama-dev libdbus-1-dev \
tesseract-ocr
Arch Linux/Manjaro
sudo pacman -Syu && sudo pacman -S --needed \
gcc glibc libx11 xorg-server-devel \
libxtst libpng libxcursor libxrandr \
libxinerama dbus tesseract
After using git add
to stage your changes, you can use commitai to generate commit messages.
commitai
commitai offers two operating modes:
- Remote Web Mode - Access LLMs remotely without additional configuration (might be slower)
- Local Mode - Run the LLM API locally using Docker (requires provider configuration)
To switch between modes or update configuration:
commitai --update
Option | Description | Example |
---|---|---|
-d |
Add additional context | commitai -d "Added login functionality" |
-l |
Specify commit language | commitai -l "English" |
-t |
Force specific commit tag | commitai -t "feat" |
--update |
Update configuration or switch modes | commitai --update |
Generate a commit with additional context:
commitai -d "Created user login feature with OAuth support"
Generate a commit message in English:
commitai -l "English"
Force a specific commit tag:
commitai -t "feat"
Update configuration or switch between local and web modes:
commitai --update
When selecting the Local mode, simply configure through the CLI:
- Run
commitai --update
to access configuration - Select Local Mode when prompted
- Choose your LLM
provider
(Google, OpenAI, Anthropic, etc.) - Select an available
model
for your chosen provider - Enter your
API key
for the provider
That's it! No Docker setup required - the tool will handle everything automatically.
- Web mode uses Google's
gemini-flash-2
model by default - All LLM configurations are stored in the
Bot
directory - Custom configurations (provider, model, API token) are managed in
Bot/config/config.json
Contributions are welcome! Feel free to open issues or submit pull requests.
We recommend using Husky for commit validation:
- Ensure Node.js 22 is installed
- Run
npm install
to set up Husky, which will validate your commits before submission
This project is licensed under the Apache-2.0 license.