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

@bytetrue/pi-background-terminal

v0.6.0

Published

Pi extension: run a shell command in the background, check on it, stop it, get notified when it finishes. Also gives the built-in bash/powershell tools a default timeout without overriding them.

Readme

Pi's built-in bash is the right tool for commands that finish during the current call. This extension adds two things on top of it—without overriding any built-in tool:

  • a separate background path for dev servers, watch mode, and long-running work; and
  • a default 10-minute timeout for built-in bash/powershell calls that do not pass one.

Install

pi install npm:@bytetrue/pi-background-terminal

Restart or reload Pi, then ask naturally:

Start the development server in the background.

The Agent starts the command, returns immediately, and receives a follow-up when the process exits on its own. Completions that pile up while the Agent is busy arrive as one batched follow-up, not one turn per task.

Tools

| Tool | Required input | Result | | --- | --- | --- | | background_run | command | Starts a command and returns a task id plus output-file path | | background_status | id | Returns status, exit code, line count, output path, and recent output | | background_kill | id | Stops a running task |

All three schemas contain required parameters only. There are no timeout, working-directory, environment, list, or pagination arguments.

Default shell timeout

Pi's built-in bash (and powershell on Windows) runs with no timeout at all unless the model passes one—which means a single runaway foreground command (find /, a wedged build) can hang the agent for hours.

This extension listens to Pi's tool_call event and injects timeout: 600 into shell tool calls that did not pass their own:

  • the model explicitly passing timeout is respected as-is;
  • background tasks (background_run) are not affected—they are supposed to run long;
  • the built-in tools themselves are never overridden or re-registered.

[!NOTE] Full stdout and stderr stream to the output file returned by background_run. The Agent uses Pi's built-in read tool when it needs more than the recent preview.

Manage tasks yourself

Run /background to open the human-facing task menu. It lists running tasks for the current session and lets you inspect their output or stop them with confirmation.

The footer shows bg:N while tasks are running.

Lifecycle

A task ends when:

  • the command exits;
  • background_kill stops it; or
  • the owning Pi session shuts down.

Natural completion wakes an idle Agent. Manual stops and session cleanup are silent. Tasks survive /reload inside the same session, but they do not survive Pi exiting.

Output is stored under $TMPDIR/pi-background-terminal/ and removed at real session shutdown. Tasks are isolated by session id.

Deliberate limits

  • No PTY or interactive stdin
  • No custom cwd or environment input
  • No configurable default timeout value (600 seconds is fixed)
  • No daemon, tmux dependency, Web UI, or cross-session persistence
  • No replacement for Pi's built-in bash or read

Development

npm --workspace @bytetrue/pi-background-terminal test
npm --workspace @bytetrue/pi-background-terminal run typecheck
npm --workspace @bytetrue/pi-background-terminal pack --dry-run

Requires @earendil-works/pi-coding-agent >=0.80.4.