You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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:

/usr/bin/mgnl -> /usr/lib/node_modules/@magnolia/cli/bin/mgnl.js

> spawn-sync@1.0.15 postinstall /usr/lib/node_modules/@magnolia/cli/node_modules/spawn-sync
> node postinstall

+ @magnolia/cli@2.2.0
added 209 packages in 11.40

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-app              create an app.
  create-block            create a block.
  create-component        create a component and optionally add availability for it.
  create-content-type     create a content type.
  create-light-module     create a light module.
  create-page             create a page template.
  create-virtual-uri      create a virtual uri mapping.
  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
  version                 display mgnl and node.js versions
  help [cmd]              display help for [cmd]
  mgnl: 3.1.0 node: v8.10.0 os: linux
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels