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-rust-cli-tools

v0.1.4

Published

Pi extension that detects which modern CLI tools are installed (rg, fd, lsd, eza, ...), tells the agent, and rewrites grep -r, find -name and ls -l to rg, fd and lsd before they run.

Readme

pi-rust-cli-tools

npm CI License: MIT Audit Fuzz

A pi extension that steers the agent to fast modern CLI tools (rg, fd, lsd, ...) only when they are installed.

What it does

  1. Detects which of rg fd bat lsd eza sd dust procs hyperfine tokei delta difft jq just rtk are on PATH (once per session).
  2. Tells the agent which are installed, in a few lines of the system prompt.
  3. Rewrites a bash call that has an installed replacement, before it runs, so the agent never pays for a retry:

| Agent runs | Runs instead | Needs | |---|---|---| | grep -rn foo src (also -R, --recursive, egrep, fgrep) | rg -n foo src | rg | | find . -name '*.ts' -type f (also -iname, -maxdepth, -mindepth) | fd -t f -g '*.ts' . | fd | | ls -la src | lsd -la src | lsd |

Details that keep the meaning intact:

  • rg and fd skip hidden and git-ignored files, grep -r and find do not. That is the point (no node_modules, no target/), but search an ignored path with /rust-cli-tools mode off or grep off.

  • grep flags map one to one (-i -w -l -c -v -F -P -o -q, -A/-B/-C N, -m N, -e, -f, --include/--exclude/--exclude-dir to -g), -n is added so the output has line numbers, and a path is always named (rg would read stdin otherwise).

  • Only the command is rewritten: quotes, redirections, pipes, cd x && and the rest of the line stay as they were.

  • A basic regex (grep without -E) is spelled for rg: grep -rn 'fn main()' becomes rg -n 'fn main\(\)', since ( ) + ? | { } are plain characters to grep and operators to rg. -x/--line-regexp maps to -x.

  • What cannot be said the same way (a GNU regex like \(a\|b\), a back-reference, patterns from -f in a basic regex, find -o, -path, an unknown flag) is blocked with a hint instead, and the agent retries by hand.

  • Plain ls, du, ps, grep without -r, find -exec/-delete/-mtime/... and anything inside a quote, a heredoc or $(...) are left alone. ls -l | wc -l is left alone too (ls -l prints a total line).

Modes and settings

| Command | | |---|---| | /rust-cli-tools status | settings, installed tools, how many commands were rewritten | | /rust-cli-tools mode [rewrite\|block\|hint\|off] | rewrite (default) runs the modern tool; block refuses with a hint; hint only tells the model; off does nothing | | /rust-cli-tools on / off | the same as mode rewrite / mode off | | /rust-cli-tools [grep\|find\|ls] [on\|off] | switch one rule |

Settings are saved in <agent dir>/rust-cli-tools.json (the agent dir is PI_CODING_AGENT_DIR, then $XDG_CONFIG_HOME/pi/agent, then ~/.pi/agent). The status line shows cli: N rewritten.

Works together with pi-squeeze: this plugin decides which command runs, pi-squeeze shrinks its output (rg -n, fd and lsd -l results are compacted).

Install

pi install npm:pi-rust-cli-tools

Install the tools themselves, for example: brew install ripgrep fd lsd.

Development

bun install
just check   # typecheck + tests (95% coverage gate) + pack check + nu script tests

Releases run in CI: Actions → Release → Run workflow with a bump (patch, minor, major), or just release-ci minor. The workflow runs the quality gate, bumps package.json, regenerates CHANGELOG.md with git-cliff, commits, tags, pushes and publishes to npm (secret NPM_TOKEN).

License

MIT