A Pi package that adds an interactive ask_user tool for collecting user decisions during an agent run.
High-quality video: ask-user-demo.mp4
- Searchable single-select option lists with wrapped titles and descriptions
- Responsive split-pane details preview on wide terminals with single-column fallback on narrow terminals
- Multi-select option lists
- Optional freeform responses
- Context display support
- Overlay mode — dialog floats over conversation, preserving context
- Pi-TUI-aligned keybinding and editor behavior
- Custom TUI rendering for tool calls and results
- System prompt integration via
promptSnippetandpromptGuidelines - Optional timeout for auto-dismiss in both overlay and fallback input modes
- Structured
detailson all results for session state reconstruction - Graceful fallback when interactive UI is unavailable
- Bundled
ask-userskill for mandatory decision-gating in high-stakes or ambiguous tasks
This package now ships a skill at skills/ask-user/SKILL.md that nudges/mandates the agent to use ask_user when:
- architectural trade-offs are high impact
- requirements are ambiguous or conflicting
- assumptions would materially change implementation
The skill follows a "decision handshake" flow:
- Gather evidence and summarize context
- Ask one focused question via
ask_user - Wait for explicit user choice
- Confirm the decision, then proceed
See: skills/ask-user/references/ask-user-skill-extension-spec.md.
pi install npm:pi-ask-userThe registered tool name is:
ask_user
| Parameter | Type | Default | Description |
|---|---|---|---|
question |
string |
required | The question to ask the user |
context |
string? |
— | Relevant context summary shown before the question |
options |
(string | {title, description?})[]? |
[] |
Multiple-choice options |
allowMultiple |
boolean? |
false |
Enable multi-select mode |
allowFreeform |
boolean? |
true |
Add a "Type something" freeform option |
timeout |
number? |
— | Auto-dismiss after N ms and return null if the prompt times out |
{
"question": "Which option should we use?",
"context": "We are choosing a deploy target.",
"options": [
"staging",
{ "title": "production", "description": "Customer-facing" }
],
"allowMultiple": false,
"allowFreeform": true
}All tool results include a structured details object for rendering and session state reconstruction:
interface AskToolDetails {
question: string;
context?: string;
options: QuestionOption[];
answer: string | null;
cancelled: boolean;
wasCustom?: boolean;
}See CHANGELOG.md.
