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-restrict-bash

v1.0.4

Published

Opinionated bash tool restrictions for Pi

Downloads

534

Readme

pi-restrict-bash

Opinionated restrictions for Pi’s built-in bash tool.

The extension blocks common “escape hatches”, risky shell features, and context-exploding commands, nudging the agent toward Pi’s structured tools (read, edit, write) and toward using rg (via bash) for searching/listing.

What it does

The extension intercepts tool calls and blocks:

  • Tool calls to grep, find, and ls
  • bash commands that use unsafe shell features (for example command substitution, variable expansion, redirects, background execution, subshell syntax, and control-flow keywords)
  • bash commands that invoke disallowed programs (for example sudo, nested shells like bash/sh/zsh, cat, tee, xargs, nl, fd/find/grep/ls/tree)
  • bash wrapper commands like eval, exec, nohup, and timeout
  • git subcommands that can mutate the working tree or repository (and git grep, since rg is preferred)
  • sed -i / sed --in-place

When a command is blocked, Pi shows a reason string explaining what was denied.

Install

This repo is a Pi package (see package.json#pi.extensions). Once installed, Pi auto-discovers and loads the extension.

Global install (writes to ~/.pi/agent/settings.json):

  • From GitHub:
    • pi install git:github.com/kotarac/pi-restrict-bash
  • From npm:
    • pi install npm:pi-restrict-bash

Project-local install (writes to .pi/settings.json in your project):

  • From GitHub:
    • pi install -l git:github.com/kotarac/pi-restrict-bash
  • From npm:
    • pi install -l npm:pi-restrict-bash

Try without installing

Try the package for a single run:

  • From GitHub:
    • pi -e git:github.com/kotarac/pi-restrict-bash
  • From npm:
    • pi -e npm:pi-restrict-bash

Notes

  • This is not a replacement for proper sandboxing. It only applies guardrails to Pi tool usage and serves as guidance for LLMs; it does not make executing untrusted code safe.
  • You’ll likely want to pair this with system instructions that strongly prefer Pi’s structured tools (read, edit, write), and for searching/listing prefer rg (for example rg, rg --glob, rg --files, rg --files --glob) invoked via the bash tool.
  • Many restrictions are about keeping tool output and shell behavior predictable so it doesn’t explode the LLM context (for example find/ls/tree, pipelines, redirects, and wrapper commands).
  • This extension is intentionally strict. If you need to loosen rules, fork and adjust forbiddenRules / blockedTools in extensions/restrict-bash.ts.
  • Extensions execute with full system permissions. Only install code you trust.

License

GPL-2.0-only