AI-powered commit messages that just work. One command, perfect commits, every time.
npm install -g sweet-commit-
Stage your changes:
git add . -
Generate and commit:
scom
The tool will analyze your staged changes, generate a conventional commit message using AI, show it to you, and commit after confirmation.
Get your Gemini API key from Google AI Studio and configure it:
Option 1: .env file (Recommended)
Create a .env file in your project:
GEMINI_API_KEY=your-api-key-here
Option 2: Environment variable
export GEMINI_API_KEY="your-api-key-here"Option 3: Permanent setup (Not recommended) Add to your shell profile for system-wide access:
For bash users:
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrcFor zsh users:
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.zshrc
source ~/.zshrcWarning: This stores your API key permanently in your shell profile. Only use this if you understand the security implications and are on a personal, secure machine.
- Automatic analysis of staged git changes
- Generates conventional commit messages following best practices
- Uses Gemini AI for intelligent commit message creation
- Clean, minimal interface with no unnecessary output
- Zero configuration required after API key setup
- Supports both environment variables and .env files
- @clack/prompts - Clean CLI interface
- @google/genai - Gemini AI integration
- Node.js 20 or later
- Git repository with staged changes
- Gemini API key