Command-line tools

Introducing the NervesHub command-line tools aka. the CLI.

Installation

The easiest way to install is via Homebrewarrow-up-right.

brew install nerves-hub/tap/nh

The second easiest is via curl:ing a shell script.

curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/nerves-hub/nerves_hub_cli/master/install.sh | sh

More details and alternative installation methods are available in the repoarrow-up-right.

Setup

To set your NervesHub instance to use with the CLI, use this command, replacing the specific URL with your instance:

nh config set uri "https://manage.nervescloud.com/"

You need to be authorized with the NervesHub instance, you get that via:

nh user auth

If you want to pass fewer arguments on later calls we can recommend setting up some environment variables in your shell. Usually that means ~/.bashrc or ~/.zshrc. The most commonly needed is the org:

NERVES_HUB_ORG="my-org-name-here"

Try it out

You can start with the help function which gives you a lot of your options:

To list devices for example:

This should get you started with the CLI.

Last updated

Was this helpful?