A pi extension that generates commit messages from staged git diff --cached changes, with an interactive TUI preview, optional clarification flow, clipboard copy, optional manual git commit, and configurable model/thinking settings.
/commit-msg/commit-msg:settings
- Generates commit messages from staged changes
- Supports repo or submodule selection
- Uses a configurable pi model
- Optional reasoning/thinking level
- Optional read-only repo inspection tools:
find_filesgrep_filesread_file
- When repo tools are enabled, the model is instructed to read the changed source files before producing the first result
- Interactive preview with sections for:
- context
- tool activity
- thinking / thinking summary
- generated result
- Runtime controls before and during generation:
Shift+Tabcycles the thinking level and saves itCtrl+Ytoggles repo tools and saves itCtrl+Rretries generation in the preview and applies the latest saved run settingsccopies the final message to the clipboardmcommits the currently staged changes with the generated message- These controls are available in repo selection (when applicable), optional context entry, and the preview itself
- Copies the final message to the clipboard
- Can manually run
git commit -F <generated-message-file>for staged changes from the preview - For submodule commits, can optionally auto-commit the updated submodule pointer in the parent repo with a fixed subject and a summary of the generated submodule commit message in the body
Settings are stored in:
~/.pi/agent/data/generate-commit-message/settings.json
Default settings:
{
"model": null,
"thinkingLevel": "medium",
"useRepoTools": true,
"showThinking": true,
"showToolActivity": true,
"showThinkingSummary": true,
"autoCommitSubmodulePointer": false
}If no model is configured, /commit-msg will ask you to configure one through /commit-msg:settings.
If useRepoTools is enabled, the model is instructed to inspect the changed readable files with read_file before giving its first answer. If it is disabled, the model is expected to rely only on the staged diff and user clarifications.
If autoCommitSubmodulePointer is enabled, pressing m after generating a submodule commit message commits the submodule first, then stages and commits the updated submodule pointer in the parent repo. The parent commit uses Update <submodule> submodule pointer as the subject and includes a one-line summary of the generated submodule commit message in the body. If disabled, the preview reminds you to stage and commit the parent pointer separately.
Clone the repo and install it into pi from a local path:
pi install /absolute/path/to/pi-generate-commit-messageOr test it for one run only:
pi -e /absolute/path/to/pi-generate-commit-messageThen reload pi:
/reload
GitHub: https://github.com/dimixar/pi-generate-commit-message
Install directly from GitHub with:
pi install git:github.com/dimixar/pi-generate-commit-messageAfter publishing to npm, install it with:
pi install npm:pi-generate-commit-messageextensions/
generate-commit-message/
index.ts
commit-message-generator.prompt.md
- This package uses pi's bundled runtime packages via
peerDependencies. - The bundled prompt is shipped with the extension.
- Persistent user settings are stored outside the package directory so updates do not overwrite them.
MIT