Run the following command in a shell to install Magnolia CLI:
npm install @magnolia/cli -g
Depending on your permissions and the location where you have installed Node.js, you may have to execute the command above with root permissions. Without installation permissions you will notice messages such as npm ERR! in the shell.
On Linux or Mac OS X to run this command as root use:
sudo npm install @magnolia/cli -g
If the installation is successful, you see the following or a similar output in the shell:
If you already installed Magnolia CLI, update to the latest version:
npm update @magnolia/cli -g
Once you have installed Magnolia CLI, test the installation by running the following command in the shell:
mgnl help
Usage: mgnl <command> [options]
A tool to setup and facilitate light development with Magnolia CMS
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
jumpstart download and setup a Magnolia CMS instance for development.
start start up a Magnolia CMS instance. To stop it, enter CTRL+C
add-availability add component availability.
build scan a node_modules folder for npm packages with the keyword "magnolia-light-module" (in package.json) and extract them to a directory of choice.
create-component create a component and optionally add availability for it.
create-light-module create a light module.
create-page create a page template.
customize-local-config extract "mgnl-cli-prototypes" folder and "mgnl-cli.json" file to customize CLI configuration.
install install a light module from npm to the local Magnolia instance.
search search for a light module on npm.
tab-completion install tab autocomplete feature for Bash, zsh or PowerShell
help [cmd] display help for [cmd]
mgnl: 2.2.0 node: v6.11.0 os: darwin