@andre-barbosa/pi-commit
A read-only pi extension that suggests Conventional Commit messages for uncommitted changes
Package details
Install @andre-barbosa/pi-commit from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@andre-barbosa/pi-commit- Package
@andre-barbosa/pi-commit- Version
0.1.3- Published
- Jul 28, 2026
- Downloads
- 312/mo · 312/wk
- Author
- andre-barbosa
- License
- MIT
- Types
- extension
- Size
- 42.2 KB
- Dependencies
- 0 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@andre-barbosa/pi-commit
A read-only pi extension that suggests Conventional Commit messages for uncommitted changes.
pi-commit never stages files and never creates commits. It only inspects Git state, sends bounded change context to a model, and displays suggested text.
Install
Install from npm:
pi install npm:@andre-barbosa/pi-commit
Try a local checkout without installing it:
pi -e ./src/index.ts
Or install the local checkout as a pi package:
pi install .
The package can also be placed in a global or project extension directory supported by pi.
Commands
One message for all changes
/commit
One message per folder
/commit /folder1 /folder2
Folder arguments are relative to the current Git repository root. If the current directory is not in a repository, they are relative to the current directory so child repositories can still be requested. Leading / is optional and denotes that path base; it is not an absolute filesystem path. Quote folders containing spaces:
/commit "/packages/web app" /packages/api
For each requested folder, pi-commit runs Git with that folder as its working directory when Git can be used there. A nested repository is therefore inspected as its own repository, even when its folder is ignored by a parent repository, while an ordinary folder in the current repository remains folder-scoped. Multiple arguments may target different repositories. If a folder cannot be used as a Git working directory, pi-commit falls back to the previous repository-root pathspec inspection.
An explicitly requested folder overrides an ignore rule on that folder. In that case, ignored files are reported as !! and receive the same bounded, sensitive-name-aware previews as untracked files. Ignored files elsewhere remain excluded.
Overlapping folder arguments are rejected so the same change is not described twice. Folders with no changes are reported and skipped. The command does not stage or partition changes—it only returns suggested messages.
Select a smaller model
/commit-model
The interactive selector shows eight models at a time, fuzzy-filters as you type, and opens on the current commit model. A model can also be selected directly:
/commit-model google/gemini-2.5-flash
For a temporary CLI override:
pi --commit-model google/gemini-2.5-flash
The selection is independent from pi's conversation model: pi-commit never calls pi.setModel(). Interactive selections are saved in pi-commit.json under pi's global agent directory. Credentials remain managed by pi; configure providers through /login or models.json.
Output
Each model call must return exactly one line in this form:
feat(ui): add compact navigation controls
Allowed types are feat, fix, docs, style, refactor, perf, test, build, ci, chore, and revert. Responses are validated and retried once when malformed.
Suggestions open in an editor dialog for manual adjustment. Press Enter to copy the edited text to the clipboard and close; press Escape to close without copying. Neither action stages files or creates a commit.
What is inspected
pi-commit reads:
- NUL-delimited
git statusoutput, including ignored files only when their folder was explicitly requested - staged and unstaged diff statistics
- staged and unstaged patches
- bounded previews of untracked and explicitly included ignored text files
Binary files and symlinks are represented by metadata. Untracked or explicitly included ignored files with names that appear sensitive, such as .env, credential, secret, PEM, or key files, are not read. Context is capped before it is sent to the model, while complete filenames and statuses are retained.
Selected model providers receive the included source diff. Review the provider's privacy policy before using the extension with sensitive repositories. Tracked sensitive files may still appear in Git patches.
Safety boundary
Production Git execution is centralized in ReadOnlyGit and permits only:
git rev-parsegit statusgit diffgit check-ignore
Commands are invoked with argument arrays, external diff/text conversion is disabled, and there is no implementation for git add, git commit, git stash, git reset, checkout, or push.
Development
npm install
npm run check
npm test