AI-powered commit messages that just work. One command, perfect commits, every time.
npm install -g sweet-commit-
Get your Gemini API key from Google AI Studio.
-
Run the setup command:
scom setup
-
Follow the prompts to enter your API key. That's it!
To update to the latest version:
scom updateCheck your current version:
scom -vGenerate and commit (will prompt to stage if needed):
scomYou can also specify the commit style directly with a flag. For example:
scom -s # Short commit message
scom --adaptive # Adaptive commit message
scom -d # Detailed commit messageYou can control the commit message style directly from the CLI:
scom --shortorscom -s— Short, conventional commit messagescom --adaptiveorscom -a— Adaptive (short for simple, detailed for complex)scom --detailedorscom -d— Fully detailed, multi-line commit message
Note: CLI flags always override your config file's default style.
- Checks for unstaged changes and offers to stage them automatically
- Analyzes your changes using AI
- Generates a commit message in your chosen style
- Lets you confirm or regenerate the message
- Commits after confirmation
When you run scom setup, a .scom.conf file is created in your config directory (e.g. ~/.config/.scom.conf and inside APPDATA for windows).
-
This file securely stores your Gemini API key and other configuration options, such as your default commit style.
-
You can edit this file manually if you want to change your API key or set a different default commit style (e.g.,
adaptive,short, ordetailed). -
Example
.scom.conf:apiKey=your-gemini-api-key humanLikeCommit=true defaultCommitStyle=adaptive
Note: CLI flags (like
--short,--adaptive,--detailed) always override the style set in.scom.conffor a single run.
- Flexible commit styles: Use CLI flags to choose short, adaptive, or detailed commit messages on demand
- Auto-stage prompt: Automatically offers to stage unstaged changes
- Intelligent message generation: Comprehensive bodies for complex changes, concise for simple ones
- 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