pi-history
Ghost completion for prompt history in pi's TUI
Package details
Install pi-history from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-history- Package
pi-history- Version
0.1.2- Published
- Jul 23, 2026
- Downloads
- 113/mo · 113/wk
- Author
- assagman
- License
- MIT
- Types
- extension
- Size
- 75.3 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
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 host-wide history) —
configured under ~/.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+Eaccepts all,Alt+Rightaccepts the next word. Degrades gracefully when editor support is missing.
Install
pi install npm:pi-history
Install from npm so pi only offers updates after a published release.
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.81.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 data directory (~/.pi/agent/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.
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
docs/diagnostics.md—/pi-history statusfield referencedocs/maintainer-development.md— maintainer setup, commands, hooksdocs/maintainer-smoke.md— disposable Herdr smoke testdocs/adr/— architecture decision recordsCONTEXT.md— domain languageCONTRIBUTING.md— participation policy & bug reportsSECURITY.md— vulnerability reportingRELEASE.md— release policyCHANGELOG.md— version history
License
MIT · Security · Report bugs · Releases