Skip to content

DeriveHandler

Command-scoped typed pre-action handler.

Derive handlers may:

  • validate resolved input and throw CLIError
  • return undefined to continue without changing context
  • return an object whose properties merge into ctx downstream

They cannot wrap downstream execution; use middleware for that.

Signatures

ts
type DeriveHandler<F extends Record<string, FlagBuilder<FlagConfig>>, A extends Record<string, ArgBuilder<ArgConfig>>, C extends Record<string, unknown>, Output extends Record<string, unknown> | undefined> = { (params: DeriveParams<F, A, C>): Output | Promise<Output>; };

See Also

Released under the MIT License.