helios-wp-cli v0.7.0
Helios WP CLI
Development tool for scaffolding and developing WordPress projects.
This is mainly an internal tool for Helios Design Labs, but you're welcome to use it if you find it useful.
Install
npm i -g helios-wp-cli
Usage
helios-wp create [element] [options]
Create a WordPress element (e.g. theme, plugin, block, etc.) from a provided template.
Arguments:
element Element to create
Options:
-o, --output <output> Output directory
-n, --name <name> The name of the element (e.g. theme, plugin, block)
-h, --help display help for command
Arguments
element
The type of element to create. If not provided, you will be prompted with a selectin of available elements.
Valid elements:
block
module
plugin
template
(Page template for a theme)theme
Options
output
(-o, --output)
The output directory. If not provided, you will be prompted to pick a theme or plugin to add the element to if applicable (e.g. for block
, module
or template
).
name
(-n, --name)
The name of the element. This will be used to generate slugs, namespaces, function names, etc.
Example
$ helios-wp create theme -o ~/projects/example/wp-content/themes -n "Example Theme"
Further notes
Create command automatically updates all the text domains, info and function names so that they're ready to go right away.
If creating a theme or plugin, you will be given the option to create a workspace and scripts for the element in your root package.json
file. This will automatically add two custom webpack build scripts, one for dev (dev:[slug]
) and one for production mode (build:[slug]
) that will map to the correct element/workspace.