← Catalog

pi-ask-questions

Interactive questionnaires for Pi: tabs, multi-select, free-form typing, validation, and structured answers.

Extension

Install

Install with PiG

pig install npm:pi-ask-questions

Install with Pi

pi install npm:pi-ask-questions
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/extension.ts"
  ]
}

README

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

pi-ask-questions

Interactive questionnaires for Pi: tabs, multi-select, free-form typing, validation, and structured answers.

Install

pi install npm:pi-ask-questions

Run /reload in an open Pi session. Use /ask-demo to try the questionnaire, or let the agent call ask_user when it needs input.

Answer questions

Use Tab and Shift+Tab to switch questions. Select options with Space or keys 1 through 9, then press Enter to confirm. Multiple questions include a review tab before submission.

You can add one typed answer alongside selected options unless the question disables it. Multiple-choice questions can require a minimum or maximum answer count. Typed answers count toward these limits.

KeyAction
Up, Down, Home, EndMove through options.
Page Up, Page DownMove by eight options.
A, CSelect all or clear multiple-choice options.
EnterConfirm a question or submit from the review tab.
Backslash then EnterInsert a newline in a typed answer.
Esc twice, Ctrl+CCancel.

Tool reference

{
	"mode": "background",
	"questions": [
		{
			"id": "scope",
			"question": "Which packages should change?",
			"multiple": true,
			"min": 1,
			"options": [{ "label": "Core", "value": "core" }, { "label": "CLI", "value": "cli" }]
		}
	]
}

questions accepts 1 to 12 entries. Each requires question text. Optional fields are:

FieldMeaning
id, labelResult ID and tab label. Defaults are q1 and Q1, with increasing numbers.
headerContext below the question.
optionsChoices with label, optional value, description, and selected. Values default to labels. Omit for typed answers.
multipleAllows several listed choices. Default false.
allowOtherAllows one typed answer beside listed choices. Default true.
requiredRequires an answer. Default true.
min, maxSelection limits for multiple-choice questions.
placeholder, otherLabelEditor placeholder and typed-answer label.

Top-level title and submitLabel customize the questionnaire title and submit entry.

mode: "background" is the default. In Pi's terminal UI, it returns immediately and delivers answers through the steering queue at the next model or tool boundary. It does not interrupt a running response or tool. Submitting after the agent stops starts a new turn. Only one background questionnaire can be open.

mode: "urgent" waits for answers or cancellation. RPC uses sequential selection and input dialogs and waits in either mode. Print and JSON modes return the questions for the agent to ask as text.

The compatibility field noWait selects background mode when true and urgent mode when false. An explicit mode takes precedence.

Results include a text summary and structuredContent with cancelled, optional pending, and answers. Each entry contains id, question, skipped, and an answers array of { value, label, custom } objects. While pending is true, answer arrays are empty. Completed background answers arrive as steering text.

Develop

npm ci
npm run check
pi -e ./src/extension.ts

MIT license.