CLI reference (nh)
Command reference for the nh CLI: auth, config, orgs, products, devices, firmware, signing keys, deployments, and CA certificates.
Written By Josh Kalderimis
Last updated About 2 months ago
nh is the NervesHub / NervesCloud command-line tool. Use it to sign and publish firmware, manage signing keys, and script fleet operations from CI.
Run nh help for the top-level list and nh help <command> for detail on any command.
Install
brew install nerves-hub/tap/nh
# or:
curl --proto '=https' --tlsv1.2 -fsSL \
https://raw.githubusercontent.com/nerves-hub/nerves_hub_cli/master/install.sh | sh
The curl installer places the nh binary in /usr/local/bin.
Connect and authenticate
nh defaults to NervesCloud (https://manage.nervescloud.com). Point it at a self-hosted instance, then authenticate:
nh config set uri "https://my.selfhosted.instance/"
nh user authGlobal commands
nh user: account
nh config: local settings
Valid keys: uri, org, product.
nh org: organization members
nh product: products & members
nh device: devices
Common options: --org, --product, --identifier, --description, --tag (repeatable), --cert, --key, --path.
nh firmware: firmware
nh key: firmware signing keys
nh deployment: deployment groups
The CLI uses deployment for what the web UI calls a deployment group.
nh cacert: organization CA certificates
Manage the Signer CAs used to verify device certificates. See Production setup with NervesKey.
Environment variables
Set these to run nh non-interactively (for example, in CI). Both NERVES_CLOUD_* and NERVES_HUB_* prefixes work.