Skip to content

ActionParams

The bag of values received by an action handler.

  • args — fully resolved positional arguments
  • flags — fully resolved flags
  • ctx — derive/middleware-provided context
  • out — output channel
  • meta — CLI program metadata (name, bin, version, command)

The C parameter defaults to Record<string, never>, making ctx property access a type error until derive or middleware extends it.

Signatures

ts
interface ActionParams<F extends Record<string, FlagBuilder<FlagConfig>>, A extends Record<string, ArgBuilder<ArgConfig>>, C extends Record<string, unknown>> {}

Members

Properties

args

Fully resolved positional argument values, typed from .arg() definitions.

ts
args: Readonly<InferArgs<ActionParams.A>>;

ctx

Middleware/derive-provided context, typed from .middleware() and .derive() chains.

ts
ctx: Readonly<ActionParams.C>;

flags

Fully resolved flag values, typed from .flag() definitions.

ts
flags: Readonly<InferFlags<ActionParams.F>>;

meta

Runtime metadata about the CLI program and current command.

ts
meta: CommandMeta;

out

Structured output channel for stdout, stderr, JSON, tables, and spinners.

ts
out: Out;

See Also

Released under the MIT License.