@tduyng/pi-ask

Ask every question in one screen and wait for the answers. One tool, 251 tokens a request.

Packages

Package details

extension

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

$ pi install npm:@tduyng/pi-ask
Package
@tduyng/pi-ask
Version
0.0.6
Published
Nov 16, 2026
Downloads
1,408/mo · 243/wk
Author
tienduy-nguyen
License
Apache-2.0
Types
extension
Size
36 KB
Dependencies
1 dependency · 2 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

@tduyng/pi-ask

ask_user puts decisions in front of a person: one screen, every question in the round, each with choices or a text field, an optional guess, and a default that survives an unanswered question. The answers come back in the same turn.

A model that hits a decision only a person can settle usually guesses in prose, where the guess reads like a fact. The other option was one dialog per question, which works for one decision and not for an interview.

The screen

One question at a time, with the detail that raised it above the choices. The guessed option leads and is already selected.

Key Does
up, down move
enter take the row
space check or uncheck, on a question with multiSelect
tab on a choice question, open the free-text answer
shift+tab back, and edit an earlier answer
esc stop. Questions left hold their defaults

Every choice question ends with Other: type my answer and Skip (default: <guess>). A skip is an answer: the question's guess becomes its default, and the model is told what was assumed. A text question answered empty does the same.

Asking

One call, as many questions as the round needs. Each has question, optional id, detail, options, multiSelect and guess.

ask_user({questions: [
  {
    id: "Q7",
    question: "Which clients does this round cover?",
    detail: "Found: web and the CLI both render the list. Proposed: web and cli, since the ask came from both.",
    options: ["web", "cli", "mobile"],
    multiSelect: true,
    guess: "web, cli"
  },
  {id: "Q8", question: "What does the CLI show when the list is empty?", guess: "the same empty state as web"}
]})

multiSelect joins the checked choices with , . A choice question without it takes one. detail is where the finding, the proposal and the cost of the default go, so the person answers with the evidence in front of them. guess is the answer you would give, not its reasoning: a comma-joined list of options on a multi-select question.

The result is one Q/A block per question, using the id when there is one. A: ... (default) is a guess the tool took because nothing was typed. (skipped; default: ...) is the Skip row. (unanswered; ...) is a question the dialog never reached.

A question whose answer changes the next question goes in the next call. The tool blocks until the screen is done, and the model asks again with what it learned.

Without a UI

In pi -p, a script or a subagent, nothing waits for a person. Each guess comes back as a default and the tool tells the model to record it as an assumption. In RPC mode the terminal wizard is unavailable, so the tool falls back to one dialog per question, with the guess as the first row, so a client that picks the first option records the guess rather than a random answer.

When to use it

When the answer changes the design and a guess would need correcting, or when ten decisions want one sitting. Not for confirmation, and not for something the request already settled.

Limits

  • The wizard needs the TUI. RPC and print use the sequential fallback.
  • A multi-select answer is one comma-joined string. The blocks are text, not JSON.

Install

pi install npm:@tduyng/pi-ask

The schema costs 251 tokens a request (ask_user) and adds no hooks, prompt text or session entries.