Skip to content

Hangell/gommit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Gommit Go Report Card GitHub tag Build License Contributing Go Reference

pt-BR ru hi zh-CN es en

gommit is a fast, zero-dependency command-line assistant for Conventional Commits, written in Go.
It opens an interactive wizard (similar to Commitizen/cz) and executes git commit with the properly formatted message.

πŸ’‘ By default, commit type emojis are included in the header (e.g., feat πŸ’‘: ...) to make them visible in GitHub's file/folder listings. Emojis are only added to the title, not to the body or footer.


✨ Features

  • βœ… Interactive wizard with search/shortcuts (numbers, keywords, q to quit)
  • βœ… Standard Conventional Commits types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
    Plus extras: WIP, prune
  • βœ… Emojis in menu (with automatic ASCII fallback) and emoji in commit header
  • βœ… Git pre-checks:
    • Repository validation (not a git repository… if not in one)
    • Auto-stage (git add -A) when nothing is staged (toggleable)
    • List staged changes before committing (toggleable)
    • --amend mode with last commit banner
  • βœ… Full Commitizen-style fields:
    • scope (optional)
    • subject (required, <=72 characters)
    • body multiline (end with single dot on a line or press Enter twice)
    • BREAKING CHANGE (prompts and asks for description)
    • Issues: Closes #123 / Refs #45 (if desired)
  • βœ… Built-in --install mode that installs/updates the binary in user PATH
    • Windows: %LOCALAPPDATA%\Programs\gommit\bin
    • Linux/macOS: ~/.local/bin (adds to PATH if missing)

πŸš€ Installation

Method 1: One-liner Installation Scripts (Recommended)

Windows:

powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://raw.githubusercontent.com/Hangell/gommit/main/scripts/install.ps1 | iex"

Linux/macOS:

curl -fsSL https://raw.githubusercontent.com/Hangell/gommit/main/scripts/install.sh | bash

Method 2: Download Release Binary

  1. Download the artifact for your OS/architecture from the Releases page
  2. Extract the package (.zip on Windows / .tar.gz on Linux/macOS)
  3. Run the extracted binary with the --install flag:

Windows (PowerShell):

.\gommit.exe --install
# Close and reopen terminal
gommit --version

Linux/macOS:

chmod +x ./gommit
./gommit --install
# Restart shell
gommit --version

Running --install again will update the installation.


πŸ’» Quick Usage

Inside a Git repository with changes:

gommit

Typical wizard flow:

  1. Select type (number, name, or search)
  2. Enter scope (optional)
  3. Write subject (imperative mood, <=72 chars)
  4. Add body (optional, multiline) – end with . on a line or press Enter twice
  5. Breaking changes? (if "yes", describe the change)
  6. Issues? (Closes/Refs)

At the end, gommit executes git commit (or shows preview with --dry-run).

Examples

Normal commit (with auto-stage):

gommit

Allow empty commit:

gommit --allow-empty

Amend last commit:

gommit --amend

Show message only (don't commit):

gommit --dry-run

Pass everything via flags (no wizard):

gommit --type feat --scope ui --subject "add type picker" --body "Implementation details..."

Non-interactive mode with all parameters:

gommit --type fix --scope api --subject "resolve authentication issue" --body "Fixed JWT token validation\n\nThis resolves the issue where expired tokens\nwere not being properly handled." --footer "Closes #42"

πŸ“ Commit Header Format

<type>[(!)][(scope)] <emoji>: <subject>

Examples:

feat πŸ’‘: add install command
fix(api) πŸ›: correct nil pointer on config load
refactor(core)! 🎨: unify message builder

The ! appears only in the header; internal validation uses the "pure" type (feat, fix, etc.) to maintain compatibility with Conventional Commits tools.


βš™οΈ Command Line Flags

Flag Description
--version Show version and exit
--install Install/update binary to user PATH and exit
--dry-run Only print the generated message (don't call git commit)
--type Commit type (feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert, WIP, prune)
--scope Optional scope (e.g., ui, api)
--subject Subject line (imperative mood, <=72 chars)
--body Body text (use \n for new lines)
--footer Manual footer (e.g., Closes #123)
--as-editor Run as Git editor (COMMIT_EDITMSG mode)
--allow-empty Allow empty commit
--amend Amend the last commit
--no-verify Skip hooks (pre-commit, commit-msg)
--signoff Add Signed-off-by trailer
--auto-stage Auto git add -A when nothing is staged (default: true)
--show-status Show staged changes summary before commit (default: true)

πŸ“‹ Supported Commit Types

Type Emoji Description
WIP 🚧 Work in progress
feat πŸ’‘ A new feature
fix πŸ› Fixing a bug
chore πŸ“¦ Updating dependencies, deployments, configuration files
refactor 🎨 Improving structure/format of the code
prune πŸ”₯ Removing code or files
docs πŸ“ Writing documentation
perf ⚑ Improving performance
test βœ… Adding tests
build πŸ”§ Changes to build system or dependencies
ci πŸ€– Changes to CI/CD configuration
style πŸ’… Changes that do not affect the meaning of the code
revert βͺ Revert to a commit

πŸ”§ Git Editor Mode

You can configure gommit as your Git editor for consistent commit messages:

git config --global core.editor "gommit --as-editor"

This will open the gommit wizard whenever Git needs a commit message (including during git commit, git merge, git rebase, etc.).


πŸ› οΈ Development

Building from Source

Requirements: Go 1.22+

# Clone the repository
git clone https://github.com/Hangell/gommit.git
cd gommit

# Build
go build -o gommit ./cmd/gommit

# Run tests
go test ./...

# Install locally
./gommit --install

Building with Version Information

For releases with version injection:

go build -ldflags "-s -w -X main.version=0.2.0" -o gommit ./cmd/gommit

🎨 Environment Variables

Variable Description
NO_COLOR=1 Disable ANSI colors in menu
NO_EMOJI=1 Force ASCII fallback in menu (header still uses unicode emojis)

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using gommit πŸ˜‰
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

GPL-3.0-only β€” see LICENSE file for details.


❓ FAQ

Does gommit replace Commitizen? It's an alternative. If your environment already depends on Node/npm and you're comfortable with cz adapters, stick with it. If you want fewer dependencies, single installation, and consistent usage across multiple repositories/servers, gommit is probably simpler.

Is it faster? We don't publish benchmarks here, but as a native binary, gommit tends to start faster and use less memory than traditional Node CLI tools β€” especially in cold environments (CI, containers) where starting the Node runtime adds latency.

Does it work offline? Yes. Once installed, it doesn't need network access to run the wizard or commit.

Why was gommit created? The idea was born from frustration with nvm environments where we had to install git-cz for each nvm version or directly in each project. gommit is much simpler and provides a single, unified solution.


🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using gommit πŸ˜‰
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ‘¨β€πŸ’» Author

Rodrigo Rangel


πŸ“„ License

GPL-3.0-only β€” see LICENSE file for details.


πŸ™ Acknowledgments


Made with ❀️ for the developer community

About

gommit is a fast, zero-dependency, cross-platform Commitizen-style assistant written in Go. It launches an interactive wizard on git commit and outputs pure Conventional Commits (no emojis in the final message, just in the prompt), so your pipelines and changelog tools recognize everything out of the box.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors