AI-powered conventional commit message generator running 100% locally
Project description
GitAI-CLI
An offline, privacy-first CLI tool that automatically generates structured Git commit messages using a local LLM via llama.cpp. No API keys required, no data leaves your machine.
Why GitAI? (Educational Purpose)
Starting out in software development requires absorbing dozens of industry best practices simultaneously. Adopting the Conventional Commits standard right from the beginning often causes friction and leads to wasted time staring at a blank terminal screen wondering how to phrase a change.
GitAI was built to act as an invisible mentor inside your console, specifically designed for developers looking to professionalize their daily workflow without losing focus on writing code.
The benefit of implementing this CLI is twofold:
- Immediate Impact (Professionalism): It resolves technical nomenclature in just a few seconds, ensuring a pristine, clean, and standardized Git history. This is ideal for making your portfolio stand out to recruiters reviewing your GitHub repositories.
- Passive Learning (Long-term): It works through imitation and consistency. By interactively auditing how the AI categorizes your syntax changes with precise tags (
feat,fix,refactor), a developer's brain naturally absorbs the pattern over time, learning how to structure correct commits organically.
Features
- 100% Local Ingestion: Uses
llama-cpp-pythonto run model inference completely offline via a background HTTP server onlocalhost:8089. - Conventional Commits: Enforces the standard
type: descriptionformat (e.g.,feat: add user authentication). - Diff-Aware Context: Inspects staged changes and file names to provide accurate context.
- Initial Commit Detection: Automatically detects the first commit of a repository and uses the README and file list as context instead of a diff.
- Smart Language Memory: Learns your language preference (English or Spanish) per repository using Git's native configuration system (
gitai.lang), avoiding repetitive prompts. - Windows & UTF-8 Native: Fully hardened against character encoding issues (
ñ, acentos,¿) when generating or editing messages in Windows consoles.
How it works
- On first use, run
gitai initto download the AI model (~4.7 GB). - At the start of each work session, run
gitai startinside your repo. This loads the model into RAM as a background daemon and asks for your language preference if not already set. - After staging changes, run
gitai. It feeds the diff (or initial commit context) into the model and proposes a commit message. - At the end of your session, run
gitai outto stop the daemon and free RAM.
📖 Interactive Help & Documentation Access
GitAI CLI features a native, robust command-line validation and help module. If you ever need a quick reminder of the available architecture commands, explicit routing links, or want to report a technical issue, you can invoke the user manual directly from your shell.
Run any of the following equivalent commands:
gitai help
# or using standard POSIX flags
gitai -h
gitai --help
Real-World Benchmarks & Reference Metrics
The following metrics are estimates based on empirical testing. Actual execution times are non-linear and may vary depending on current CPU background load...
Project structure
GitAI-CLI/
├── assets/
├── gitai/
│ ├── __init__.py
│ ├── config.py ← model path, download logic, language config
│ ├── main.py ← CLI logic, user interaction
│ └── llm_client.py ← daemon management and inference via HTTP
├── pyproject.toml ← package definition and dependencies
└── README.md
Installation (for Python developers)
First, install pipx if you don't have it:
pip install pipx
python -m pipx ensurepath
After running
ensurepath, restart your terminal.
Then install gitai globally:
pipx install --force .
Setup (one time)
Download the AI model (~4.7 GB). This only needs to be done once:
gitai init
The model (
Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf) is stored in%LOCALAPPDATA%\gitai\models.
Usage
Start a work session
Run this once per session inside your repository. Loads the model into RAM and sets the language for the repo if not already configured:
gitai start
Generate a commit message
git add .
gitai
End a work session
Stops the background daemon and frees RAM:
gitai out
Command reference
| Command | Description |
|---|---|
gitai init |
Downloads the AI model (first time only) |
gitai start |
Loads the model into RAM, sets repo language |
gitai |
Generates and commits staged changes |
gitai out |
Stops the background daemon, frees RAM |
Commit types used
| Type | When to use |
|---|---|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation changes |
| style | Formatting, no logic change |
| refactor | Code refactor |
| test | Adding or fixing tests |
| chore | Build, dependencies, config |
| perf | Performance improvement |
| ci | CI/CD changes |
| build | Build system changes |
Requirements
- Python 3.10+
- Git installed
- ~4.7 GB disk space for the model
Performance & Efficiency
Commit message generation runs 100% locally and entirely on your CPU. No external APIs, no data leaks, and no heavy CUDA/ROCm GPU dependencies required.
Because inference happens directly on your processor, generation times are non-linear and scale based on your hardware architecture (specifically CPU single-core speed and RAM bandwidth), as well as the complexity of the git diff.
Real-World Benchmarks & Reference Metrics (Qwen 2.5 Coder 7B - Q4_K_M)
The following metrics are estimates based on empirical testing. Actual execution times are non-linear and may vary depending on current CPU background load and system memory availability.
Based on extensive stress-testing on standard consumer hardware (e.g., Intel i7 7th Gen with 16GB DDR4 @ 2400MHz), you can expect the following operational ranges.
| Hardware Profile | Context Size | Estimated Time * | Commit Accuracy |
|---|---|---|---|
| Modern Desktop / Laptop (Ryzen 5/7, Core i5/i7 11th+ Gen, DDR5) |
Small to Large Diffs | ~8 – 20 seconds | ~98% |
| Older / Standard Hardware (Legacy Intel i7, DDR4 @ 2400MHz) |
Small to Medium Diffs | ~20 – 40 seconds | ~98% |
| Stress Test / Massive Changes (Legacy Hardware + Dense Diffs) |
Large Multi-file Diffs | ~40 – 70 seconds | ~98% |
Note on Performance: Times are heavily bound to RAM clock speed and single-core efficiency. A dense, multi-file diff analyzed on legacy hardware might occasionally touch the upper boundary of the stress test zone. However, GitAI's built-in traffic manager ensures payloads remain strictly bounded to keep local execution controlled and predictable.
Predictable Execution Cap: GitAI features a built-in traffic management engine. By enforcing a hard limit on filtered context sizes, the CLI prevents the LLM from entering runaway processing loops. Even during massive codebase refactors, the input payload is strictly constrained to ensure a reliable, bounded local user experience without ever freezing your terminal.
The GitAI Smart Token Optimization
Why are these times so consistent? GitAI does not just dump raw data into the LLM. It includes a custom pre-processing pipeline that strips out compiler noise, binary files, white spaces, and structural brackets before sending the payload.
- Linear vs. Deductive Processing: Testing proved that sending a complete, clean code block up to 2500 characters is significantly faster than truncating it too early. By providing the model with full, clean context, the LLM processes the data linearly instead of wasting CPU cycles trying to "guess" missing code structures. This balance cuts down processing overhead by up to 30 seconds on older machines while boosting commit accuracy to a staggering 98%.
Dependencies
| Package | Purpose |
|---|---|
| llama-cpp-python | Run the local AI model as an HTTP server |
| httpx | Download the model and communicate with the daemon |
| psutil | Stop the background daemon (gitai out) |
| colorama | Handle cross-platform terminal text colorization and visual hierarchy |
License
This project is licensed under the MIT License. See the LICENSE file for details.
Developed by Pablo Salinas - PyBloSoft © 2026
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitai_local-1.1.0.tar.gz.
File metadata
- Download URL: gitai_local-1.1.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e23a6d98a5cb65bd5876dae4cac34043aeb77545ae422bb434a4e3e7b134dc0
|
|
| MD5 |
f276cdf24c4612be844c6400f96a228a
|
|
| BLAKE2b-256 |
01bfdf8e534484cf7b3e7b21811bed77787e068ca9e33ec7cf2688fa7f9ec8da
|
File details
Details for the file gitai_local-1.1.0-py3-none-any.whl.
File metadata
- Download URL: gitai_local-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28c1dfa3e7f015b418fd35811906ad21a8b928b53ae85b7b219e792906b3196f
|
|
| MD5 |
64128a246e24b8128a582aeb094393b8
|
|
| BLAKE2b-256 |
ff110d412b152d5567f8240442f4a449cb1ebf7d68546ec9eb4d20404c2385b7
|