Prompts
Overview of all 6 interactive prompt types in termprompt.
Prompts
termprompt ships 7 interactive prompt types. All return Promise<T | Cancel> and support cancellation via Esc or Ctrl+C.
At a Glance
select
◇ Pick a framework│ ◉ Next.js (React SSR)│ ○ Hono│ ○ Astro└
confirm
◇ Deploy to production?│ Yes / No└
input
◇ Project name?│ my-app└
multiselect
◇ Select features│ >■ TypeScript│ □ ESLint│ ■ Vitest└
password
◇ Enter your API key│ ••••••••└
search
◇ Select timezone│ pac│ ◉ Pacific (UTC-8)│ ○ Asia/Pacific└
number
◇ Port number?│ 8080└
Summary
| Prompt | Returns | Use case |
|---|---|---|
select | T | Pick one from a list |
confirm | boolean | Yes/no question |
input | string | Free text with optional validation |
multiselect | T[] | Pick multiple from a list |
password | string | Masked text input |
search | T | Type-to-filter select |
number | number | Numeric input with step controls |
select
Pick one option from a list.
confirm
Yes or no.
input
Free text entry.
multiselect
Pick multiple options.
password
Masked input.
search
Type-to-filter select.
number
Numeric input with step controls.
Common Keyboard Shortcuts
| Key | Action |
|---|---|
Enter | Submit |
Esc | Cancel |
Ctrl+C | Cancel |