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

@paulcynic/pi-uv-redirect

v0.2.0

Published

Redirect Python tooling to uv inside pi's powershell tool, before the command reaches PowerShell.

Readme

pi-uv-redirect

A pi extension that sits in front of pi's built-in powershell tool and redirects Python tooling to uv before the command reaches PowerShell.

It is a Windows port of mitsuhiko's uv.ts. That extension wraps the bash tool to prepend PATH shims and a spawnHook — which doesn't work on this stack, because the powershell tool owns a spawn layer a companion extension cannot reach. See docs/adr/0001-intercept-at-tool-call-in-front-of-pi-pwsh.md for why this extension intercepts at pi's tool_call event instead.

What it does

  • Block-with-guidance for pip/pip3/poetry and for python -m pip / python -m venv / python -m py_compile (and python3 …). The tool call is refused and the model is told the uv equivalent, so it re-issues the corrected command.
  • Silent redirect for bare python/python3 running a script → rewritten to uv run python … in place, before execution.
  • Matcher uses PowerShell's own System.Management.Automation.Language.Parser to find command-position names, so here-strings, single-quoted strings, and array literals are not mistaken for commands. A cheap JS pre-filter skips polling the parser for commands that don't mention Python at all.

Scope (the contract)

Only python/python3/pip/pip3/poetry appearing as a command-position CommandAst at the top parse surface of the powershell command string are intercepted. The following are accepted leaks and serve as the deliberate escape hatch (see CONTEXT.md, Top-parse-surface scope):

  • explicit interpreter paths (.\.venv\Scripts\python.exe …),
  • the Windows py launcher (any form),
  • bare names buried inside strings re-evaluated by another command (Invoke-Expression "python x", Start-Pty -Command, runtime-built script blocks).

uv … invocations already written by the model are left alone (no double redirect, no uv pip mis-block).

Failure mode (fail open)

If the parser pass fails by infrastructure error (spawn failure, non-zero exit, invalid JSON, or a 4s timeout), the command passes through unmodified and the user gets a transient notification; the model is not told. Syntax errors in the user's command pass silently — powershell will surface them at execution time.

Latency note: each command that passes the pre-filter (mentions python/pip/poetry) pays one pwsh spawn (~700ms steady-state, ~2.3s cold first spawn per session). Non-Python commands pay nothing (the pre-filter skips the parse). This is the cost of using PowerShell's real parser instead of a regex.

Requirements

  • pi's built-in powershell tool active (ships with pi on Windows). If it isn't active, this extension is inert and tells you once on session start.
  • pwsh (PowerShell 7+) on PATH for the parser pass.

Install

With pi:

pi install npm:@paulcynic/pi-uv-redirect

Or from source:

pi install git:github.com/Paul-Yuchao-Dong/pi-uv-redirect

Or symlink/copy into ~/.pi/agent/extensions/.

License

MIT