Skip to content

EnumArgDefinition ​

Definition of an enum arg.

Signatures ​

ts
interface EnumArgDefinition extends ArgDefinitionBase {}

Members ​

Properties ​

kind ​

Kind discriminator.

ts
kind: "enum";

enumValues ​

Allowed literal values.

ts
enumValues: readonly string[];

completion ​

Callback used to complete this input's values.

ts
completion?: CompletionHandler | undefined;

presence ​

Presence state.

ts
presence?: ArgPresence | undefined;

variadic ​

Whether this arg consumes all remaining positionals.

ts
variadic?: boolean | undefined;

stdin ​

Stdin binding. See StdinOptions.

ts
stdin?: StdinOptions | undefined;

defaultValue ​

Runtime default value.

ts
defaultValue?: unknown;

defaultDescription ​

Human-readable replacement for the default value in help, or false to omit the default annotation.

ts
defaultDescription?: string | false | undefined;

sensitive ​

Whether values from this input must be kept out of user-facing projections.

ts
sensitive?: boolean | undefined;

description ​

Human-readable description for help text.

ts
description?: HelpDescription | undefined;

group ​

Named section in command help.

ts
group?: string | undefined;

envVar ​

Environment variable name for env resolution.

ts
envVar?: string | undefined;

envIndexed ​

Indexed environment family read as the env source, in place of ArgDefinitionBase.envVar. Requires a variadic arg, or a custom arg without a string parse function.

ts
envIndexed?: IndexedEnvBinding | undefined;

envAbsolute ​

Read the env source exactly as written, outside the CLI-wide namespace. Requires envVar or envIndexed.

ts
envAbsolute?: boolean | undefined;

envFromName ​

Derive envVar from the registered name.

ts
envFromName?: boolean | undefined;

configPath ​

Dotted config path for config resolution (e.g. 'deploy.region').

ts
configPath?: string | undefined;

prompt ​

Interactive prompt configuration.

ts
prompt?: PromptConfig | undefined;

valueHint ​

Help placeholder label ('url', 'path', …).

ts
valueHint?: string | undefined;

separator ​

CLI value separator each positional token is split on.

ts
separator?: string | undefined;

split ​

Env and stdin split policies.

ts
split?: SourceSplitBinding | undefined;

unique ​

Deduplicate the resolved values of a variadic arg.

ts
unique?: boolean | undefined;

standard ​

Standard Schema v1 validator applied to each resolved value.

ts
standard?: StandardSchemaV1 | undefined;

aggregateStandard ​

Standard Schema v1 validator applied to a completed collection.

ts
aggregateStandard?: StandardSchemaV1 | undefined;

deprecated ​

Deprecation marker. true deprecates without a message, a string carries the migration guidance.

ts
deprecated?: string | true | undefined;

See Also ​

Released under the MIT License.