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

@0xkobold/pi-secret-guardian

v0.1.0

Published

Secret detection and pi-share-hf integration for pi-coding-agent. Scans projects, sessions, and environment for secrets, syncs to pi-share-hf workspace, and manages the collection/upload pipeline.

Readme

🛡️ pi-secret-guardian

Secret detection and pi-share-hf integration for pi.

Part of the 0xKobold ecosystem.

What it does

  • Scans project files, pi sessions, and environment for secrets (API keys, tokens, passwords)
  • Runs TruffleHog for verified secret detection as a backstop
  • Syncs discovered secrets to pi-share-hf's secrets.txt for deterministic redaction
  • Patches pi-share-hf to load pi-ollama during LLM review (patches --no-extensions)
  • Manages the full collect → review → upload pipeline

Installation

Bundled (recommended)

pi install npm:@0xkobold/pi-kobold
# pi-secret-guardian loaded as sub-extension automatically

Standalone

pi install npm:@0xkobold/pi-secret-guardian

# Or in pi-config.ts
{
  extensions: [
    'npm:@0xkobold/pi-secret-guardian'
  ]
}

# Or temporary (testing)
pi -e npm:@0xkobold/pi-secret-guardian

External dependencies

# TruffleHog (required for verified secret detection)
brew install trufflehog

# pi-share-hf (required for HF sync/upload)
npm install -g pi-share-hf

Tools

| Tool | Description | |------|-------------| | secret_scan | Scan project/sessions/env for secrets (pattern + TruffleHog) | | secret_sync_hf | Sync secrets to pi-share-hf workspace + run collect | | secret_report | Report on pi-share-hf workspace status | | secret_upload | Upload reviewed sessions to HuggingFace |

Commands

| Command | Description | |---------|-------------| | /secret-scan | Quick scan for secrets | | /hf-status | Show pi-share-hf workspace status |

Usage

1. Scan for secrets

Run secret_scan with scope=all and includeTruffleHog=true

2. Sync and collect

Run secret_sync_hf to sync secrets and run pi-share-hf collect

3. Review and upload

Run secret_report to check uploadable sessions
Run secret_upload to upload to HuggingFace

API / Library Usage

Types and utility functions are available for programmatic use:

// Import from shared module (recommended)
import {
  type SecretFinding,
  type TruffleHogFinding,
  type ScanResult,
  maskSecret,
  parseEnvFile,
  parseNpmrc,
  scanWithPatterns,
  SECRET_PATTERNS,
  ENV_FILES,
} from "@0xkobold/pi-secret-guardian/shared";

// Or from the main entry (convenience re-exports)
import { maskSecret, type SecretFinding } from "@0xkobold/pi-secret-guardian";

// Mask a secret for safe display
maskSecret("ghp_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");
// → "ghp_****890"

// Parse an .env file for secrets
const findings = parseEnvFile(envContent, "/path/to/.env");

// Scan content against known patterns
const patternHits = scanWithPatterns(sourceCode, "/path/to/file.ts", "project-file");

pi-share-hf Ollama Patch

pi-share-hf's LLM review subprocess uses pi --no-extensions, which prevents pi-ollama from loading. This extension includes a patch script that adds -e <pi-ollama-path> after --no-extensions so the review can use your ollama models.

The patch is applied automatically by secret_sync_hf. To apply manually:

bash packages/pi-secret-guardian/scripts/pi-share-hf-patch.sh

Re-run after any npm update -g pi-share-hf.

Configuration

| File | Purpose | |------|---------| | .pi/hf-sessions/secrets.txt | Auto-managed list of secrets to redact | | .pi/hf-sessions/deny.txt | Regex patterns to reject sessions | | .pi/hf-sessions/workspace.json | pi-share-hf workspace config |

Architecture

src/
├── index.ts    # Extension factory (4 tools + 2 commands + lifecycle hooks)
└── shared.ts   # Types, patterns, and utility functions (library API)
scripts/
└── pi-share-hf-patch.sh  # Patches pi-share-hf for ollama support

Integrated into pi-kobold as a sub-extension with duplicate-load guard.

Related Packages

Local Development

git clone https://github.com/0xKobold/pi-secret-guardian
cd pi-secret-guardian
npm install
npm run build
pi install ./

License

MIT © 0xKobold