pi-quit-aliases
pi extension: /exit slash command + bare exit/quit/:q aliases for /quit
Package details
Install pi-quit-aliases from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-quit-aliases- Package
pi-quit-aliases- Version
0.1.1- Published
- Jul 31, 2026
- Downloads
- 308/mo · 11/wk
- Author
- ymy88
- License
- MIT
- Types
- extension
- Size
- 5.9 KB
- Dependencies
- 0 dependencies · 1 peer
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
quit-aliases
A tiny pi extension that adds more ways to exit.
Triggers
| Input | When it exits |
|---|---|
/exit |
Slash command (appears in / autocomplete + command list) |
exit |
Bare word, exact match (trimmed, case-insensitive) |
quit |
Bare word, exact match |
:q |
Bare word, exact match |
/quit (pi's built-in) is untouched and still works.
All four triggers call ctx.shutdown() — pi's documented graceful shutdown, available in all contexts (event handlers, tools, commands, shortcuts).
Matching rules (bare words)
- The whole input must equal the trigger word, after trimming and lowercasing. So
Exit,QUIT,:Qall exit;exit now,please quit,just :q itdo not exit (they go to the agent as normal messages). - Option B — any time: works even while the agent is generating. The shutdown aborts the in-flight stream gracefully.
event.source === "extension"is skipped, so another extension callingsendUserMessage("exit")cannot accidentally trigger an exit.
How it works
Two hooks:
pi.registerCommand("exit", …)— registers/exit. No built-in/exitexists, so it registers cleanly (no/exit:1//exit:2suffix). Its handler callsctx.shutdown().pi.on("input", …)— catches the bare words. Theinputevent fires after the slash-command check (so bare words with no/reach it) and before skill/template expansion. On a match it callsctx.shutdown()and returns{ action: "handled" }so the word is never sent to the agent.
Install
Install from npm (global, auto-discovered):
pi install npm:pi-quit-aliases
Project-local (writes to .pi/settings.json, shared with your team):
pi install -l npm:pi-quit-aliases
Or install from git:
pi install git:github.com/ymy88/pi-quit-aliases
Then in pi: run /reload (or restart pi) to load it.
Verify
After /reload:
/exit→ exitsexit,quit,:q,Exit,QUIT→ each exitsexit now→ does not exit (goes to the agent)/quit→ still exits (built-in, untouched)