@haichiuuu/pi-ask-user-question-lite
v0.2.0
Published
A minimal, timeout-free AskUserQuestion tool for Pi with TUI, RPC, and headless support.
Maintainers
Readme
pi-ask-user-question-lite
A minimal AskUserQuestion tool for Pi Coding Agent. It lets an agent pause, ask a structured question, and continue with the user's explicit choice.
Built with Pi Coding Agent.
Features
- One question or 1–4 sequential questions per call
- 2–4 described options per question
- Single-select and multi-select
- Discoverable free-text
Other…choice with an explicit Enter hint - Previous/next question navigation with preserved option, checkbox, and text drafts
- One persistent TUI across multi-question flows, avoiding transition flicker
- Compact
Question 1/Nprogress - Native RPC
selectandinputdialogs withPrevious question/Next questionactions - Non-blocking JSON/print fallback
- No human-response timeout
- Sequential tool execution so dialogs never overlap
- No bundled skill, workflow, or system-prompt policy
Install
pi install npm:@haichiuuu/pi-ask-user-question-liteOr install directly from GitHub:
pi install git:github.com/haichiu/pi-ask-user-question-liteFor local development:
pi -e ./extensions/index.tsRestart Pi or run /reload after installation.
Tool
The package registers one model-callable tool:
AskUserQuestionExample input:
{
"questions": [
{
"header": "Database",
"question": "Which database should we use?",
"options": [
{ "label": "PostgreSQL", "description": "Strong relational features." },
{ "label": "SQLite", "description": "Small and dependency-free." }
]
},
{
"header": "Features",
"question": "Which optional features should be enabled?",
"multiSelect": true,
"options": [
{ "label": "Backups" },
{ "label": "Metrics" }
]
}
]
}Mode behavior
| Mode | Behavior |
| --- | --- |
| TUI | Persistent keyboard-driven selector; ← / → move through submitted questions |
| RPC | Native select/input requests with Previous question / Next question actions |
| JSON / print | Immediate plain-text fallback; never blocks waiting for unavailable UI |
In TUI option mode, ← returns to the previous question and → moves forward when the current question already has a submitted answer. Escape cancels. Escape inside the Other… editor returns to its option list. Submitted answers and drafts remain available in both directions.
Pi Fabric users who capture extension tools may optionally keep this human-interaction tool directly visible so it does not inherit a machine-execution timeout:
{
"capture": {
"keepVisible": ["fabric_exec", "AskUserQuestion"]
}
}This is a Fabric-specific host setting, not a requirement of the package.
Development
npm install
npm run check
npm pack --dry-runAttribution
Adapted from ilovepixelart/pi-code, which is based on Pi's MIT-licensed question example. See LICENSE.
License
MIT
