This is a CLI tool to scaffold a new plugin based on the DevriX plugin boilerplate.
composer global require devrix/scaffold
Note: Make sure to place the
~/.composer/vendor/bin
directory (or the equivalent directory for your OS) in your PATH so thedx-scaffold
executable can be located by your system.
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
After installing the composer package cd
to the wp-content/plugins
directory.
Then run the following command to start the interactive CLI:
dx-scaffold plugin new
You can predefine the plugin attributes by specifying them as arguments:
name=""
- The name of the plugin.slug=""
- The slug of the plugin.class=""
- The main class of the plugin.namespace=""
- The namespace of the plugin.abbr=""
- The abbreviation to use for global variables.
Example usage:
dx-scaffold name="DevriX" slug="devrix" class="Devrix" namespace="DX" abbr="DX"
You can also skip parts of the interactive CLI by specifying a --skip
flag.
--skip-clone
- Skips the git clone step.--skip-rename
- Skips the renaming/search-replace step.--skip-npm
- Skipsnpm install
andnpm run prod
.
MIT DevriX