Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Interactive prompt support for Optique via Clack
Functions
Wraps a parser with an interactive Clack prompt fallback.
Interfaces
Configuration for a confirm prompt.
- initialValue: boolean
Initial Boolean value.
- message: string
The question to display to the user.
- prompter: () => Promise<boolean>
Override the prompt execution. Useful for testing.
- type: "confirm"No documentation available
Configuration for a multiselect prompt.
- message: string
The question to display to the user.
- options: readonly (string | Option)[]
Available options.
- prompter: () => Promise<readonly string[]>
Override the prompt execution. Useful for testing.
- required: boolean
Whether at least one option must be selected.
- type: "multiselect"No documentation available
Configuration for a number prompt.
- initialValue: number
Initial numeric value.
- max: number
Maximum accepted value.
- message: string
The question to display to the user.
- min: number
Minimum accepted value.
- placeholder: string
Placeholder text shown before input.
- prompter: () => Promise<number | undefined>
Override the prompt execution. Useful for testing.
- type: "number"No documentation available
- validate: (value: number) => string | void | Promise<string | void>
Additional validation after numeric conversion.
A choice item for select and multiselect prompts.
Configuration for a password prompt.
- mask: string
Mask character shown while typing.
- message: string
The question to display to the user.
- prompter: () => Promise<string>
Override the prompt execution. Useful for testing.
- type: "password"No documentation available
- validate: (value: string) => string | void | Promise<string | void>
Validation function called when the user submits.
Configuration for a select prompt.
- initialValue: string
Initially selected option value.
- message: string
The question to display to the user.
- options: readonly (string | Option)[]
Available options.
- prompter: () => Promise<string>
Override the prompt execution. Useful for testing.
- type: "select"No documentation available
Configuration for a text prompt.
- initialValue: string
Initial value pre-filled in the prompt.
- message: string
The question to display to the user.
- placeholder: string
Placeholder text shown before input.
- prompter: () => Promise<string>
Override the prompt execution. Useful for testing.
- type: "text"No documentation available
- validate: (value: string) => string | void | Promise<string | void>
Validation function called when the user submits.
Type Aliases
Type-safe Clack prompt configuration for a given parser value type T.
A union of all string-valued prompt configurations.