Run the following command in a shell:

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 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/local/bin/mgnl -> /usr/local/lib/node_modules/@magnolia/cli/bin/mgnl.js
@magnolia/cli@1.0.0 /usr/local/lib/node_modules/@magnolia/cli
├── http@0.0.0
├── fs@0.0.2
├── progress@1.1.8
├── truncate-middle@1.0.4
├── replace-in-file@1.1.3
├── adm-zip@0.4.7
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── json2yaml@1.1.0 (remedial@1.0.7)
├── chalk@1.1.3 (supports-color@2.0.0, escape-string-regexp@1.0.5, ansi-styles@2.2.1, has-ansi@2.0.0, strip-ansi@3.0.1)
├── yaml-js@0.1.3
├── findup-sync@0.4.2 (detect-file@0.1.0, is-glob@2.0.1, resolve-dir@0.1.1, micromatch@2.3.11)
├── fs-extra@0.30.0 (path-is-absolute@1.0.0, jsonfile@2.3.1, klaw@1.3.0, graceful-fs@4.1.5, rimraf@2.5.4)
├── @magnolia/magnolia-build@0.5.1-snapshot-34 (path@0.12.7, fs-extra@0.26.7)
├── request@2.74.0 (aws-sign2@0.6.0, tunnel-agent@0.4.3, oauth-sign@0.8.2, forever-agent@0.6.1, is-typedarray@1.0.0, caseless@0.11.0, stringstream@0.0.5, aws4@1.4.1, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.3.1, qs@6.2.1, node-uuid@1.4.7, combined-stream@1.0.5, mime-types@2.1.11, form-data@1.0.0-rc4, hawk@3.1.3, bl@1.1.2, http-signature@1.1.1, har-validator@2.0.6)
└── async@2.0.1 (lodash@4.14.2)

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]


  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 a light module.
    tab-completion           install tab autocomplete feature for Bash, zsh or PowerShell
    help [cmd]               display help for [cmd]

  A tool to setup and facilitate light development with Magnolia CMS

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
  
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels