Introduction to Wooks CLI
/cliapp$ wooks cli --introduction|
@wooksjs/event-cli is the CLI adapter for Wooks. It lets you build command-line applications using the same composable architecture as Wooks HTTP — routed commands, typed options, auto-generated help, and per-invocation context via AsyncLocalStorage.
Key Components
createCliApp()— Factory that creates a CLI application with routing, option parsing, and help generationapp.cli(pattern, handler)— Register commands with route-style patterns (e.g.,deploy/:env)- Composables —
useCliOptions(),useCliOption(),useAutoHelp(),useRouteParams()for accessing parsed CLI data - Help Renderer — Powered by @prostojs/cli-help, auto-generates
--helpoutput from command metadata