Skip to content

JaredReisinger/committed

Repository files navigation

committed

Go reference GitHub go.mod Go version GitHub Actions workflow status codacy grade code coverage GitHub License

A bubbletea-powered text UI that integrates as a proper commit-msg hook for conventional commits.

Installation

Either grab the binary appropriate to your platform from the Releases page, or install directly from Go:

go install github.com/jaredreisinger/committed@latest

Note

If you're using Go 1.24 or later, you can also add committed as a tool dependency via:

go get -tool github.com/jaredreisinger/committed@latest

Usage

As a Git Hook

Install as a commit-msg hook:

# In your git repository
ln -s $(which committed) .git/hooks/commit-msg

or create a .git/hooks/commit-msg file that leverages it:

cat <<EOF > .git/hooks/commit-msg
#!/usr/bin/sh
committed $@
EOF

chmod +x .git/hooks/commit-msg

Note

If you're using Go 1.24 or later, and added committed as a tool dependency, you can start it with go tool committed:

cat <<EOF > .git/hooks/commit-msg
#!/usr/bin/sh
go tool committed $@
EOF

chmod +x .git/hooks/commit-msg

Now when you run git commit, the TUI will appear to help format your commit message.

Manual Usage

You can also run the tool manually; it will load/edit the given file:

committed /path/to/COMMIT_EDITMSG

Note

If you're using Go 1.24 or later, and added committed as a tool dependency, you can start it with::

go tool committed /path/to/COMMIT_EDITMSG

Configuration

The tool automatically detects conventional commit configuration from:

  1. .commitlintrc.json
  2. .commitlintrc.{yaml,yml}
  3. package.json (commitizen field)

Example .commitlintrc.json

{
  "rules": {
    "type-enum": [2, "always", ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "revert"]],
    "subject-max-length": [2, "always", 72]
  }
}

Features

  • Interactive TUI for composing conventional commits
  • (TODO) Automatic detection of project conventions
  • Pre-population from existing commit messages
  • (TODO) Real-time validation with helpful error messages
  • Support for conventional commit format with type, scope, description, and body

Development

This project leverages task to manage testing and building.

# Run tests
task test

# Build
task build

# Install locally
task install

Also, tool dependencies (like gcov2lcov) are now managed via the (as of Go 1.24) go get -tool ... command, so things like go mod tidy will automatically fetch them. Additionally, there is a task prepare command that functions semantically like npm install... it fetches dependencies and performs other one-time post-clone steps.

About

A bubbletea-powered text UI that integrates as a proper `commit-msg` hook for conventional commits.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages