Generate plugin

A plugin to generate a basic structure for a new Magnolia CLI plugin.

Package name

@magnolia/cli-generate-plugin

Repository link

Latest version

Magnolia CLI generate plugin - latest version tag

Changelog link

For instructions how to create and test new plugins, please refer to the following pages:

Installing

This plugin comes pre-installed and is ready to be used.

You must install it manually for use in an already initialized project (containing the mgnl.config.js file).

Usage

Command

generate-plugin [options]

Options

Form (short and long) Description

-n <name>

--name <name>

Sets the name of the plugin.

-c <name>

--class <name>

Sets the name of the plugin’s main class.

-v

--version

Displays the version.

-h

--help

Displays help information.

Examples

Each example command creates the new plugin in the current working directory. If you’re not in an empty directory, create it first and change to it:

mkdir testPluginFolder
cd testPluginFolder

Then, execute the generate-plugin command.

For more information about creating plugins, refer to Creating plugins page.

Generate a new plugin

npx @magnolia/cli generate-plugin

This command creates a new plugin.

The plugin will prompt you to enter the:

  • Name of the plugin.

  • Name of the plugin’s main class.

Generate a new plugin with a specific name

npx @magnolia/cli generate-plugin --name "test-plugin"

This command creates a new plugin called test-plugin.

The plugin will prompt you to enter the name of the plugin’s main class.

Generate a new plugin with a specific class name

npx @magnolia/cli generate-plugin --class "test-plugin"

This command creates a new plugin with test-plugin as plugin’s main class.

The plugin will prompt you to enter the name of the plugin.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Magnolia CLI docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules