The Plugin Generator integrates with the Magnolia Command Line Interface (CLI). Its primary function is to easily create a new plugin from a template which would be compatible with CLI.
The Plugin Generator is pre-installed in the Magnolia CLI plugin-system and ready for used.
Available command-line options:
-
-n, --name <name>
, set the name of the plugin -
-c, --class-name <class-name>
, set the name of the plugin's main class
If you don't provide these options, you'll be asked to enter the plugin and class name.
Additional Information:
- The
<name>
will also serve as the name in the 'package.json' file.
Usage Example
mkdir testPluginFolder
cd testPluginFolder
npx @magnolia/cli @magnolia/cli-plugin-generator --name "cli-test-plugin" --class-name "TestPlugin"
Upon executing the command, the following structure will be created:
/testPluginFolder
|-- /index.ts
|-- /tsconfig.json
|-- /cli-test-plugin.ts
|-- /package.json
|-- /package-lock.json
|-- /node_modules