← Catalog

pi-ask-question-lite

Pi ask extension: one structured question dialog, one Esc to abort.

ExtensionPrompt

Install

Install with PiG

pig install npm:pi-ask-question-lite

Install with Pi

pi install npm:pi-ask-question-lite
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.7 (README.md). PiG does not review it.

pi-ask-question-lite

pi-ask-question-lite: one ask call asking question 1 of 2, three options plus Custom, a preview on the right and the key hints on the bottom row

English | 简体中文

One tool: ask(questions). The model asks 1–4 questions with 2–6 options each, and the user answers with one keystroke. Esc aborts the whole turn: no second model reply, no half-finished answers. The package has no runtime dependencies.

Features

  • Single select: Enter or a digit picks the focused option and moves to the next unanswered question.
  • Multi select: Enter or a digit toggles the focused option. Walk down to → Confirm and press Enter to finish the question.
  • Every question has a + Custom… row for free text. Shift+Enter adds a newline, Enter confirms.
  • Everything below the top divider starts at column 0, flush with Pi's own footer. Blank lines appear only where height is spare: one after a question that wraps to two or more lines, one above the hint line; both go away under height pressure. The focused row is marked with ›, and the hint line only lists keys the current mode can use (ui.showHints: false hides it).
  • e opens a note on the focused option: single select carries one note, multi select keeps one notes entry per option, and unchecking that option drops it.
  • Ctrl+Enter submits what is answered and marks the rest as skipped.
  • Esc aborts. The turn ends immediately and the model gets no answers.
  • The tab bar labels each question with its title (or Q1, Q2…) and highlights the active one. The full question always renders below, wrapped to width.
  • Ctrl+] collapses the panel to one line with progress; press it again to expand. Focus, answers and drafts stay. Change it with keys.collapse, or set off to disable.
  • In the chat, the call line is Ask <title1 · title2> and the result is one ✓ <title>: <answer> line per question with notes written as <label> (note: …); skipped questions are dim skipped. Ctrl+O expands a result into full questions with per-option lines.
  • An option can carry a preview in Markdown. Wide terminals show it beside the options, narrow ones stack it below.
  • The dialog takes the editor slot, never the chat. Height is capped by ui.maxHeightRatio.

Install

pi install npm:pi-ask-question-lite

To run the working copy instead:

pi -ne -e ./packages/pi-ask-question-lite/src/index.ts

Keys

KeyAction
↑ / ↓Move between options, + Custom… and (multi select) → Confirm
Tab / Shift+Tab / ← / →Switch question
1–9Pick that option (toggle in multi select)
EnterSingle select: pick and advance. Multi select: toggle the option, or finish on → Confirm
eNote on the focused option (keys.annotate)
Ctrl+EnterSubmit early (keys.submitEarly)
Ctrl+]Collapse / expand the panel (keys.collapse)
EscAbort the turn, or leave the current editor

Configuration

The config file is <agent dir>/pi-ask-question-lite/config.json. <agent dir> is $PI_CODING_AGENT_DIR, or ~/.pi/agent when unset.

The extension only reads this file and never writes it. Without the file, all values are defaults.

An error names the absolute path and one path: reason line per fault. These cases throw: broken JSON, an unknown key, a wrong type. ui.maxHeightRatio outside 0.2–0.8 clamps to the bound.

Minimal configuration: zero config works. To make the dialog shorter, set ui.maxHeightRatio.

{
  "ui": { "maxHeightRatio": 0.3 }
}

Full configuration: all keys follow, with their default values. // starts a comment; remove the comments in a real file.

{
  "tools": { "ask": { "name": "ask" } },             // tool name
  "limits": {
    "maxQuestions": 4,                               // max questions per call
    "maxOptions": 6                                  // max options per question
  },
  "ui": {
    "maxHeightRatio": 0.45,                          // dialog height share (0.2–0.8)
    "bell": true,                                    // ring once when the dialog appears
    "showHints": true,                               // draw the bottom key hint line
    "preview": { "minSideBySideWidth": 100 }         // below this width the preview stacks
  },
  "keys": {
    "annotate": "e",                                 // note editor on the focused option
    "submitEarly": "ctrl+enter",                     // submit answered, skip the rest
    "collapse": "ctrl+]"                             // collapse to one line; "off" disables
  },
  "guidance": {                                      // what the model sees; `tool-name` becomes the tool name
    "description": "Ask structured questions when user intent or trade-offs are unclear.",
    "promptSnippet": "",                             // tool-list line; empty = omitted
    "promptGuidelines": [
      "tool-name: Check code, docs, or tools first; only ask when user intent or trade-offs are unclear.",
      "tool-name: Ask only independent questions together; defer follow-ups that depend on earlier answers.",
      "tool-name: Put the recommended option first, keep `label` short, and explain trade-offs in `detail`.",
      "tool-name: Put concrete examples, code, or layouts in `preview` when options differ in behavior.",
      "tool-name: Set `multiple: true` only when choices are not mutually exclusive."
    ]
  }
}

An empty guidance.promptSnippet registers no tool-list line. tool-name in the other two fields becomes the tool name.

keys.submitEarly defaults to ctrl+enter, which only Kitty-protocol terminals report. Older terminals send a plain \r, so the key behaves like Enter. Change it when that matters.

keys.collapse takes off or a strict key: modifiers in ctrl+shift+alt+super order, then one letter, digit, symbol or special key name. It cannot take a navigation key (including the legacy aliases ctrl+m, ctrl+j, ctrl+i, ctrl+[, ctrl+h) or repeat keys.annotate / keys.submitEarly.

Docs

DocumentContent
ArchitectureModules, dependency rules, test seams
GlossaryWhat each term means
DecisionsOne file per decision
SpecContract, acceptance criteria, non-goals
AuditAcceptance runs, one file each
TodosImplementation checklists
CHANGELOG.mdRelease notes

License

MIT © setwhite