AI-powered commit messages that just work. One command, perfect commits, every time.
npm install -g sweet-commitTo update to the latest version:
npm update -g sweet-commitCheck your current version:
npm list -g sweet-commit- Generate and commit (will prompt to stage if needed):
scom
The tool will:
- Check for unstaged changes and offer to stage them automatically
- Analyze your changes using AI
- Generate 3 different commit message options with colored headings
- Let you choose your preferred message
- 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.
- Multiple commit message options: Generate 3 variations with different perspectives and detail levels
- Auto-stage prompt: Automatically offers to stage unstaged changes
- Intelligent message generation: Comprehensive bodies for complex changes, concise for simple ones
- Automatic analysis: Analyzes staged git changes with smart optimization for large changesets
- Conventional commits: Follows best practices and conventional commit format
- Gemini AI powered: Uses latest Gemini AI for intelligent commit message creation
- Clean interface: Minimal, beautiful CLI with no unnecessary output
- Zero configuration: Works immediately after API key setup
- Flexible setup: Supports 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