Skip to content

bashnko/sweet-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sweet-commit

npm version

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.

Installation

via npm

Install globally (recommended) or run with npx:

npm install -g sweet-commit
# or
npx sweet-commit

manually

## clone the repo :
git clone https://github.com/bashnko/sweet-commit.git

## intall dependencies
npm i

## link the package globally
npm link

Setup

Keep 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:

Run the interactive setup:

scom setup

You will be asked to choose a primary agent and an optional fallback agent.

Usage

Make some changes in your project, stage the files you want to include, and run:

scom

scom 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 -s or scom --short for a short commit message
  • scom -a or scom --adaptive for adaptive output
  • scom -d or scom --detailed for a detailed commit message

Config file

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.conf or ~/.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.conf in that directory)

Default settings written by the setup:

  • humanLikeCommit: true
  • defaultCommitStyle: adaptive

Available commit styles:

  • short
  • detailed
  • adaptive

Available commands

  • scom — generate a commit message from staged changes and commit
  • scom setup — interactive setup for providers and keys
  • scom config — show active config path and values
  • scom update — update sweet-commit to the latest version
  • scom --agent <name> — run using a specific configured agent
  • scom --short / -s — force short one-line commit
  • scom --detailed / -d — force detailed commit
  • scom --adaptive / -a — adaptive style (default)
  • scom --version / -v — show version

Changing models

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.

Example config (.scom.conf)

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=adaptive

Feature requests

Please open feature requests or bug reports on the project's GitHub repository (create a new issue with a clear title and reproduction steps).


About

sweet commit helps you write clear, conventional commit style messages with ease.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors