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-windows-nul-fix

v0.1.1

Published

Pi extension that rewrites Windows-style `> nul` redirects to `> /dev/null` before Git Bash runs them, preventing spurious `nul` files on Windows.

Readme

pi-windows-nul-fix

A Pi extension that rewrites Windows-style > nul redirects to > /dev/null before the bash tool runs them, preventing Git Bash from creating literal files named nul on Windows.

The problem

On Windows, Pi runs shell commands through Git Bash (MSYS2). When an LLM emits a command like some-tool --quiet > nul or build.sh 2> nul, Git Bash does not treat nul as a null device — it creates a file literally named nul in the current directory.

Because nul is a reserved device name in Windows, these files are invisible to ls, cannot be opened in most editors, and cannot be deleted with standard tools — only with Remove-Item -LiteralPath '\\?\C:\path\nul' -Force in PowerShell.

The fix

This extension intercepts the bash tool's tool_call event and rewrites every bare > nul, 2> nul, &> nul, >> NUL, etc. to > /dev/null before execution. It tracks single quotes, double quotes, and backslash escapes and does not rewrite filenames like nul.txt or nul-backup.

On non-Windows platforms it is a no-op.

Install

pi install npm:pi-windows-nul-fix

Or install from the git source:

pi install git:github.com/i-snyder/pi-windows-nul-fix

To try without installing:

pi -e npm:pi-windows-nul-fix

What it covers

The extension rewrites redirects that target the bare nul token (case-insensitive) at a redirect boundary. Patterns rewritten:

| Input | Rewritten to | |---|---| | > nul | >/dev/null | | > NUL | >/dev/null | | >> nul | >>/dev/null | | 2> nul | 2>/dev/null | | 2>> nul | 2>>/dev/null | | &> nul | &>/dev/null | | &>> nul | &>>/dev/null |

Patterns left untouched:

  • > nul.txt — filename, not a device reference
  • "foo > nul" — inside a double-quoted string
  • 'foo > nul' — inside a single-quoted string
  • \> nul — escaped redirect operator

Scope and limits

This extension only affects commands invoked by the LLM via the built-in bash tool. It does not affect:

  • Commands you run yourself in the Pi shell (! prefix)
  • Extensions that bypass the built-in bash tool
  • The pi CLI itself

Known limitations

  • Heredoc bodies. The parser rewrites > nul anywhere it appears outside of quotes, including inside heredoc bodies. If the LLM writes a script file using a heredoc that intentionally contains > nul as text content, that text will be rewritten to > /dev/null. This is unlikely in practice but worth knowing.

  • Quoted redirect targets. > "nul" and > 'nul' (where the target itself is quoted) are left untouched by this extension, but Git Bash still creates a literal nul file for them. These forms are uncommon in LLM-generated commands.

  • >& nul. The csh-style combined redirect >& nul is not rewritten. Use &> nul (bash-style) which is what most LLMs emit and is covered.

How it works

Pi's tool_call event fires before each tool executes and exposes event.input as mutable. For bash tool calls, this extension rewrites event.input.command in place using a character-walking parser that tracks quote and escape state before applying a sticky regex against each redirect position.