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-toolcalls

v0.2.0

Published

Hide, compact, or reveal tool-call rows in the pi coding agent TUI. One global tool renderer that covers built-in, extension, and MCP tools.

Readme

pi-toolcalls

Hide, compact, or reveal tool-call rows in the pi coding agent TUI.

一个 全局 工具调用渲染器:对内置工具、扩展工具、MCP 工具一律生效。

为什么

pi 默认会显示每次工具调用(bash、read、web_search…)和它们的输出。对话长了以后, 这些行会淹没真正要看的结果。pi 1.6.0 没有提供隐藏工具调用的设置项 (hideTools 只控制 MCP 工具的暴露方式,与界面无关),所以这里用 pi.registerToolRenderer() 实现。

安装

pi install npm:pi-toolcalls

然后在 pi 里执行 /reload(或重启)。

三种模式

| 模式 | 效果 | | --- | --- | | hidden(默认) | 工具调用行完全不可见,连错误也不显示。用 renderShell: "self" + 空 Container,不会留下带背景的空行 | | compact | 每次调用一行摘要 + 耗时(如 ▸ bash git status · 1.2s);运行中每秒走秒;失败时多一行红字错误;Ctrl+O(或点该行)展开输出 | | native | pi 原生渲染(含输出,Ctrl+O 折叠/展开) |

compact 的耗时取自 pi 记录的 context.durationMs(最终结果才有);老会话里没有该值 时回退到渲染器自己的时钟。

用法

/toolcalls            # 查看当前模式
/toolcalls hidden     # 隐藏(默认)
/toolcalls compact    # 一行摘要
/toolcalls native     # 恢复原生
/toolcalls toggle     # hidden -> compact -> native 循环

模式持久化在 <agentDir>/tool-display.json,默认 <agentDir> 是 ~/.pi/agent。 当前模式会显示在状态栏。

临时覆盖(只对本次运行生效):

PI_TOOL_DISPLAY=compact pi

注意

  • hidden 模式下工具失败也看不见。如果想让错误可见,用 compact。
  • compact 展开的输出上限 400 行 / 40 000 字符,超了会截断并标注。
  • 模式切换立即影响新渲染的行;已经画出来的旧行要等重绘(滚出屏幕再回来,或 /reload)。

开发

仓库里只有 index.ts,pi 用 jiti 直接加载 TypeScript,没有构建步骤。

pi -e ./index.ts        # 用本地副本试跑,不写进 settings

发布

推 v* tag 即可,GitHub Actions 用 OIDC trusted publishing 自动发布, 无需 NPM_TOKEN,并自动生成 provenance:

npm version patch
git push --follow-tags

License

MIT