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 ​

kind ​

Discriminator identifying this as a free-text input prompt.

ts
kind: "input";

placeholder ​

Placeholder text shown before user types (informational only).

ts
placeholder?: string;

trim ​

Trim surrounding whitespace. Defaults to true for compatibility.

ts
trim?: boolean;

empty ​

Empty submission policy. Defaults to skip (fall through to input defaults).

ts
empty?: "skip" | "accept" | "retry";

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;

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): true | string | Promise<true | string>; };

message ​

The question displayed to the user.

ts
message: string;

sensitive ​

Suppress framework-controlled value hints and diagnostics.

ts
sensitive?: boolean;

See Also ​

Released under the MIT License.