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-docker-sandbox

v1.0.0

Published

Lightweight Docker sandbox for pi coding agent

Readme

pi-docker-sandbox

Lightweight Docker sandbox for the pi coding agent.

Default: complete isolation. No network, no host filesystem. The agent runs in an empty container with Chromium, Playwright, Node 22, git, and essential CLI tools.

Quick start

# Install the extension
pi install npm:pi-docker-sandbox

# Build the sandbox image (once)
docker build -t agent-sandbox:latest .

# Start pi — sandbox is on by default
pi

Flags

| Flag | Default | Purpose | |------|---------|---------| | --no-sandbox | — | Disable sandbox entirely | | --sandbox-network | off | Allow outbound network (enables browser tool) | | --sandbox-mount-cwd | off | Mount the project at /workspace (rw) | | --sandbox-mount-skills | off | Mount agent skill directories at /skills (ro) | | --sandbox-mount-ssh | off | Forward $SSH_AUTH_SOCK for git over SSH | | --sandbox-memory | 4g | Memory limit | | --sandbox-cpus | 2 | CPU limit | | --sandbox-name | auto | Reusable container name |

Commands

| Command | Purpose | |---------|---------| | /sandbox | Show container status, flags, and resource usage | | /sandbox doctor | Verify tools inside the container | | /sandbox stop | Stop the sandbox container | | /sandbox restart | Restart the sandbox container | | /sandbox rebuild | Rebuild the sandbox Docker image | | /sandbox prune | Remove all stopped pi-agent-* containers | | /sandbox network on\|off | Toggle outbound network access | | /sandbox ssh on\|off | Toggle SSH agent forwarding | | /sandbox cwd on\|off | Toggle project CWD mount | | /sandbox skills on\|off | Toggle skill directory mounts |

Toggles (network, ssh, cwd, skills) persist across reloads and require a container restart to take effect.

Architecture

pi starts
  └─ session_start → SandboxManager.start()
       ├─ docker run agent-sandbox:latest
       ├─ Proxy read/write/edit/bash via docker exec
       ├─ Inject system prompt with sandbox state
       └─ Register cleanup on SIGINT/SIGTERM/exit
  └─ session_shutdown → SandboxManager.stop()

Module structure

| Module | Responsibility | |--------|---------------| | types.ts | Interfaces: DockerClient, FileStore, SandboxHandle, UIContext, … | | docker.ts | Docker CLI abstraction (q, createRealDockerClient, stopSync) | | path-translation.ts | toRemote() — host→container path mapping | | prompt.ts | buildSystemPrompt() — sandbox status for agent system prompt | | toggles.ts | ToggleStore — persisted feature toggles (survives ctx.reload()) | | sandbox.ts | SandboxManager — container lifecycle, exec, path translation | | tools.ts | createReadOps, createWriteOps, createBashOps — tool adapters | | commands.ts | /sandbox subcommand routing (handleSandboxCommand) | | index.ts | Extension entry point — flags, tool registration, event wiring |

Image contents

  • Chromium (system package) + Playwright (preconfigured, no browser download)
  • Node 22 LTS (from node:22-bookworm-slim)
  • git, curl, jq, ripgrep, fd, openssh-client
  • Non-root node user (uid 1000)

Companion extensions

For a complete web research setup, pair this sandbox with:

All three run inside the sandbox when network is enabled (--sandbox-network).

Development

# Install dependencies
npm install

# Run tests
npm test

# Type check
npx tsc --noEmit