Genesis CLI¶
The command line tool for all things Genesis.
- Run
pnpm
scripts with specific environments defined intheme-settings.json
with run. - Execute
plop
generators withgenesis create
to quickly and efficiently scaffold content. See create for a list of available generators.
Installation & Usage¶
Installation:
pnpm add -g @mvps-genesis/cli
Example Usage:
genesis --help
Installation:
pnpm add -D @mvps-genesis/cli
Example Usage:
pnpm exec genesis --help
Commands¶
run¶
Run pnpm commands defined in your themes/genesis/package.json
using the environment variables from your theme-settings.json
Usage:
genesis run [pnpmScript] [env]
[pnpmScript]
- Corresponds to the PNPM Scripts availabile in your
themes/genesis/package.json
.
- Corresponds to the PNPM Scripts availabile in your
[env]
- Corresponds to the
environments
defined in yourthemes/genesis/themes-settings.json > environments
object.- Typically this is something like:
live
,staging
,dev
, etc.
- Typically this is something like:
- Corresponds to the
Example:
cd themes/genesis
# Examples
genesis run start dev
genesis run build live
create¶
Automate the scaffolding of Genesis features by using plop
generators.
genesis create [generatorName]
The following generators are available to run:
extension
- Create genesis, custom or optional extensions.package
- Create a new package in the genesis monorepo.page
- Create a new Genesis page.
Local Testing & Development¶
When working on this package in the monorepo you need to install it locally using the following command:
pnpm add -g @mvps-genesis/cli
cd packages/cli
pnpm link -g
Once installed you can use the packages/cli/package.json
> pnpm run watch
command to have webpack automatically update the dist/cli.js
when changing source code.
cd packages/cli
pnpm run watch
Alternatively, you can use run the $ _genesis
command to run off of lib/cli.js
and leverage VS Code's JavaScript Debug Terminal to debug the local source code; rather than the compiled dist/cli.js
.
_genesis quickstart
Bash/Zsh Tab-Completion¶
Powered by the tabtab package.
Installation¶
genesis install-completion
Note
You only have to run install-completion
once per machine.
This will inject something like this into your .bashrc
/ .zshrc
file:
# tabtab source for packages
# uninstall by removing these lines
[[ -f ~/.config/tabtab/__tabtab.zsh ]] && . ~/.config/tabtab/__tabtab.zsh || true
After restarting your terminal window you should be able to get tab-completions for all commands, options and sub-commands for the genesis
CLI. Just hit the Tab key after typing genesis
in your terminal.
Un-Installation¶
genesis uninstall-completion