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

@nicknisi/pi-compact-tools

v0.2.0

Published

Two-line tool displays with native click and Ctrl+O expansion

Readme

pi-compact-tools

Collapse every tool display to a header and one preview line. Press Ctrl+O to expand all tools, or click a tool in Pi's fullscreen mode to expand just that tool.

▸ $ pnpm test
  Test run started … [ctrl+o]

Only the display changes. Tool execution, saved results, images, details, and model context stay untouched. Expanding restores the tool's original renderer, including syntax highlighting, diffs, and custom extension displays.

Install

From a local checkout:

pi install /absolute/path/to/pi-extensions/packages/compact-tools

After publication:

pi install npm:@nicknisi/pi-compact-tools

Restart Pi or run /reload after installation.

Behavior

| Action or state | Display | | ----------------------------- | ----------------------------------------------------------------------------------- | | Before a result arrives | One line using the tool's normal human-readable header | | Streaming or completed result | Header plus one readable preview line | | Multiline output | An ellipsis after the preview | | Success | Both lines use Pi's green toolSuccessBg background | | Running | Both lines use Pi's toolPendingBg background | | Error | Both lines use Pi's red toolErrorBg background, with an explicit Error: preview | | Images | An image count in the preview; pi still draws inline images below the row | | Ctrl+O | Pi's existing expand/collapse toggle for all tools | | Fullscreen left click | Expand one collapsed tool. Click its original header or result to collapse it again |

There is one blank separator before each tool. Long lines truncate to the terminal width rather than wrapping. Built-in, extension, MCP, dynamically registered, and restored tool rows all use the same compact display. Headers reuse the tool's existing renderer, such as read src/index.ts or $ pnpm test. Tools without a custom header show their name and a path, command, query, action, or URL when available. The fallback never dumps JSON arguments or file contents.

Tools start collapsed on session start and reload. The key hint follows your app.tools.expand binding in ~/.pi/agent/keybindings.json. No new tools, commands, shortcuts, widgets, or session entry types are registered.

Configuration

None. The default is two content lines. Use Pi's existing expansion controls when you need more detail.

Dependencies and caveats

  • Pi supplies @earendil-works/pi-coding-agent and @earendil-works/pi-tui as peer dependencies. @nicknisi/pi-shared supplies terminal-label sanitization.
  • Needs Pi 1.0.1 or newer (pi.registerToolRenderer). Regular terminal mode leaves mouse input to terminal scrollback, so use Ctrl+O there.
  • Uses Pi's public pi.registerToolRenderer() hook, wrapping whatever renderer the tool (or a later extension) provides. Rows draw their own shell so collapsed rows stay two lines; expanded rows re-create Pi's default box around the original renderer.
  • Pi draws inline images for a result regardless of the row's renderer, so collapsed rows with images are not fully compact.
  • Previews use the tool's existing result renderer when available, falling back to the first nonempty output line. JSON-only output shows an item or field count instead of serialized data. No model call is made. Custom controls and detailed progress displays are available when expanded.
  • Expanded displays retain each tool's own limits. This extension cannot recover output already truncated by a tool.
  • User shell commands entered with ! or !! use a separate Pi component and are unchanged.

Development

pnpm test -- packages/compact-tools/index.test.ts
pnpm typecheck
pnpm lint