CLIPluginHooks
Individual lifecycle hooks that a plugin may implement.
Hook order for a successful command run is: beforeParse → 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:
packages/dreamcli/src/core/cli/plugin.ts:50
Signatures
ts
interface CLIPluginHooks {}Members
Properties
afterAction
Called after the middleware chain and action handler complete successfully.
ts
afterAction?: { (params: ResolvedCommandParams): void | Promise<void>; };afterResolve
Called after parse + resolve, before middleware or action execution.
ts
afterResolve?: { (params: ResolvedCommandParams): void | Promise<void>; };beforeAction
Called immediately before the middleware chain and action handler run.
ts
beforeAction?: { (params: ResolvedCommandParams): void | Promise<void>; };beforeParse
Called immediately before leaf-command argv is parsed.
ts
beforeParse?: { (params: BeforeParseParams): void | Promise<void>; };