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

@skibum1869/pi-permission-gate

v1.0.1

Published

Severity-ranked bash permission gate for the pi coding agent: shell-aware risk analysis with interactive approvals, strict/active modes, and protected paths

Readme

@skibum1869/pi-permission-gate

A bash permission gate for the pi coding agent: blocks dangerous actions while leaving routine work free. Every risky bash command is analyzed with a shell-aware parser (not flat regexes), severity-ranked, and either prompted, denied, or passed through depending on the active mode — plus a hard-block list of protected paths.

Install

pi install npm:@skibum1869/pi-permission-gate

Or try it without installing:

pi -e npm:@skibum1869/pi-permission-gate

Modes

Three modes, cycled with /gate or Ctrl+Alt+G (footer shows 🛡 ask / 🛡 strict / 🛡 bash-only):

| Mode | Behavior | |------|----------| | ask (default) | Risky bash prompts Yes/No; protected-path writes are hard-blocked | | strict | Risky bash denied outright — for unattended runs | | bash-only | Same bash gating as ask, but the write gate is off |

Initial mode resolution (lowest → highest): built-in ask < global settings.json < project .pi/settings.json < session-persisted mode (resume/fork) < --gate ask|strict|bash-only flag.

{ "permission-gate": { "defaultMode": "strict" } }

Risk analysis

Commands are tokenized with shell-quote, split on &&/||/;, and checked per segment with command/argument position respected — so sudo in a comment or quoted string never false-positives, while flags are caught in any order (rm -fr, rm --force, "FOO=1 sudo x").

  • High (unrecoverable): pipe-into-shell (curl … | sh), fork bombs, sudo, recursive/forced deletes, find -delete / -exec rm / xargs rm, destructive git (reset --hard, push --force, clean -f), raw disk tools (dd of=, mkfs*, diskutil erase*, cryptsetup), power ops, infrastructure teardown (kubectl delete, terraform destroy), writes to /dev/*.
  • Medium (scoped or recoverable): plain rm, sed -i, kill -9, mv/cp -f, chmod -R 777, git checkout ., unparseable commands.
  • Never flagged: routine git (add/commit/push/pull/status/…), redirects and plain pipes, package installs, reads.

Approval flow

Risky commands prompt with three choices:

  • Allow once — re-prompts if the same command runs again.
  • Allow similar (session) — medium commands also approve their root (git clean variants pass afterwards); high-severity approvals are exact-command only, so sudo / rm -rf / git push --force never auto-widen.
  • Abort — blocks the command and revokes prior approvals for it.

Retry-loop protection auto-blocks a command that was just aborted. Approvals are in-memory only. The footer shows ·N while the current turn has approvals.

Subagents & headless sessions

Spawned subagents (PI_SUBAGENT_DEPTH >= 1) have no one to ask: only catastrophic (high-severity) operations are hard-blocked there. Non-interactive main sessions (print mode) also have no one to ask, so ask mode blocks all risky commands outright there (same as strict).

Protected paths

Writes to these paths are hard-blocked in all modes (and always in strict/ask): .env*, .git/, node_modules/, .ssh/, .aws/credentials, .pi/agent/auth.json, id_rsa, id_ed25519, id_ecdsa, credentials.json, and anything matching secrets.

Legibility

Blocked command reasons are shown in a preview dialog; the full reason is always available in the transcript (viewable with Ctrl+O).

Security

Pi extensions run with your user permissions. This gate is a guardrail, not an operating-system sandbox. It cannot prove arbitrary shell commands are safe.

License

MIT. Uses shell-quote (MIT).