@mr_kaakyire/autogit
v1.0.2
Published
CLI tool to generate Git commit messages using Gemini API
Readme
autogit
Generate smart Git commit messages using the Gemini API (now using the gemini-2.0-flash model).
Features
- Reads your staged Git diff
- Sends it to Gemini (Google AI) for a commit message (using the
gemini-2.0-flashmodel) - Outputs a Markdown bullet list
- Optional: Auto-commit with generated message
- Shows a loading spinner during message generation
- Displays a success message when commit message is generated
- Displays a failure message if generation fails
Installation
- Clone this repo
- Install dependencies:
npm install - Set up your API key:
- Copy
.env.exampleto.env - Add your Gemini API key to
.env
- Copy
Usage
Stage your changes with git add as usual, then run:
npx autogitOr, to auto-commit with the generated message:
npx autogit --commitYou can also install globally:
npm install -g .Then use:
autogit [--commit]Environment Variables
GEMINI_API_KEY— Your Gemini API key (see.env.example)
Dependencies
ora— for the loading spinner
Notes
- Only staged changes are used (like
git commit) - Handles API and Git errors gracefully
- Requires Node.js 16+
MIT License
