@maxpaulus/pi-ask0.1.1
Batched design questions with recommendations and keyboard answers for pi.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-ask
A pi extension exposing ask_question: answer a batch of design questions with recommendations, multiple-choice options, or your own text. Review and edit your answers before submitting the whole batch to the model.
Try it
pi -e ./index.ts
Then ask:
Help me design a small habit tracker. Use ask_question to ask me questions with recommendations until we have a shared understanding. Don't implement anything yet.
Install
From this directory:
pi install "$PWD"
Run /reload in an existing pi session. Local installation references this directory, so edits take effect after /reload.
Controls
| Key | Action |
|---|---|
| ↑ / ↓, Enter | Choose and save an option; advance to the next question |
| 1–8 | Save that numbered option and advance |
| 9 | Write your own answer |
| e | Choose the highlighted option and add to it |
| Tab / Shift+Tab or ← / → | Move between questions and the review page |
| Enter in text editor | Save your custom answer |
| Shift+Enter | Newline in custom answer |
| Esc in text editor | Return to choices, keeping your draft |
| Esc in choices/review | Cancel the whole batch; submit no answers |
| PgUp / PgDn | Scroll long content inside the panel |
The panel keeps the same height across choices, custom answers, and review: half the terminal height, capped at 24 lines, leaving room for the conversation. Description space is reserved for the longest option, and keyboard hints stay pinned at the bottom. Long content scrolls with PgUp/PgDn.
The review page has Submit all answers and entries for revisiting each question. Unanswered questions block submission. Recommendations receive a ★ Recommended label, a highlighted explanation, and initial keyboard focus—not automatic consent. Pi's configured selection and editor keys also apply.
Each call accepts 1–8 questions with 2–8 options each. Custom answers allow up to 2000 characters. This is a terminal UI extension; RPC, JSON, and print modes return an error asking the model to use plain-text questions instead.
The model can call the tool again for dependent follow-up questions. The extension does not force an interview on every request or restrict other tools; ask explicitly for discussion before implementation if that's what you want.
Tool input
{
"questions": [{
"question": "Where should we store the data?",
"options": [
{ "label": "SQLite", "description": "A local file; no server to manage." },
{ "label": "Postgres", "description": "A shared server for multiple writers." }
],
"recommended": 1,
"reason": "This is a single-user app, so SQLite keeps setup simple."
}]
}
recommended is optional and 1-based. Custom answers are always available. Results include each question, its answer, and the option number (null for custom text). Model-facing result text is capped at 50 KB / 2000 lines with an explicit truncation notice; complete answers remain in the session's tool details.
Development
npm install
npm test
npm run check
Uses only pi's bundled packages at runtime. The test drives the real UI components with simulated keyboard input; it covers review, edits, custom drafts, cancellation, abort, validation, and rendering widths. Interaction follows pi's bundled questionnaire.ts example.