FlagSchema
The runtime descriptor stored inside every FlagBuilder. Consumers (parser, help generator, resolution chain) read this to understand the flag's shape without touching generics.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/flag.ts - Source link:
src/core/schema/flag.ts:269
Signatures
interface FlagSchema {}Members
Properties
aliases
Short/long aliases (e.g. [{ name: 'f', hidden: false }] for --force).
aliases: readonly FlagAlias[];configPath
Dotted config path for v0.2+ resolution (e.g. 'deploy.region').
configPath: string | undefined;defaultValue
Runtime default value (if any).
defaultValue: unknown;deprecated
Deprecation marker.
undefined— not deprecated (default)true— deprecated with no migration messagestring— deprecated with a reason/migration message
When a deprecated flag is used, a warning is emitted to stderr. Help text shows [deprecated] or [deprecated: <reason>].
deprecated: string | true | undefined;description
Human-readable description for help text.
description: string | undefined;duplicates
Duplicate policy for repeated CLI occurrences. See DuplicatePolicy.
duplicates: DuplicatePolicy;elementSchema
Element schema when kind === 'array'.
elementSchema: FlagSchema | undefined;enumValues
Allowed literal values when kind === 'enum'.
enumValues: readonly string[] | undefined;envVar
Environment variable name for v0.2+ resolution.
envVar: string | undefined;kind
What kind of value this flag accepts.
kind: "string" | "number" | "boolean" | "enum" | "array" | "custom" | "count" | "keyValue";negation
Negation settings when kind === 'boolean' and .negatable() was called (undefined otherwise). See FlagNegation.
negation: FlagNegation | undefined;numberConstraints
Numeric constraints when kind === 'number' (undefined otherwise).
Enforced at the parse and resolution boundaries. finite defaults to true, so Infinity is rejected even when no constraints object is set.
numberConstraints: NumberConstraints | undefined;parseFn
Custom parse function (only when kind === 'custom').
parseFn: FlagParseFn<unknown> | undefined;pathChecks
Filesystem checks for path-valued flags (set by flag.path()).
Validated after resolution through the runtime adapter.
pathChecks: PathChecks | undefined;presence
Current presence state.
presence: "optional" | "required" | "defaulted";prompt
Interactive prompt configuration for v0.3+ resolution.
prompt: PromptConfig | undefined;propagate
Whether this flag propagates to subcommands in nested command trees.
When true, the flag is automatically available to all descendant commands. A child command that defines a flag with the same name shadows the propagated parent flag.
propagate: boolean;separator
Value separator when kind === 'array' (undefined otherwise).
When set, each CLI occurrence is split on this separator before element coercion, so --tag a,b --tag c yields ['a', 'b', 'c']. Env and config string values use this separator too (default ',').
separator: string | undefined;standard
Standard Schema v1 validator applied to the resolved value.
When set, the value from any source (CLI, env, config, prompt, default) is validated after resolution via ~standard.validate. Sync and async validators are both awaited; issues surface as a CONSTRAINT_VIOLATED ValidationError. Only meaningful when kind === 'custom'.
standard: StandardSchemaV1<unknown, unknown> | undefined;stringConstraints
String constraints when kind === 'string' (undefined otherwise).
Enforced at the parse and resolution boundaries, in fixed order: nonEmpty → minLength → maxLength → pattern.
stringConstraints: StringConstraints | undefined;unique
Deduplicate resolved array values when kind === 'array'.
Applied after all sources resolve, preserving first-seen order. Uses SameValueZero semantics (like Set).
unique: boolean;valueHint
Help placeholder label (e.g. 'url' renders as <url>).
Set by the sugar factories (flag.url(), flag.date(), …) so help output names the expected value shape; undefined falls back to the kind-derived hint.
valueHint: string | undefined;