@whook/cli v11.0.1
@whook/cli
The Whook server CLI
This is the Whook server CLI tool. Its goal is to allow you to create commands right in your project instead of in external tools. By doing so, it provides you a convenient way to reuse your Whook's project configuration, services and handlers easily in you day to day command line programs.
To create new commands, you simply have to create new files in
the src/commands
folder of your Whook project and let the
autoloader detect it ;).
By setting @whook/cli
in the WHOOK_PLUGINS
constant, you will
benefit of the commands provided by this module:
// (...)
// Setup your own whook plugins or avoid whook defaults by leaving it empty
- $.register(constant('WHOOK_PLUGINS', ['@whook/whook']));
+ $.register(constant('WHOOK_PLUGINS', ['@whook/cli', '@whook/whook']));
// (...)
See the Whook example server commands
for simple examples on creating your own commands in a whook
project.
You can also create a new command by running:
npx whook create --type commands
Dev
To test the CLI script, go to a project (in this repo @whook/example
):
npm run build
cd ../whook-example
# Debugging compiled commands
node ../whook-cli/bin/whook.js ls
# Debugging source commands
PROJECT_SRC="$PWD/src" NODE_ENV=${NODE_ENV:-development} npm run cli -- ts-node --esm --files -- ../whook-cli/bin/whook.js ls
API
Authors
License
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago