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

@yceachan/pi-gadget

v0.3.0

Published

pi extension collection: /clear session archiving, /exit, and WSL-path links for Windows Terminal

Readme

pi-gadget

A small collection of single-file pi extensions — handy gadgets, each living in one file:

  • /clear — archive the current session (moves it out of the way while keeping it resumable)
  • /exit — exit pi cleanly
  • pi-cite-wslpath — tool for the model: converts native (WSL) paths into Windows-Terminal-openable markdown hyperlinks, because file:///home/... / file:///mnt/c/... links are rejected by Windows Terminal. Takes a paths[] batch in one call; an agent_end hook force-checks every delivered reply for un-converted links and posts a clickable report (detect-and-tell)

Install

pi install npm:@yceachan/pi-gadget

Usage

Run /clear to archive the active session, /exit to quit pi. Both commands are plain slash-command extensions; see the source files for exact behavior.

pi-cite-wslpath is a tool the model calls to cite file paths clickable in Windows Terminal (Ctrl+click). Conversion rules: /mnt/<drive>/...file:///<DRIVE>:/..., other Linux paths → file://wsl.localhost/<distro>/... (Windows Terminal ≥ 1.17). Outside WSL it falls back to the standard file:// URI.

The tool takes a paths array (one or more native paths) and returns exactly one markdown link per path ([label](uri)), which the model pastes verbatim into its reply — pi's Markdown renderer turns it into an OSC 8 hyperlink, so it stays clickable at any terminal width (the URL is hidden on screen and the terminal reconstructs the link across soft wraps). Raw OSC 8 sequences and bare URIs are deliberately not returned: a bare URI is long, wraps on narrow screens, and Windows Terminal's URL auto-detection cannot join the fragments. Each path is verified to exist on disk; a missing path gets a ! not found line so a misspelled filename is caught at cite time, before the link is delivered.

On agent_end the extension force-checks the delivered assistant text for file:// URIs Windows Terminal would reject (empty-host file:///... or file://localhost with a non-drive first segment, i.e. Linux-side paths). When any leaked, it reports rather than rewrites, delivering on agent_settled (the moment the run is fully settled — sending during agent_end would otherwise be queued by pi as a steering message): a one-line notify summary plus a chat custom message (>[!note] pi-cite-wslpath auto trans: with the converted markdown links) rendered by the same Markdown → OSC 8 pipeline as the chat body, so every link is clickable regardless of terminal width. Quoted examples are skipped (code spans, fenced code blocks, and ... ellipsis forms), so citing the guideline text itself does not trip the check.

Configuration

Each gadget is enabled by default. Disable one in the user or project config:

{
  "pi-cite-wslpath": { "status": "disabled" }
}

Configuration layers are merged from low to high priority:

<package>/config.json
$PI_AGENT_DIR/pi-gadget/config.json      (or $PI_CODING_AGENT_DIR; default: ~/.pi/agent/pi-gadget/config.json)
$CWD/.pi/pi-gadget/config.json

The keys are pi-clear, pi-exit, and pi-cite-wslpath. A project setting overrides the user setting for the same key; omitted keys keep the lower-layer value. Changes take effect after /reload.

Use /gadgets to manage the current project's overrides:

/gadgets list
/gadgets enable pi-cite-wslpath
/gadgets disable pi-cite-wslpath
/gadgets enable --global pi-cite-wslpath
/gadgets disable --global pi-cite-wslpath

enable and disable update $CWD/.pi/pi-gadget/config.json and reload the extensions. With --global, the command updates the agent directory config; when the current project already has a config file, it updates that file too so the project override does not mask the global setting. If the project config is absent, it is left absent. The management command remains available while individual gadgets are disabled.

License

MIT