Snap your commits into shape.
snap-commit is a lightweight CLI tool that helps you create consistent Git commits following the Conventional Commits standard.
- Interactive commit flow - Select type, enter scope, write summary - all via keyboard-friendly prompts
- Conventional Commits - Enforces
<type>(<scope>): <summary>format automatically - Built-in validation - Rejects invalid types, warns if summary/scope is too long
- Auto-stage -
-aflag stages all tracked files before committing - Amend support -
--amendto edit the latest commit message - Zero config - Works out of the box with sensible defaults
- Custom config - Create
.snap.tomlto customize commit types and validation rules
brew tap nxkh4ng/homebrew-tap
brew install snap-commitscoop bucket add nxkh4ng https://github.com/nxkh4ng/scoop-bucket
scoop install snap-commitInstall with Go 1.21+
go install github.com/nxkh4ng/snap@latestImportant
Make sure your $GOPATH/bin (or %USERPROFILE%\go\bin on Windows) is in your PATH
- Download the ZIP file for your OS from GitHub Releases
- Extract the archive
- Move
snap(orsnap.exeon Windows) to a folder in yourPATH
snap -aStages all tracked files automatically before committing.
snap --amendEdit the latest commit message.
Add ! at the end of type name
| Commands | Description |
|---|---|
snap |
Create a new commit |
snap -a |
Auto-stage tracked files and create commit |
snap --amend |
Amend the latest commit message |
snap init |
Create .snap.toml config file |
snap --help |
Show help |
snap --version |
Show version |
snap initCreates .snap.toml in the current directory.
# Commit types available in the interactive selector
[commit_types]
feat = "A new feature"
fix = "A bug fix"
docs = "Documentation only changes"
style = "Formatting, white-space, missing semi-colons"
refactor = "Code changes that neither fix bugs nor add features"
perf = "Code changes that improve performance"
test = "Adding missing tests or correcting existing tests"
build = "Changes that affect the build system or external dependencies"
ci = "Changes to our CI configuration files and scripts"
chore = "Other changes that don't modify src or test files"
revert = "Reverts a previous commit"
# Validation rules
[validations]
require_scope = false
require_description = false| Option | Type | Default | Description |
|---|---|---|---|
commit_types |
map | 11 types | Commit types |
require_scope |
bool | false | Make scope mandatory |
require_description |
bool | false | Make description mandatory |
brew uninstall snap-commit
brew untap nxkh4ng/tapscoop uninstall snap-commit
scoop bucket rm nxkh4ng# macOS / Linux
rm "$(go env GOPATH)/bin/snap"
# Windows (PowerShell)
Remove-Item "$(go env GOPATH)\bin\snap.exe"
# Windows (CMD)
del "%USERPROFILE%\go\bin\snap.exe"


