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.
npm i -g helios-wp-cli
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
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
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.
$ helios-wp create theme -o ~/projects/example/wp-content/themes -n "Example Theme"
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.