npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-git-commit

v1.0.1

Published

Pi extension: block mutative git commands in bash and provide a git_commit tool plus /commit and /toggle-allow-git commands

Readme

pi-git-commit

Keeps mutative git operations out of the agent's bash and provides a safe, reviewable commit flow in pi-coding-agent: a bash guard, a git_commit tool, and /commit + /toggle-allow-git commands.

What you get

  • Bash git guard. Mutative git commands are blocked in the agent's bash tool — add, commit, push, pull, merge, rebase, reset, clean, rm, restore, switch, cherry-pick, revert, mv, init, clone, plus destructive forms of branch, tag, checkout, stash, submodule, worktree, config, remote, apply, notes, update-ref, gc and more. Read-only commands (status, diff, log, fetch, branch, tag, stash list, ...) stay allowed.
  • git_commit tool. The agent stages everything and commits with a FIX / IMPROVE / NEW type prefix. Enabled automatically on session start.
  • /commit command. Waits for queued messages to finish, stages all changes, shows the staged diff, and asks the agent to review it and commit via git_commit — never via bash.
  • /toggle-allow-git command. Temporarily allows mutative git commands in bash for the current session. The guard re-arms on the next session.

Quick start

  1. Make your changes, then run:
/commit
  1. The extension stages the working tree and hands the staged diff to the agent with instructions to review it.

  2. The agent commits using the git_commit tool:

{
  "type": "FIX",
  "message": "Fix off-by-one in the retry loop"
}
  1. If you need to run mutative git yourself, allow it for the session:
/toggle-allow-git

Installation

pi install npm:pi-git-commit

From a local checkout:

pi install /path/to/pi-git-commit

The git_commit tool

| Field | Description | | --- | --- | | type | FIX (bug fix), IMPROVE (improvement), or NEW (new feature). | | message | Commit message in imperative mood. Multi-line allowed for detailed changes. |

The tool runs git add . followed by git commit -m "<TYPE>: <message>" and reports staging or commit failures as tool errors. The agent is instructed to only use it after you run /commit.

The bash guard

The guard intercepts tool_call events for the bash tool and blocks commands that match mutative git forms. The block list is a conservative superset: anything that can change repository state is blocked, while a curated set of read-only forms is explicitly allowed (for example git fetch, git stash list, git remote -v, git config --get, git apply --check, git checkout -- <file>, git submodule status, git worktree list).

A blocked command returns:

Mutative git commands are blocked. Use /toggle-allow-git to allow for this session.

Troubleshooting

  • The agent refuses to commit. The guard blocks git commit in bash by design. Run /commit and let the agent use the git_commit tool.
  • "Nothing to commit (empty diff)." There are no staged changes — make edits first, then run /commit again.
  • I need git in bash right now. Run /toggle-allow-git; the guard re-arms automatically on the next session start.

Development

Requires Node.js ≥ 22.19 and npm.

npm install
npm test
npm run typecheck

Credits

  • badlogic, pi-coding-agent and the tool/command APIs

License

MIT