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

@zeldrisho/pi-gate

v0.7.3

Published

Pi extension that gates bash commands and protects its configuration from tool edits

Readme

@zeldrisho/pi-gate

Pi extension that blocks or confirms bash tool calls and protects its configuration from write and edit calls.

Install

pi install npm:@zeldrisho/pi-gate

# Project:
pi install -l npm:@zeldrisho/pi-gate

Use pi config to enable or disable this extension interactively. Run pi list to see configured packages and their install paths.

Configure

Edit ~/.pi/agent/gate.json to choose which commands need approval. The extension creates this file with starter rules when the first session starts. Changes apply before the next gated call, without restarting Pi. Add the optional $schema below for editor completion and validation:

{
  "$schema": "https://raw.githubusercontent.com/zeldrisho/pi-packages/main/packages/pi-gate/config.schema.json",
  "promptTimeoutMs": 30000,
  "operations": {
    "rm -rf": "prompt",
    "sudo": "prompt",
    "sudo apt update": "allow",
    "chmod 777": "block"
  }
}

Rules match command text and have one of three actions:

  • prompt: ask the user to allow or deny;
  • block: deny without asking;
  • allow: explicitly permit matches fully contained within its matching text.

For simple commands, matching is case-insensitive, treats runs of whitespace as a single space, and matches complete words: git checkout does not match git checkout-index. Restrictive flag and numeric patterns retain prefix coverage, so rm -rf still gates rm -rfv and chmod 777 still gates chmod 7777.

Literal arguments to echo and printf, and shell comments, do not trigger unrelated rules: echo sudo does not match sudo. Explicit output rules such as echo sudo still work. An allow suppresses only prompt/block matches fully inside its matching text in the same simple command; otherwise any remaining block wins over prompt. Commands with no match are allowed. Patterns must contain 1–1,024 characters; at most 1,000 valid rules are loaded.

pi-gate is a guard rail, not a sandbox. Complex shell syntax, pipelines, redirects, substitutions, script arguments, or rules containing shell syntax use conservative substring matching and can still prompt on literal text. Generated commands, flag-order variants, and commands run through other tools are not fully understood; keep allow patterns specific. Bash path checks remain textual, so a separate earlier cd ~/.pi/agent followed by echo x > gate.json may not be recognized.

Usage

The built-in bash tool is gated, and write/edit calls targeting the gate config require approval. Prompt dialogs offer Allow and Deny; approvals are never remembered. To stop repeated prompts, add a specific allow rule to gate.json.

The approval dialog highlights the matched command text. Long commands are truncated in the dialog but execute in full if approved. Denials, blocks, dismissals, and timeouts stop the turn; other allowed calls in a parallel batch may still run. In non-interactive modes (-p, JSON), commands requiring approval are denied.

In Herdr-managed panes, install Herdr's Pi integration with herdr integration install pi to report pending approvals as blocked. Herdr is optional.

Configuration notes

  • promptTimeoutMs defaults to 30 seconds and accepts up to one day. Increase it if you need more time to approve calls.
  • Set PI_CODING_AGENT_DIR if your Pi configuration lives outside ~/.pi/agent.
  • Legacy pi-gate.json is used only when gate.json is absent. To migrate, rename it to gate.json; existing files are never overwritten automatically.
  • An unreadable or invalid configuration causes every command to require approval until fixed. If no file exists and one cannot be created, pi-gate warns and allows commands until you create it.

Uninstall

pi remove npm:@zeldrisho/pi-gate

# Project:
pi remove -l npm:@zeldrisho/pi-gate

License

MIT