Mastering jzero
About Configuration
- Supports controlling various parameters through configuration file .jzero.yaml
- Supports controlling various parameters through flag
- Supports controlling various parameters through environment variables
- Supports controlling various parameters through combination of above methods, priority from high to low: flag > environment variables > configuration file
Example: jzero gen --style go_zero corresponds to .jzero.yaml content
gen:
git-change: truejzero gen + .jzero.yaml = jzero gen --git-change=true
For environment variable usage, need to add prefix JZERO_, such as JZERO_GEN_GIT_CHANGE
JZERO_GEN_GIT_CHANGE=go_zero jzero gen = jzero gen --git-change=true
Environment variable definition supports using configuration file, default is .jzero.env.yaml
Example:
JZERO_GEN_GIT_CHANGE: trueSubcommands
For subcommand configuration, such as: jzero gen zrpcclient --output client corresponds to .jzero.yaml content
gen:
zrpcclient:
output: clientjzero gen zrpcclient + .jzero.yaml = jzero gen zrpcclient --output client
Also supports environment variable configuration JZERO_GEN_ZRPCCLIENT_NAME
JZERO_GEN_ZRPCCLIENT_OUTPUT: clientjzero gen zrpcclient + .jzero.env.yaml = jzero gen zrpcclient --output client
Set working directory
jzero gen -w /path/toSet quiet mode
jzero gen --quietSet debug mode
jzero gen --debugCustom CLI plugins
If built-in commands are not enough, jzero can dispatch unknown commands to external executables in PATH.
See Custom CLI plugins.