Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Version Release License: MIT

snap-commit

Snap your commits into shape.

snap-commit is a lightweight CLI tool that helps you create consistent Git commits following the Conventional Commits standard.

Demo


Features

  • 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 - -a flag stages all tracked files before committing
  • Amend support - --amend to edit the latest commit message
  • Zero config - Works out of the box with sensible defaults
  • Custom config - Create .snap.toml to customize commit types and validation rules

Installation

Homebrew (macOS / Linux)

brew tap nxkh4ng/homebrew-tap
brew install snap-commit

Scoop (Windows)

scoop bucket add nxkh4ng https://github.com/nxkh4ng/scoop-bucket
scoop install snap-commit

Go

Install with Go 1.21+

go install github.com/nxkh4ng/snap@latest

Important

Make sure your $GOPATH/bin (or %USERPROFILE%\go\bin on Windows) is in your PATH

Download binary

  1. Download the ZIP file for your OS from GitHub Releases
  2. Extract the archive
  3. Move snap (or snap.exe on Windows) to a folder in your PATH

Quick Start

Auto-stage

snap -a

Stages all tracked files automatically before committing.

Auto-staged Demo

Amend commit

snap --amend

Edit the latest commit message.

Amend Demo

Add Breaking Change commit

Add ! at the end of type name

Breaking Change Demo


Commands

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

Configuration

Initialize config

snap init

Creates .snap.toml in the current directory.

Default config

# 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

Config options

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

Uninstall

Homebrew (macOS / Linux)

brew uninstall snap-commit
brew untap nxkh4ng/tap

Scoop (Windows)

scoop uninstall snap-commit
scoop bucket rm nxkh4ng

Manual (Go install or Binary)

# 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"

About

A lightweight CLI tool that helps you create consistent Git commits following the Conventional Commits standard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages