Example: Hooks
Source: examples/hooks/
Shows how to use CliOptions.hooks to run code at lifecycle events:
beforeParse: validate environment variables before parsing argumentsafterParse: log the parsed outputbeforeExecute: authentication check — throws to prevent executionafterExecute: cleanup, always called even ifbeforeExecutethrew
See Features → Lifecycle hooks for the full diagram.