nh CLI provides a subcommand for every NervesHub resource — organizations, products, devices, firmware, deployment groups, signing keys, CA certificates, and more. Every command and subcommand accepts --help to print detailed usage, available flags, and examples directly in your terminal.
User Commands
Manage your NervesHub identity and session.Organization Commands
List, inspect, and manage members of your NervesHub organizations.admin, manage, view.
Inviting members and changing roles requires the
admin role.Product Commands
Create and manage products within your organization. A product groups a fleet of devices that share the same firmware lineage.Device Commands
Manage individual devices, trigger remote actions, access consoles, and view logs.Remote Access
Logs
Remote Code Execution
Network Identities and Certificates
Firmware Commands
Upload, inspect, download, and delete firmware artifacts. Firmware files use the fwup.fw format and are signed before upload.
Upload Firmware
upload is also available as nh firmware publish. Key flags:
If no
path is provided, nh firmware upload looks for a .fw file in the current directory. When --key is omitted, the key configured in your CLI settings or NERVES_HUB_FW_PRIVATE_KEY is used.Deployment Group Commands
Deployment groups target a subset of devices (by tag and version condition) and control how firmware rolls out, including concurrency limits and failure thresholds. The CLI still spells the commanddeployment.
Signing Key Commands
Firmware signing keys are managed per-organization. A public key is stored in NervesHub; the private key never leaves your machine.CA Certificate Commands
CA certificates are used to bootstrap device identity through mutual TLS (mTLS). Devices that present a certificate signed by a registered CA are automatically authenticated.CA certificate commands require the
admin role.Iroh P2P Endpoint Commands
Iroh endpoints enable direct peer-to-peer device connections without routing traffic through the NervesHub server — useful for low-latency console access or large file transfers.Script Commands
Scripts are reusable Elixir code snippets stored in NervesHub that can be executed on devices remotely.Creating, updating, and deleting scripts requires
manage. Running an existing script only requires view.Config Commands
Read and write thenh CLI configuration, and manage named profiles for switching between environments.
Migration
nh migrate once if you previously used the Elixir nerves_hub_cli. It reads that CLI’s data directory (~/.nerves-hub, or $NERVES_HUB_HOME) and copies your saved defaults, API token, and signing keys into nh’s own data directory. Signing keys are re-encoded rather than decrypted, so no key password is required and password-protected keys keep theirs.
Every
nh command supports --output json (or -o json) for machine-readable output. Use this flag when integrating nh into scripts, CI pipelines, or tooling that needs to parse the response programmatically.
