Managing plugins

This page describes how you can install, uninstall, and update Magnolia CLI plugins in a project.

Below, FooPlugin (cli-foo-plugin) is just an example plugin name.

Installing

With add-plugin

  1. Install it using the following npm command. It installs the plugin and registers it in mgnl.config.js.

    npm run mgnl -- add-plugin cli-foo-plugin

Manually

  1. Run the following npm command.

    npm install cli-foo-plugin
  2. To make it available for the CLI, modify the mgnl.config.js file accordingly.

    • Before modification

    • After modification

    mgnl.config.js
    export default {
      plugins: [],
      logger: {
        filename: "./mgnl.error.log",
        fileLevel: "warn",
        consoleLevel: "debug"
      }
    };
    mgnl.config.js
    import FooPlugin from "cli-foo-plugin";
    
    export default {
      plugins: [
        new FooPlugin()
      ],
      logger: {
        filename: "./mgnl.error.log",
        fileLevel: "warn",
        consoleLevel: "debug"
      }
    };

Uninstalling

To uninstall a plugin:

  1. Delete it from the mgnl.config.js file.

    • Before deletion

    • After deletion

    mgnl.config.js
    import FooPlugin from "cli-foo-plugin";
    
    export default {
      plugins: [
        new FooPlugin()
      ],
      logger: {
        filename: "./mgnl.error.log",
        fileLevel: "warn",
        consoleLevel: "debug"
      }
    };
    mgnl.config.js
    export default {
      plugins: [],
      logger: {
        filename: "./mgnl.error.log",
        fileLevel: "warn",
        consoleLevel: "debug"
      }
    };
  2. Execute the following npm command:

    npm uninstall cli-foo-plugin

Updating

To update a plugin, run the following npm command. No modification of the mgnl.config.js file is necessary.

npm update cli-foo-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