@hheei/pi-ask-user
Interactive ask_user tool for pi-coding-agent: one question or 2-4 in one prompt, multiple choice, multi-select, and freeform answers.
Package details
Install @hheei/pi-ask-user from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@hheei/pi-ask-user- Package
@hheei/pi-ask-user- Version
0.3.0- Published
- Nov 4, 2026
- Downloads
- 517/mo · 517/wk
- Author
- hheei
- License
- MIT
- Types
- extension, skill
- Size
- 105.9 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"skills": [
"./skills"
],
"extensions": [
"dist/index.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@hheei/pi-ask-user
Interactive ask_user tool for pi: one focused question, or 2-4 independent questions in one prompt, with multiple choice, multi-select, and freeform answers.
Forked from edlsh/pi-ask-user at revision df1df70 (v0.17.1). Upstream is MIT licensed; see LICENSE.
What the fork changes
- Ships compiled
dist/throughtscinstead of raw TypeScript, matching the other@hheei/pi-*packages. - Uses the
typeboxpackage instead of@sinclair/typebox. - Tests run on vitest instead of
bun test. - Code conforms to this repo's Biome and
exactOptionalPropertyTypesrules. - Renders only inline: upstream's centered overlay mode, its
displayModeparameter, and the wholeaskUsersettings section are gone, so the prompt always sits in pi's input dock and reportsblockedto the terminal through the host. - Drops upstream's searchable split-pane list, optional comment stage, overlay hide shortcut, review-page scrolling, and
ctrl+j/ctrl+kvim aliases: the prompt now matches pi's own select-list keys. - Drops the upstream
pi-ternnative-presentation integration. Prompts render through pi's own TUI components, and results publish presentation facts that@hheei/pi-ext-uiframes with its 0/1/2 fold levels when it is installed.
Module boundaries, invariants, and the test layout are recorded in
docs/architecture/ask-user.md.
The batch contract is unchanged: context, options, allowMultiple, and allowFreeform belong on each questions entry, never at the top level. Top-level copies are ignored rather than rejected, because strict providers fill every declared property with an empty default. A one-entry questions array is unwrapped and asked as a single question instead of failing.
Install
pi install npm:@hheei/pi-ask-user
Tool
| Parameter | Type | Default | Notes |
|---|---|---|---|
question |
string? |
— | The question. With questions, it is only the batch heading |
questions |
{question, context?, options?, allowMultiple?, allowFreeform?}[]? |
— | 2-4 independent questions, used instead of question |
context |
string? |
— | Summary shown above the question |
options |
{title, description?}[]? |
— | Choices offered to the user |
allowMultiple |
boolean? |
false |
Allow selecting several options |
allowFreeform |
boolean? |
true |
Add a freeform answer row |
timeout_ms |
integer? |
— | Auto-dismiss after N milliseconds; the result is cancelled |
Keys
| Context | Keys |
|---|---|
| List | ↑/↓, tab/shift+tab, 1-9 jump or toggle |
| Single select | enter choose (on the freeform row: open the editor) |
| Multi select | space tick, enter submit |
| Editor | enter submit, shift+enter/ctrl+j newline, esc back or cancel |
| Prompt | ctrl+e expand or collapse context |
| Batch | tab/shift+tab pages, 1-N jump from review, enter submit, esc cancel |
| Anywhere | esc/ctrl+c cancel |
ask:answered and ask:cancelled events carry only the question and the response kind; context and the actual answer stay in the tool result.
Skill
The package bundles the ask-user skill, which turns ask_user into a gate before high-stakes or ambiguous decisions. It is installed with the package; remove skills/ from your package list if you only want the tool.
Development
pnpm --filter @hheei/pi-ask-user run build
pnpm exec vitest run packages/pi-ask-user/test