# Technical reference: Questionnaires for Pi

Advanced user setup, configuration, compatibility, security, and troubleshooting information.

[Back to the human-friendly README](README.md) · [Contributor and implementation guide](DEVELOPMENT.md)

## Requirements and installation

Requires Node.js 22.19 or newer and Pi or OMP. Verified host versions are Pi 1.6.0 and OMP 19.2.1 on Linux.

```bash
pi install npm:@firstpick/pi-package-questionnaire
```

Restart or reload Pi afterward. Remove it with:

```bash
pi remove npm:@firstpick/pi-package-questionnaire
```

OMP requires package version 0.1.2 or later. Registry installation and removal use:

```bash
omp plugin install npm:@firstpick/pi-package-questionnaire
omp plugin uninstall @firstpick/pi-package-questionnaire
```

Start a fresh OMP session after installation. Check instruction delivery without asking questions or contacting a model:

```bash
omp read skill://questionnaire
```

Pi installation is independent. The package has no settings to configure. OMP terminal support is available with Questionnaire 0.1.2. OMP browser questionnaires additionally require the separate WebUI 0.11.6 release or later; that backend is not included in this package. WebUI 0.11.3 has no OMP backend. Use the OMP terminal while the backend-capable WebUI release is unavailable.

## How questions appear

Questions are shown one at a time in their original order.

Terminal controls:

| Key | Action |
| --- | --- |
| `Up` / `Down` | Move between choices |
| `PageUp` / `PageDown` | Move through long lists |
| `Enter` | Confirm the highlighted choice |
| `Escape` / `Ctrl+C` | Cancel |

The Web UI shows the same choices as clickable buttons. “Other” opens a text field when custom answers are allowed.

For multiple-choice questions, select or clear options one at a time, then choose **Continue with N selections**.

## Clarification

A questionnaire can pause when you choose **Ask Pi to clarify…**. Pi answers the question in normal text and then returns to the same questionnaire item without discarding earlier answers.

Clarification can happen more than once. The pending question cannot be silently replaced or answered on your behalf.

## Result states

- **Completed** — every required question was answered.
- **Needs clarification** — the questionnaire is paused while Pi explains something.
- **Cancelled** — you cancelled the dialog or stopped the flow.
- **Unavailable** — the current mode cannot display the questionnaire.

Invalid or outdated resume attempts return an error instead of silently starting over.

## Limits

- Up to 20 questions in one questionnaire
- Up to 50 choices for each question
- Questions are resumed only in the same host session branch
- An open, unfinished dialog cannot survive the Pi process ending
- The package sets no timeout, but host deadlines and cancellation still apply
- Non-interactive Pi and OMP modes report the questionnaire as unavailable

## Privacy

Answers become part of the Pi session just like other tool results. The package does not copy or export them elsewhere.

Questionnaire text is not a secret-input field. Do not enter passwords, API keys, access tokens, private keys, or other credentials.

## Troubleshooting

- If no dialog appears, confirm the package is installed and the current Pi mode supports interactive dialogs.
- If resume is rejected, return to the same session branch where the questionnaire started.
- If a multiple-choice answer cannot continue, check the minimum and maximum choices stated by the question.
