Interactive questions
The question extension provides a terminal wizard for asking the user one or more typed questions. It supports single-select, multi-select, and free-form text questions, with keyboard navigation and filtering. Outside the TUI (e.g. RPC/VS Code hosts), the same questions are answered through the host’s extension UI dialogs.
Bundled with Selesai
Loaded automatically with Selesai; no per-extension npm install is required.
Setup and prerequisites
- This extension is bundled with Selesai. It is loaded automatically; you do not need to install it separately.
- Requires a UI surface. In terminal TUI mode questions render as a full-screen wizard; in RPC/VS Code hosts they render as
extension_ui_requestdialogs (select,input,multiselect). It cannot be used in modes without any UI. - The agent invokes the tool; the user answers through the TUI.
What it sets up
- In terminal TUI mode the tool renders a full-screen batch question wizard. In non-TUI modes (e.g. RPC) questions are asked one at a time through the host’s extension UI dialogs; cancelling any question cancels the whole batch.
- Multi-select questions keep full multi-selection when the host supports the
multiselectUI method; older hosts fall back to a single choice. - Each question has a stable
id, alabel, aquestionstring, atype, and optionaloptionsandcontext. - Answers are returned as a structured result with
answered,skipped, andunansweredstatuses.
What you can configure
The question tool is schema-driven. Questions are configured per tool call; there are no persistent user settings.
Configuration locations and precedence
- Per-tool-call schema
question({ questions: [...] })
All options are supplied by the agent inside the tool call.
Settings
| Key / path | Type, default, and values | Description |
|---|---|---|
questions[].id | string Default: q1, q2, ... | Stable answer id. Auto-generated when omitted. |
questions[].label | string Default: Q1, Q2, ... | Short page label shown in the wizard. |
questions[].question | string Default: — | Question text shown to the user. |
questions[].context | string Default: — | Optional plain-text context shown before the question. |
questions[].type | string Default: — Allowed values: "select", "multiselect", "text" | Question type. image and info are not supported. |
questions[].options | array Default: — | Required for select and multiselect. Each option has value, label, and optional description. |
questions[].allowOther | boolean Default: false | Allow a custom text answer for select/multiselect. |
Command, tool, and shortcut controls
| Key / path | Description |
|---|---|
question({ questions }) | Batch wizard with review and submission screens. |
Source evidence
src/extensions/question/schemas.ts
What you can do
- Ask independent decisions that the user must make directly.
- Present single-select, multi-select, or free-form text questions.
- Provide stable option
values separate from human-readablelabels. Choice questions always include an Other option so users can answer freely; passallowOther: falseto force the listed options.
Commands, tools, and shortcuts
There are no slash commands. The tool is invoked by the agent:
question({ questions: [ { id: "target_db", label: "Database", type: "select", question: "Which database should we use?", options: [ { value: "sqlite", label: "SQLite" }, { value: "postgres", label: "PostgreSQL" } ], allowOther: true }, { id: "skip_cache", label: "Skip cache", type: "text", question: "Why skip the cache?" } ]})Supported question types: select, multiselect, text.
Committing a select, multi-select, text, or custom answer advances automatically. A single answered question submits immediately. Multi-question batches keep the final review screen, where Enter submits all answers atomically; Tab/Shift+Tab or arrow keys remain available for manual navigation and editing.
Limits and safety
-
The tool requires a UI. It throws when no host UI is available (headless or non-interactive sessions).
-
Questions should be independent decisions that the user must make; the agent should inspect facts itself rather than asking the user for discoverable information.
-
Blank text entries are recorded as
skipped; the agent must handle skipped and unanswered statuses explicitly.