Skip to content

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.

Manifest entry
./question
Runtime surface
Agent tool

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_request dialogs (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 multiselect UI method; older hosts fall back to a single choice.
  • Each question has a stable id, a label, a question string, a type, and optional options and context.
  • Answers are returned as a structured result with answered, skipped, and unanswered statuses.

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

  1. Per-tool-call schema
    question({ questions: [...] })
    All options are supplied by the agent inside the tool call.

Settings

Key / pathType, default, and valuesDescription
questions[].idstring
Default: q1, q2, ...
Stable answer id. Auto-generated when omitted.
questions[].labelstring
Default: Q1, Q2, ...
Short page label shown in the wizard.
questions[].questionstring
Default: —
Question text shown to the user.
questions[].contextstring
Default: —
Optional plain-text context shown before the question.
questions[].typestring
Default: —
Allowed values: "select", "multiselect", "text"
Question type. image and info are not supported.
questions[].optionsarray
Default: —
Required for select and multiselect. Each option has value, label, and optional description.
questions[].allowOtherboolean
Default: false
Allow a custom text answer for select/multiselect.

Command, tool, and shortcut controls

Key / pathDescription
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-readable labels. Choice questions always include an Other option so users can answer freely; pass allowOther: false to 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.

Source evidence

Selesai version: 0.10.0