Repolode
Everduin94

Everduin94/better-commits

A TypeScript CLI that guides you through writing Conventional Commits messages, with branch-based inference and branch/worktree helpers.

Stars
2,284
Forks
80
Open issues
6
Last commit
2 months ago

What is it?

better-commits is a command-line tool that builds git commit messages following the Conventional Commits specification. Instead of typing the format by hand, you answer a series of prompts for commit type, scope, ticket, title, body and footers, then preview the result before the commit is created.

The tool infers the ticket number, commit type and scope from the current branch name, so common values are filled in automatically. Its configuration lives in a .better-commits.jsonc file that can be set globally or per repository, covering the type list, emojis, title length limits and more. A companion command, better-branch, creates branches or worktrees with consistently formatted names and can run pre and post hooks.

For automation, a --no-interactive mode with CLI flags lets scripts and coding agents generate commits without prompts, and --dry-run validates the resulting git commit command.

Key features

  • 01Builds Conventional Commits messages through guided prompts with a preview before committing
  • 02Infers ticket, scope and commit type from the branch name
  • 03Configurable globally or per repository via a JSONC config file
  • 04Creates branches or worktrees with consistent naming through better-branch
  • 05Non-interactive mode with CLI flags for scripts and coding agents

Use cases

  • Keeping commit history consistent across a team that follows Conventional Commits
  • Auto-filling ticket and scope fields from branch names like feature/TICKET-123-description
  • Letting AI coding agents produce standardized commit messages without interactive prompts
  • Creating git worktrees for each feature branch with predictable folder names

Quick start

  1. 1

    Install the CLI globally with npm (requires Node.js 20 or newer)

    npm install -g better-commits
  2. 2

    Run the CLI in your repository to create a commit

    better-commits

Things to know

  • Requires Node.js 20 or newer.

Topics

FAQ

What is better-commits?
A TypeScript CLI that guides you through writing Conventional Commits messages, with branch-based inference and branch/worktree helpers. better-commits is a command-line tool that builds git commit messages following the Conventional Commits specification. Instead of typing the format by hand, you answer a series of prompts for commit type, scope, ticket, title, body and footers, then preview the result before the commit is created.
Is better-commits free to use? What license does it have?
better-commits is open source under the MIT license. Check the license terms before using it in commercial products.
Is better-commits still maintained?
Updated within 6 months. The last commit to better-commits was on Aug 26, 2026.
What can I use better-commits for?
Keeping commit history consistent across a team that follows Conventional Commits Auto-filling ticket and scope fields from branch names like feature/TICKET-123-description Letting AI coding agents produce standardized commit messages without interactive prompts Creating git worktrees for each feature branch with predictable folder names
How do I install better-commits?
Install the CLI globally with npm (requires Node.js 20 or newer): npm install -g better-commits Run the CLI in your repository to create a commit: better-commits
Where can I get better-commits?
The source code and installation instructions are on GitHub: https://github.com/Everduin94/better-commits

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects