@dreki-gg/pi-ask-mode
v0.3.3
Published
Read-only ask mode for pi — restricts tools to read-only operations, blocking file creation, editing, and deletion
Readme
@dreki-gg/pi-ask-mode
Read-only ask mode for pi. Toggle with /ask — pi can read, search, and answer but cannot create, edit, or delete files.
Install
pi install npm:@dreki-gg/pi-ask-modeUsage
| Feature | Name | Notes |
|---|---|---|
| Flag | --ask | Start pi in ask mode |
| Command | /ask | Toggle ask mode on/off |
| Shortcut | Ctrl+Alt+A | Toggle ask mode |
Start in ask mode:
pi --askToggle inside pi:
/askEnter ask mode and send a prompt in one step:
/ask How does authentication work in this codebase?Run /ask again to exit ask mode.
Allowed
read— Read file contentsbash— Read-only commands only (ls,grep,cat,git status,git log, etc.)grep— Search file contentsfind— Find files by patternls— List directories
Blocked
edit— File editingwrite— File creation/overwriting- Destructive bash commands —
rm,mv,cp,mkdir,git commit,git push,npm install, redirects, editors, and similar commands
How it works
Ask mode uses two layers of protection:
- Tool whitelist — Only read-only tools are exposed to the LLM via
setActiveTools(). - Defense-in-depth — A
tool_callhandler blocksedit,write, and destructive bash commands even if the LLM somehow attempts them.
Ask mode has no end-of-turn menu and creates no .plans/ files. It stays active until you run /ask again.
State persists across session restarts and tree navigation.
Difference from pi-modes
@dreki-gg/pi-modes provides configurable presets that can also restrict tools. Use pi-modes if you want multiple configurable modes with model/thinking presets. Use pi-ask-mode if you just want a simple dedicated read-only toggle.
