CLIPluginHooks
Individual lifecycle hooks that a plugin may implement.
Hook order for a successful command run is: beforeParse → transformArgv → afterResolve → beforeAction → middleware/action → afterAction.
Hooks are awaited serially and run in plugin registration order at each stage. Throwing from any hook aborts the command just like throwing from middleware or the action handler. afterAction runs only after the middleware chain and action complete successfully.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/cli/plugin.ts - Source link:
src/core/cli/plugin.ts:73
Signatures
interface CLIPluginHooks {}Members
Properties
beforeParse
Observe the original leaf-command argv. Return values are ignored.
beforeParse?: { (params: BeforeParseParams): void | Promise<void>; };transformArgv
Rewrite leaf-command argv after all beforeParse observers have run.
transformArgv?: { (params: TransformArgvParams): void | TransformArgvResult | Promise<void | TransformArgvResult>; };afterResolve
Called after parse + resolve, before middleware or action execution.
afterResolve?: { (params: ResolvedCommandParams): void | Promise<void>; };beforeAction
Called immediately before the middleware chain and action handler run.
beforeAction?: { (params: ResolvedCommandParams): void | Promise<void>; };afterAction
Called after the middleware chain and action handler complete successfully.
afterAction?: { (params: ResolvedCommandParams): void | Promise<void>; };