Skip to content
gitcomm.

Documentation

Getting Started

What gitcomm does, what it needs from you, and how a single command turns a staged diff into a committed change.

On this page

gitcomm reads your staged changes, learns how your repository writes commit messages, and proposes a few that sound like they came from you. Pick one, edit it, or write your own. gitcomm runs git commit for you.

The whole tool. Run it inside any Git repository.
npx gitcomm

There is no config file to write and no account to create. The first run reads whatever history already exists in the repository and works from there.

How it works

Four steps happen between your staged files and a commit on disk.

  1. Reads the staged diff and classifies each file by role. Built-in presets cover Laravel and Next.js; everything else falls back to naming and path rules.
  2. Reads your recent commit history to work out the style: Conventional Commits or plain sentences, English or Indonesian, short or verbose subjects, emoji or none.
  3. Sends a small, redacted slice of the diff to the suggestion service and gets back several candidate messages in your detected style.
  4. Shows you the candidates. Your pick runs through git commit, optionally followed by git push.

Requirements

RequirementVersion
Node.js20.12.0 or newer
GitAny recent version
RepositoryMust be a Git repo with at least one commit

Run it per-command, or add it to a project or your machine globally. Pick your package manager and the command fills itself in. Either way the binary is called gitcomm.

Your first run

Stage something and run the command:

bash
git add src/auth/login.ts src/auth/session.ts
npx gitcomm

gitcomm prints what it found before it asks anything, so you can see whether it read your repo correctly:

text
◆  gitcomm

┌─ repository status ────────────────────────────────┐
│ branch: main                                       │
│ 2 staged file(s)                                   │
│   A  src/auth/login.ts                        auth  +80 -0       │
│   A  src/auth/session.ts                      auth  +20 -0       │
│ working tree: 2 staged, 0 modified, 0 untracked    │
│ hints: type=feat, scope=auth                       │
│ style: conventional commits, en, subject <= 72 chars│
└─────────────────────────────────────────────────────┘

◆ Choose a commit message:
● feat(auth): add login and session modules
○ feat(auth): scaffold auth module with login and session
○ Write my own message
○ Cancel

Arrow keys move the selection, Enter confirms. Choosing Write my own message opens your editor so you can type the subject yourself, and Cancel exits without touching the repository.

Next steps

  • Installation — install it globally or keep it per-project.
  • Usage — the full commit flow, including staging and pushing.
  • Commands — every flag, grouped by what it affects.