🧙♂️ Git Commit Genie
⚡️ Generate smart Git commit messages from your staged code changes — powered by Gemini AI or offline rule-based logic.
✨ Features
- 🔍 Reads your
git diff --cached (staged changes)
- 🧠 AI mode – Uses Gemini to generate natural-language commit messages
- 📏 Rule-based mode – Infers messages based on file types, keywords, and diff size
- 💬 VS Code integration:
- Copy to clipboard
- Auto-insert into Source Control commit box
- 🌐 Dual mode: choose AI or offline anytime
- 🔐 Privacy: only sends data to Gemini if you choose AI mode
🚀 How to Use
- Make and stage code changes (
git add .)
- Open VS Code, press
Ctrl+Shift+P
- Run one of the following commands:
📏 Generate Rule-Based Commit Message
🔮 Generate AI Commit Message
- Choose:
- 💬 Use → inserts the message into the Git commit box
- 📋 Copy → copies message to your clipboard
🧪 Example Outputs
Rule-based:
feat: Update HTML (index.html), Update logic (script.js) – 10 lines added, 2 removed
AI (Gemini):
refactor: improve score reset logic and add match end condition
🔧 Configuration
- Install dependencies:
npm install
- Set your API key in a
.env file:
GEMINI_API_KEY=your-secret-key-here
Get your key from: Google AI Studio
- Compile the project:
npm run compile
| |