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
-
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
-
Run the following npm command.
npm install cli-foo-plugin
-
To make it available for the CLI, modify the
mgnl.config.js
file accordingly.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:
-
Delete it from the
mgnl.config.js
file.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" } };
-
Execute the following npm command:
npm uninstall cli-foo-plugin