MiddlewareParams
Parameters received by a middleware function at runtime.
Middleware receives erased args/flags (since it's defined independently of commands) plus the accumulated context from prior middleware and a next function to continue the chain.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/middleware.ts - Source link:
packages/dreamcli/src/core/schema/middleware.ts:28
Signatures
ts
interface MiddlewareParams {}Members
Properties
args
Fully resolved positional arguments (type-erased).
ts
args: Readonly<Record<string, unknown>>;ctx
Context accumulated from previous middleware in the chain.
ts
ctx: Readonly<Record<string, unknown>>;flags
Fully resolved flags (type-erased).
ts
flags: Readonly<Record<string, unknown>>;meta
CLI program metadata (name, bin, version, command).
ts
meta: CommandMeta;next
Continue to the next middleware or action handler.
Call with context additions that merge into ctx for downstream. Returns when the entire downstream chain completes — enabling wrap-around patterns (timing, try/catch, cleanup).
ts
next: { (additions: Record<string, unknown>): Promise<void>; };out
Output channel.
ts
out: Out;