Generates a commit message from your staged changes (or working-tree changes if nothing is staged) and drops it straight into the Source Control input box.
Feature
A ✨ sparkle icon button appears in the Source Control view's title bar. Click it to generate a commit message for the currently open repo. The extension itself also ships with a custom icon (media/icon.png), shown in the Extensions list once installed.
How it works
No AI API calls, no network access, no API keys needed. It's a fast, local heuristic:
Reads git diff --cached --name-status (staged changes). Falls back to git diff --name-status (unstaged) if nothing is staged.
Classifies the change set (docs / test / style / chore / feat / fix) based on file paths and statuses (Added/Modified/Deleted/Renamed).
Guesses a scope from the most common top-level directory touched.
Builds a Conventional Commits-style subject line: type(scope): summary, plus a bullet-point body listing every changed file when there's more than one.
Writes the result into the active repo's Source Control input box, ready to review and commit.
Settings
Setting
Default
Description
gitCommitGen.style
conventional
conventional → type(scope): summary. plain → just the summary line.
gitCommitGen.maxSubjectLength
72
Subject line is truncated with … past this length.
Install (development)
cd git-commit-gen
npm install # no dependencies currently, but keeps npm happy
Then in VS Code:
Open this folder.
Press F5 to launch an Extension Development Host.
Open any Git repo in that window, make some changes, open the Source Control view, and click the ✨ icon in its title bar.
Package as a .vsix (optional)
npm install -g @vscode/vsce
vsce package
This produces a .vsix you can install via code --install-extension git-commit-gen-0.0.1.vsix or through the Extensions view's "Install from VSIX" command.
Notes / possible extensions
Currently the "AI" is a rule-based heuristic, not an LLM call — it's instant and works offline.
If you'd like it to call the Anthropic API (or another LLM) to write more natural summaries from the actual diff content instead of just file names, that's a straightforward follow-up — just say the word.