git-smart-commit-cli
v1.0.1
Published
AI-powered git commit message generator
Readme
Git Smart Commit (ai-commit-cli)
An AI-powered Git commit message generator. Stop writing repetitive commit messages and let AI generate conventional, descriptive commits for you based on your staged code changes.
Features
- Bring Your Own Key (BYOK): Securely stores your free API key locally (
~/.ai-commit/config.json). - Google Gemini API Support: Blazing fast generation using the latest Gemini models.
- Ollama Support (Coming Soon): Generate commits locally with zero API keys or internet connection.
- Interactive UI: Review, edit, or regenerate the commit message before applying it.
Installation
You can run it directly without installing:
npx git-smart-commit-cliOr install it globally via npm:
npm install -g git-smart-commit-cliSetup
First, configure your AI provider (Currently supports Google Gemini):
ai-commit configYou will be prompted to enter your Gemini API key.
Usage
- Stage your changes:
git add .- Run the tool:
ai-commitThe tool will analyze your git diff --staged and generate a commit message following the Conventional Commits specification.
Interactive Menu
Once the message is generated, you will see a prompt:
- Accept and Commit: Automatically runs
git commit -m "..." - Regenerate: Asks the AI for another option
- Edit manually: Opens an input field to tweak the AI's suggestion
- Cancel: Aborts the commit
License
MIT
.
