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-foldable-tools

v0.1.0

Published

Make pi tool blocks foldable and hideable — collapsed summary, full output, or hidden from the transcript. Adds ctrl+q and /tools controls.

Readme

pi-foldable-tools

Make pi tool blocks foldable and hideable.

pi's built-in tool blocks (the green/red "Tool execution box") are always rendered with a full colored shell. The only built-in control, ctrl+o (app.tools.expand), toggles output verbosity — invisible for short outputs and it never collapses the block itself. This extension adds the missing fold / hide capability.

What it does

Re-registers the built-in tools (read, bash, edit, write, grep, find, ls) with renderShell: "self" so the always-on colored box is gone, and adds a 3-state view for completed blocks (running blocks always stream live so you can still see activity):

| Mode | Completed block shows | |------|----------------------| | folded (default) | Compact 2-line card: the call header ($ ls -la / read foo.py) + a one-line status (✓ 3 lines, ✗ exit 127 · 3 lines, +2 -1 for edits) | | expanded | Full output — syntax-highlighted reads & diffs (delegated to the originals) / full text for bash·edit·write | | hidden | Removed from the transcript entirely (0 lines) |

Execution behavior is unchanged: every tool delegates execute to the original built-in tool definition, so reads/edits/bash/grep behave identically. Only the rendering changes.

Controls

  • ctrl+q — cycle folded → expanded → hidden → folded
  • /tools [folded|expanded|hidden] — set directly, or cycle with no arg (use this if your terminal eats ctrl+q)
  • ctrl+o (built-in) — still expands output within folded/expanded modes
  • PI_TOOL_FOLD_MODE env var — default mode on startup (folded (default), expanded, or hidden)

A footer status line (tools: folded) shows the current mode.

Install

pi install npm:pi-foldable-tools

Or from git:

pi install git:github.com/<user>/pi-foldable-tools

Then restart pi (or run /reload).

Notes

  • ctrl+q is a single byte (0x11) that tmux passes through (only ctrl+b is tmux's prefix), so it works inside tmux. If your terminal intercepts ctrl+q (some map it to XON flow control), use the /tools command instead.
  • Rendering for read/grep/find/ls is delegated to the originals (they use a Text-based renderer), preserving syntax highlighting and truncation notes. bash/edit/write use a Container+state renderer that is not safe to delegate, so they are rendered locally as Text.
  • Reading an image file in hidden mode still renders the image (image rendering is owned by the tool component, not the result renderer); the text part is hidden as expected. Rare edge case.

License

MIT