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

@spences10/pi-redact

v0.0.15

Published

Tool-output redaction for Pi that replaces likely secrets before they reach the model context

Readme

@spences10/pi-redact

built with Vite+ tested with Vitest npm version license

my-pi package preview

Prevent accidental secret exposure before tool output reaches the model. pi-redact scans command results for likely tokens, keys, and credentials, replacing them with safe placeholders while preserving enough context to debug.

Installation

pi install npm:@spences10/pi-redact

Local development from this monorepo:

pnpm --filter @spences10/pi-redact run build
pi install ./packages/pi-redact
# or for one run only
pi -e ./packages/pi-redact

What it does

@spences10/pi-redact filters Pi tool_result content and direct ! shell output before it is added to model context. It is intended as a last-mile safety net for accidental secrets in command output, file reads, logs, and config files.

It currently detects and redacts:

  • quoted JSON and unquoted environment/config fields with sensitive names such as password, client_secret, access_token, and api_key, including lowercase prefixed TOML assignments and values containing shell punctuation
  • GitHub, GitLab, Slack, npm, Google, SendGrid, JWT, and common vendor-prefixed tokens
  • AWS credentials, bearer tokens, and connection strings with embedded credentials
  • private-key blocks and partial private-key reads; sequential read chunks for the same path remain redacted after a private-key header
  • SSH config metadata such as Host, HostName, User, IdentityFile, ProxyJump, and forwarding directives

Redactions preserve a short prefix where helpful and append a marker such as [REDACTED:GitHub Token].

Commands

/redact-stats

Shows how many values were redacted in the current Pi session.

/redact-stats

Example

If a tool returns:

GITHUB_TOKEN=ghp_abcdefghijklmnopqrstuvwxyz1234567890

The model receives something like:

GITH********************[REDACTED:GitHub Token]

Using from a custom harness

import redact from '@spences10/pi-redact';

// pass `redact` as an ExtensionFactory to your Pi runtime

my-pi imports this package directly and enables it as the built-in filter-output extension.

Limitations

This extension is defensive, not a guarantee. It can miss novel secret formats, dynamically assembled values, and chunks that begin midway through a secret without prior context. It intentionally does not blanket-redact unlabelled base64, compressed, encrypted, or other high-entropy output because source archives, hashes, and build artifacts commonly have the same shape. Broad patterns can also occasionally redact benign values. Direct ! output is filtered from the transient model context, but Pi currently persists the original shell output in its session transcript before context filters run.

Use proper secret hygiene as the primary control:

  • do not print or encode secrets unnecessarily
  • avoid reading .env files into model context; prefer nopeek for secret-safe environment loading
  • prefer scoped, revocable tokens
  • rotate anything that may have been exposed

Development

Package scripts build transitive workspace dependencies first, then run local tools through Vite+ with vp exec.

pnpm --filter @spences10/pi-redact run check
pnpm --filter @spences10/pi-redact run test
pnpm --filter @spences10/pi-redact run build

License

MIT