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. | 
Listing installed plugins
To list the plugins installed (registered), run the following npm command.
npm run mgnlInstalling
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-pluginWindows users using PowerShell must enclose the two consecutive hyphens ( --) in quotes:npm run mgnl "--" ...
Manually
- 
Run the following npm command. npm install cli-foo-plugin
- 
To make it available for the CLI, modify the mgnl.config.jsfile accordingly.mgnl.config.jsexport default { plugins: [], logger: { filename: "./mgnl.error.log", fileLevel: "warn", consoleLevel: "debug" } };mgnl.config.jsimport 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.jsfile.mgnl.config.jsimport FooPlugin from "cli-foo-plugin"; export default { plugins: [ new FooPlugin() ], logger: { filename: "./mgnl.error.log", fileLevel: "warn", consoleLevel: "debug" } };mgnl.config.jsexport default { plugins: [], logger: { filename: "./mgnl.error.log", fileLevel: "warn", consoleLevel: "debug" } };
- 
Execute the following npm command: npm uninstall cli-foo-plugin