Installation

Install Node.js

The CLI is available as a JavaScript package and requires Node.js to run. If you have Node.js installed you can install the CLI using a JavaScript package manager. For instance, you can use npm, which comes with Node.js, or alternative package managers like Yarn.

Installation instructions for Node.js and npm can be found here.

Install the CLI

We recommend installing the CLI globally. Installing the CLI globally makes sure it can be used in all your projects. For that reason all examples in this documentation will assume a global installation.

npm install --global @extrahorizon/exh-cli

For more advanced uses, the CLI can be installed in your project as a development dependency.

npm install --save-dev @extrahorizon/exh-cli

Check if the installation worked

When installed globally, trying running the following command in your Terminal to verify whether it's installed correctly.

exh --help 

this should give you the following response:

exh <command>

Commands:
  exh completion               Install shell completion for bash & zsh
  exh data <command>           Manage data
  exh dispatchers <command>    Manage Dispatchers within Extra Horizon
  exh localizations <command>  Manage localizations
  exh login                    Retrieve credentials from ExH
  exh sync                     Sync your ExH configuration to the cloud
                               environment
  exh tasks <command>          Manage tasks
  exh templates <command>      Manage templates
  exh whoami                   Shows the currently logged in user

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

If the command isn't recognized, it might be because the yarn global bin folder isn't in your PATH.

In case your are using bash, you can add export PATH="$PATH:$(yarn global bin)" to your ~/.bash_profile and reload it with source ~/.bash_profile

When installed as a development dependency, run the following command to verify the CLI is working correctly:

npx exh --help

Completion

Enable auto-complete for shell commands with:

exh completion

This command updates either your ~/.zshrc or ~/.bashrc file, depending on your shell. Reload your shell using:

source ~/.zshrc   # For Zsh

or

source ~/.bashrc  # For Bash

Now, you can use the tab key to complete commands and view command arguments by typing and pressing tab.

Last updated