@raidou/pi-ask-user

Ask-user-question tool for pi: lets the agent present multiple-choice questions to the user.

Packages

Package details

extension

Install @raidou/pi-ask-user from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@raidou/pi-ask-user
Package
@raidou/pi-ask-user
Version
0.2.4
Published
Oct 4, 2026
Downloads
969/mo · 33/wk
Author
raidou1
License
MIT
Types
extension
Size
115.4 KB
Dependencies
1 dependency · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@raidou/pi-ask-user

An pi extension that provides the ask_user_question tool: it lets the coding agent present one or more multiple-choice questions to the user and collect structured answers, with a rich TUI (options list, preview pane, scrolling and tabs).

Install

pi install npm:@raidou/pi-ask-user

Or from a local checkout:

cd path/to/pi-ask-user
pi install .

Subagent support

Subagent sessions can use ask_user_question too. Main and subagent sessions share one extension module instance, and only the real TUI session (ctx.mode === 'tui' && ctx.hasUI) registers as the owner; non-TUI sessions (rpc/print) never steal ownership. When a subagent asks, the tool call blocks while the question UI is rendered in the main TUI session, and the answer is returned to the subagent as the tool result (a "cancelled" result if the user cancels). Asks originating from a subagent are labelled with a subagent badge in the questionnaire UI.

Development

When started with PI_DEMO=1, the extension also registers an /ask-user-demo command that walks through the question UI (/ask-user-demo subagent previews a subagent ask).

pnpm install
pnpm test   # types + lint + unit tests