git-aic
v1.1.0
Published
AI-powered Git commit generator using Google Gemini
Downloads
209
Maintainers
Readme
Git Aic
git-aic is a command-line interface (CLI) tool built in TypeScript that upgrades your Git workflow by automatically generating high-quality, conventional commit messages.
Powered by Google Gemini, it analyzes your staged code changes and produces concise, descriptive, and standard-compliant commit messages, helping you maintain a clean and consistent Git history.
You define the rules.
You customize the system prompt.
You decide when it runs.
Your workflow. Your control.
Features
AI-Powered Message Generation
Uses Google Gemini API to generate commit messages from your Git diff.Self-Hosted & On-Demand
Runs locally in your terminal. No background processes. No editor lock-in.Full Control Over Rules
Modify the system prompt to enforce your own commit conventions and formatting style.Conventional Commits Compliance
Strictly follows formats likefeat:,fix:,refactor:,chore:.Commit Confirmation & Editing
Before committing, you can:- Accept the suggested commit message
- Edit the message
- Reject it
- Retry generation
Issue Linking
Attach commits to GitHub issues with--issue <number>.Optional Push After Commit
Use-por--pushto push after committing.Config Management
Set your Gemini API key or view your config:git aic config --key <key>git aic config
TypeScript & Type Safety
Built with TypeScript for maintainability and reliability.Seamless Git Integration
Directly integrates with Git using a CLI.
Why Not Just Use Copilot?
Many AI commit tools:
- Depend on editor integrations
- Limit customization
- Enforce their defaults
- Restrict usage
- Run continuously in the background
This tool is different.
It runs only when you call it.
It follows your prompt rules.
It generates commits exactly how you define them.
It stays out of your way.
There are no forced conventions.
No hidden behavior.
No unnecessary background processes.
If needed, you can rotate API keys later. You stay in control.
This is controlled automation — not passive AI assistance.
User Installation
To install git-aic globally via npm:
npm i -g git-aicgit aic --helpDeveloper Installation (For Contributors)
1. Clone the Repository
git clone https://github.com/Spectra010s/git-aic.git
cd git-aic2. Install Dependencies
npm install3. Build the Project
npm run buildConfiguration
Set API Key (Primary)
Use the CLI config command to save your Google Gemini API key:
git aic config --key <your_api_key>To view your current config:
git aic config"*Note:** it's masked by default for security reasons
To view the whole current config api key
git aic config --showEnvironment Variable (Fallback)
If you prefer not to use the config system, you can set it manually in your environment:
- macOS / Linux:
export GEMINI_COMMIT_MESSAGE_API_KEY=your_api_key_here- Windows (PowerShell):
setx GEMINI_COMMIT_MESSAGE_API_KEY "your_api_key_here"After setting the variable, restart your terminal.
Note: This method works, but using the CLI config is safer and easier for long-term usage.
Usage
Commit With AI Assistance
git aic- Prompts you with a generated commit message.
- You can accept, edit, reject, or retry the message.
Commit and Link to Issue
git aic --issue 123- Attaches the commit to GitHub issue #123.
Commit and Push
git aic -p- Pushes automatically after committing.
Configure API Key
git aic config --key <key>- Saves your Google Gemini API key.
git aic config- Displays your saved config.
That’s it.
No need to manually write commit messages anymore.
How It Works
- Captures your staged Git diff
- Builds a strict system prompt
- Sends the diff to Gemini
- Enforces Conventional Commit formatting
- Prompts for commit confirmation (accept, edit, retry, reject)
- Executes
git commitautomatically - Optionally pushes if
-pflag is used
You can modify commit behavior by editing:
src/prompt.tsTechnologies Used
| Technology | Purpose | | ----------------- | ---------------------- | | TypeScript | Core language | | Node.js | Runtime | | Axios | HTTP client | | Chalk | Styled terminal output | | Commander.js | CLI framework | | Simple-Git | Git integration | | Google Gemini API | LLM text generation |
Final Takeaway
Automating repetitive tasks like commit messages saves time — but the real win here is ownership.
git-aic:
- Self-hosted — runs entirely on your machine
- On-demand — only runs when you call it
- Fully customizable — prompts, commit format, workflow
- Under your control — you decide every step
It runs when you need it, follows your rules, and generates commits the way you want.
Choose your model. Define your prompt. Control the format. Extend or optimize anytime.
Instead of adapting to someone else's defaults, you built a system tailored to your workflow.
You are not just using AI tools.
You are building them to fit your process.
License
Author
Spectra010s
Parent Repository
This project is a fork and standalone version of:
https://github.com/samueltuoyo15/Commit-Message-Tool
