Skip to content

InputPromptConfig ​

Free-text input prompt — maps to string and number flags. Part of PromptConfig.

Signatures ​

ts
interface InputPromptConfig extends PromptConfigBase {}

Members ​

Properties ​

default ​

Value used when the user submits an empty line (presses Enter), shown in the hint as (default: <value>). When set, an empty submission resolves to this value without running validate. When omitted, an empty submission is treated as "no answer" so resolution falls through to the flag's .default().

ts
default?: string;

kind ​

Discriminator identifying this as a free-text input prompt.

ts
kind: "input";

message ​

The question displayed to the user.

ts
message: string;

placeholder ​

Placeholder text shown before user types (informational only).

ts
placeholder?: string;

validate ​

Inline validation function. Return true if valid, or a string error message if invalid. Called before coercion to flag kind.

ts
validate?: { (value: string): string | true; };

See Also ​

Released under the MIT License.