ArgSchema
The runtime descriptor stored inside every ArgBuilder. Consumers (parser, help generator) read this to understand the arg's shape without touching generics.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/arg.ts - Source link:
src/core/schema/arg.ts:196
Signatures
interface ArgSchema<K extends ArgKind> {}Members
Properties
[schemaBrand]
Type-only seal produced by createArgSchema.
[schemaBrand]: "arg";aggregateStandard
Standard Schema v1 validator applied to the completed collection.
Set by .standard() on a builder that already aggregates, so the array or record is validated as a whole after every element passed.
aggregateStandard: StandardSchemaV1<unknown, unknown> | undefined;configPath
Dotted config path for config 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 arg 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;duplicateKeys
How a repeated key combines when kind === 'keyValue'.
duplicateKeys: "error" | "last" | "first";enumValues
Allowed literal values when kind === 'enum'.
enumValues: readonly string[] | undefined;envVar
Environment variable name for env resolution.
When set and the CLI value is absent, the resolver reads this env var and coerces the string to the arg's declared kind.
envVar: string | undefined;kind
What kind of value this arg accepts.
kind: ArgSchema.K;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: ArgParseFn<unknown> | undefined;pathChecks
Filesystem checks for path-valued args (set by arg.path()).
Validated after resolution through the runtime adapter, so CLI, stdin, env, and defaulted values are all checked. Only meaningful when kind === 'string'.
pathChecks: PathChecks | undefined;presence
Current presence state.
presence: "optional" | "required" | "defaulted";prompt
Interactive prompt configuration.
prompt: PromptConfig | undefined;separator
CLI value separator for a collection (undefined otherwise).
When set, each positional token is split on this separator before element coercion. Other sources decode through ArgSchema.split.
separator: string | undefined;split
Env and stdin split policies for a collection (undefined otherwise).
A source the binding leaves out takes its default: comma-delimited for env, line-delimited for stdin.
split: SourceSplitBinding | undefined;standard
Standard Schema v1 validator applied to each resolved value.
When set, the value from any source (CLI, env, stdin, default) is validated after resolution via ~standard.validate. Sync and async validators are both awaited; issues surface as a CONSTRAINT_VIOLATED ValidationError. A variadic arg validates every element with it.
standard: StandardSchemaV1<unknown, unknown> | undefined;stdin
Stdin binding set by .stdin() (undefined when the arg never reads stdin). See StdinBinding.
stdin: StdinBinding | undefined;stringConstraints
String constraints when kind === 'string' (undefined otherwise).
Enforced at the parse and resolution boundaries, in fixed order: nonEmpty → minLength → maxLength → pattern. A defaultValue is a typed value, so it is validated against them when the schema is built.
stringConstraints: StringConstraints | undefined;unique
Deduplicate the resolved values of a variadic arg.
Applied after all sources resolve, preserving first-seen order. Uses SameValueZero semantics (like Set).
unique: boolean;valueHint
Help placeholder label (e.g. 'url').
Set by the sugar factories (arg.url(), arg.date(), …) so tooling reading the schema knows the expected value shape. Help renders a positional by its own name, so this does not change the usage line.
valueHint: string | undefined;variadic
Whether this arg consumes all remaining positionals.
variadic: boolean;