gemini-commit
v1.0.3
Published
CLI tool for generating conventional commit messages using Google Gemini
Maintainers
Readme
Commit CLI
AI-powered CLI tool for generating conventional commit messages using Google Gemini.
Features
- 🤖 AI-generated commit messages using Google Gemini 2.5 Flash Lite
- 📋 Conventional commit format compliance
- 🔄 Automatic staging of changes
- 🚀 Optional push to remote
- 🔍 Context-aware generation using recent commits
- 🎯 Support for staged-only commits
Installation
npm installSetup
Get a Google AI API key from Google AI Studio and set it as an environment variable:
export GOOGLE_AI_API_KEY="your-api-key-here"Alternatively, pass it using the --api-key option.
Usage
# Basic usage - generates commit for all changes
npm start
# Or if installed globally
commit-cli
# Options
commit-cli --help
commit-cli --dry-run # Preview commit message without committing
commit-cli --staged # Only use staged changes
commit-cli --push # Push after committing
commit-cli --api-key "your-key" # Provide API key directlyExamples
# Generate and commit all changes
commit-cli
# Preview commit message for staged changes
commit-cli --staged --dry-run
# Commit and push to remote
commit-cli --push
# Use specific API key
commit-cli --api-key "your-api-key"Conventional Commit Types
The tool generates commits using these conventional types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test additions/changeschore: Maintenance tasksperf: Performance improvementsci: CI/CD changesbuild: Build system changes
Requirements
- Node.js 16+
- Git repository
- Google AI API key
