commit messages that just work. One command, perfect commits, every time.
Warning
If you already use scom and update to the latest version, your existing config may break.
Re-run scom setup to migrate or recreate your configuration.
Install globally (recommended) or run with npx:
npm install -g sweet-commit
# or
npx sweet-commit## clone the repo :
git clone https://github.com/bashnko/sweet-commit.git
## intall dependencies
npm i
## link the package globally
npm linkKeep your API keys ready: a primary API key and an optional fallback key (recommended). The fallback is used only if the primary provider fails.
Recommended free/accessible providers:
- Groq: https://console.groq.com/
- Gemini: https://aistudio.google.com/
Run the interactive setup:
scom setupYou will be asked to choose a primary agent and an optional fallback agent.
Make some changes in your project, stage the files you want to include, and run:
scomscom reads the staged diff, generates a commit message, and then lets you confirm or regenerate before it commits.
You can also control the output style when you run it:
scom -sorscom --shortfor a short commit messagescom -aorscom --adaptivefor adaptive outputscom -dorscom --detailedfor a detailed commit message
Setup writes a simple key=value config file named .scom.conf.
Config file path
Default locations for the config file:
- Linux/macOS (XDG):
$XDG_CONFIG_HOME/sweet-commit/.scom.confor~/.config/sweet-commit/.scom.conf - macOS (fallback):
~/Library/Application Support/sweet-commit/.scom.conf - Windows:
%APPDATA%\sweet-commit\.scom.conf
You can override the location with environment variables:
SCOM_CONFIG=/absolute/path/to/.scom.conf(use a full file path)SCOM_CONFIG_DIR=/absolute/path/to/config-dir(writes.scom.confin that directory)
Default settings written by the setup:
humanLikeCommit:truedefaultCommitStyle:adaptive
Available commit styles:
shortdetailedadaptive
scom— generate a commit message from staged changes and commitscom setup— interactive setup for providers and keysscom config— show active config path and valuesscom update— update sweet-commit to the latest versionscom --agent <name>— run using a specific configured agentscom --short/-s— force short one-line commitscom --detailed/-d— force detailed commitscom --adaptive/-a— adaptive style (default)scom --version/-v— show version
Run scom model to open the interactive model chooser.
This command updates your global primary and fallback models, then saves them back to your config file.
It uses the API keys already stored in your config when they are available.
This command assumes you aleady have the API keys set, so it won't ask for them again.
If you want to change the keys, you can edit the config file directly or re-run scom setup.
The setup writes a .scom.conf file in key=value format. Example content:
GEMINI_API_KEY=your-gemini-key
GROQ_API_KEY=your-groq-key
DEEPSEEK_API_KEY=your-deepseek-key
DEFAULT_MODEL=gemini-2.5-flash
FALLBACK_MODEL=
BASE_URL=
humanLikeCommit=true
defaultCommitStyle=adaptivePlease open feature requests or bug reports on the project's GitHub repository (create a new issue with a clear title and reproduction steps).