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

@sagmans/pi-history

v0.1.8

Published

Ghost completion for prompt history in pi's TUI

Readme

pi-history

Ghost completion for prompt history across pi sessions.

pi-history records your real prompts. Two isolation levels — project (default: one history per project) and global (one history shared by all projects in the active Pi profile) — configured under <Pi agent directory>/pi-history/ (normally ~/.pi/agent/pi-history/).

Features

  • Captures TUI input; skips extension-injected messages and blank prompts; preserves multiline text.
  • Caps each project at maxEntries; exact duplicates move to newest instead of storing copies.
  • /pi-history status — metadata only. /pi-history clear — confirms, then wipes and records a clear marker.
  • Ctrl+R — fuzzy reverse search; Enter replaces the buffer, Escape restores the draft.
  • Ghost completion (best effort): dim prefix-match suffix, Ctrl+E accepts all, Alt+Right accepts the next word. Degrades gracefully when editor support is missing.

Install

pi install npm:@sagmans/pi-history

Install from npm so pi only offers updates after a published release.

Existing pi-history installs do not switch npm identities automatically. Migrate once:

pi remove npm:pi-history
pi install npm:@sagmans/pi-history

The package rename does not move or rewrite configuration or prompt history under ~/.pi/agent/pi-history/. Do not install both npm identities at once.

Supported environments

| Component | Supported | | --- | --- | | OS | macOS (primary), Linux. Windows unsupported (POSIX permissions, symlinks). | | Node.js | >=22.19.0 (CI tests 22.19.0 and 24) | | pi | >=0.80.x, tested at 0.85.1 | | Terminal | tested under herdr and standard macOS terminals | | Mode | TUI only. RPC, JSON, and print are inert. |

Configuration

{ "maxEntries": 2000, "isolationLevel": "project" }

User config lives in the active Pi profile's data directory (<Pi agent directory>/pi-history/), not the installed package, so it survives pi update. Precedence (lowest → highest): built-in defaults → shipped config.json → config.json → config.local.json. The highest file that mentions an option wins; an invalid value falls back to the default with a warning.

Profile isolation and upgrade migration

Each PI_CODING_AGENT_DIR profile has separate configuration and history. On the first TUI start after upgrading, pi-history freezes recognized files from the former default location into a versioned migration snapshot. A profile with no existing pi-history/ directory imports that frozen snapshot; any existing target, including an empty directory, wins unchanged. Interrupted owned migration work resumes from private claims without replacing concurrent files.

The snapshot can contain pre-upgrade history previously mixed across profiles, and each import creates another private copy. To stop future imports, remove only ~/.pi/agent/pi-history-profile-migration-v1/snapshot/; retain the bundle and .complete marker so current default-profile data is never snapshotted again. Details: docs/adr/0002-profile-storage-migration.md.

Diagnostics

/pi-history status prints one versioned, privacy-safe line, e.g. pi-history: diagnosticsVersion=2; state=healthy; initialization=ready; storage=ready; editor=ready; entries=12; cap=2000; scope=project. Full field reference: docs/diagnostics.md.

Documentation

License

MIT · Security · Report bugs · Releases