pi-stash
v0.2.0
Published
Pi extension that stashes the current editor draft with Alt+S
Maintainers
Readme
pi-stash
A pi extension that temporarily stashes the current editor draft with a keyboard shortcut. Inspired by Claude Code.
Install
pi install npm:pi-stashOr from GitHub:
pi install git:github.com/maxpetretta/pi-stashUsage
Press Alt+S while typing a prompt to stash the current editor contents into:
.pi/stash.mdWhen you do that, pi-stash:
- saves the current draft
- clears the editor
- waits for your next prompt submission
- automatically restores the stashed draft into the editor right after that prompt is sent
If the editor is empty, pressing Alt+S again will immediately restore the pending stashed prompt instead.
This is useful when you want to quickly shelve one prompt, send another one first, and then continue where you left off.
Configuring the shortcut
pi-stash reads its shortcut from ~/.pi/agent/keybindings.json at startup. If pi-stash.shortcut is not set, it defaults to Alt+S.
Note: pi-stash.shortcut is a custom extension-owned key that pi-stash reads itself at startup. It is not a built-in pi action id.
Example:
{
"pi-stash.shortcut": ["ctrl+s"],
"app.session.toggleSort": ["alt+s"]
}You can also use a single string instead of an array:
{
"pi-stash.shortcut": "ctrl+s"
}If you remap pi-stash to Ctrl+S, also rebind pi's built-in session sort toggle off of Ctrl+S to avoid the shortcut conflict warning. After editing keybindings.json, run /reload in pi.
Development
This package uses Bun for local development.
bun install
bun run lint
bun run typecheck
bun run testLicense
MIT
