Skip to content

KeyValueFlagDefinition ​

Definition of a keyValue flag.

Signatures ​

ts
interface KeyValueFlagDefinition extends FlagDefinitionBase {}

Members ​

Properties ​

kind ​

Kind discriminator.

ts
kind: "keyValue";

elementSchema ​

Element definition or an already-built element schema for each entry value.

ts
elementSchema?: FlagDefinition | FlagSchema | undefined;

separator ​

Pair separator each CLI occurrence is split on.

ts
separator?: string | undefined;

split ​

Env and stdin split policies.

ts
split?: SourceSplitBinding | undefined;

duplicateKeys ​

How a repeated key combines. See DuplicateKeys.

ts
duplicateKeys?: DuplicateKeys | undefined;

completion ​

Callback used to complete this input's values.

ts
completion?: CompletionHandler | undefined;

completionValues ​

Static shell completion suggestions for this flag.

ts
completionValues?: readonly string[] | undefined;

presence ​

Presence state.

ts
presence?: FlagPresence | 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;

aliases ​

Short/long aliases as bare names or FlagAlias records.

ts
aliases?: readonly (string | FlagAlias)[] | undefined;

stdin ​

Stdin binding. See StdinOptions.

ts
stdin?: StdinOptions | undefined;

envVar ​

Environment variable name for env resolution.

ts
envVar?: string | undefined;

envIndexed ​

Indexed environment family read as the env source, in place of FlagDefinitionBase.envVar. Requires kind 'array' or 'custom'.

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;

description ​

Human-readable description for help text.

ts
description?: HelpDescription | undefined;

group ​

Named section in command help.

ts
group?: string | undefined;

advanced ​

Whether the flag is shown only in full text help.

ts
advanced?: true | undefined;

valueHint ​

Help placeholder label ('url' renders as <url>).

ts
valueHint?: string | undefined;

prompt ​

Interactive prompt configuration.

ts
prompt?: PromptConfig | 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;

propagate ​

Whether the flag propagates to descendant commands.

ts
propagate?: boolean | undefined;

duplicates ​

How repeated CLI occurrences combine. See DuplicatePolicy.

ts
duplicates?: DuplicatePolicy | undefined;

See Also ​

Released under the MIT License.