@ravshansbox/pi-prompt-history

Shell-style prompt history extension for pi

Packages

Package details

extension

Install @ravshansbox/pi-prompt-history from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@ravshansbox/pi-prompt-history
Package
@ravshansbox/pi-prompt-history
Version
0.2.1
Published
Oct 16, 2026
Downloads
249/mo · 249/wk
Author
ravshansbox
License
MIT
Types
extension
Size
18 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-prompt-history

Shell-style prompt history extension for pi.

Install

pi install npm:@ravshansbox/pi-prompt-history

Add -l to install it in project settings.

Usage

When pi starts, this extension loads the user prompts from your previous sessions in the current working directory and seeds them into the editor's history. It only activates in interactive (TUI) mode.

  • Up / Down — recall the previous / next prompt (when the cursor is at the top / bottom of the editor, exactly like bash/zsh)
  • Ctrl+R — reverse search: an incremental, fuzzy picker over your past prompts. Type to filter, Up/Down to move, Tab to switch between current-folder and all-folder history, Enter to load the prompt into the editor, Esc to cancel. If the editor already contains text, Ctrl+R uses it as the initial search query.

Behaviour

  • Scope: Up/Down recall and the default Ctrl+R tab use sessions started in the current folder (via SessionManager.list(cwd)). Ctrl+R also has an All folders tab backed by SessionManager.listAll().
  • Filtering: empty input, slash-commands (/...), and inline bash (!, !!) are skipped, matching shell history hygiene.
  • De-duplication: global — repeated prompts collapse to their most recent position.
  • Ordering: chronological, so the first Up press recalls your newest prompt.
  • Limits: each reverse search scope covers up to the 500 most recent unique prompts. Up/Down uses pi's built-in history ring, which keeps the most recent ~100 prompts plus anything you type during the session.
  • New prompts you submit during the session are added to history immediately.

Development

npm install
npm run check