lawik

lawik

Nerves Core Team

The improved NervesHub CLI

NervesHub has had a CLI for a long time. It is called nerves_hub_cli and for the longest time you’d add it as a dependency. But only once you found out it existed, which took me a minute…

A while back it was changed to be an escript that you could get separately from your mix project. That was a big improvement, thanks to @gus.

And thanks to various efforts by Gus and @joshknz we now have it wrapped up in a Burrito, vastly improved experience throughout the CLI and it can even be installed via Homebrew or curl.

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

You can then run this to set up your instance and then authenticate:

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

From there you can nh device list or nh device cert import until you are satisfied. Essentially it exposes all the typical clicking around you would do in the UI to set things up meaning NervesHub is really, really scriptable and friendly to automation.

We also have direct API integration of course. The Swagger UI is right here for NervesCloud (me and Josh’s hosted NervesHub service).

This has been available for a bit so I figured I’d give a brief update, especially since a lot of folks don’t even know there is a CLI :slight_smile:

First Post!

D4no0

D4no0

This is pretty nice. For some reason previously when I tried to install it using mix archives, the command never worked without specifying the full path to the escript.

As someone who just dived into this a few months ago, I expected that the CLI was doing only local stuff. It was pretty confusing at first to find out that it’s a mixed bag of both local commands and the ones that require an active connection to a instance of nerveshub_web. The way you set local state (like organization selection) in it it’s also a bit confusing and I would be in favor of explicit long commands honestly.

Most Liked

lawik

lawik

Nerves Core Team

The mix of local and remote can definitely be a bit confusing. The fundamental design was established way back and we haven’t gone over that. Not sure when we will since it does work quite well. One big upside of the mixture is that creating a firmware signing key for an org will also put it on the NervesHub instance instead of being a separate step.

For the org and product stuff, you can just not set env vars or those values and explicitly run with --org and --product to whatever extent needed.

Last Post!

D4no0

D4no0

If it works in practice, then that is great. In my case most probably it was the learning curve, as there are a lot of things to unpack at once if you are just starting out, especially since I was also setting up nerveshub_web locally at the same time.

Where Next?

Popular in News & Updates Top

fhunleth
We recently released Nerves 1.4.0 and an update to the Nerves new project generator, nerves_bootstrap. The biggest change is support for ...
New
fhunleth
Nerves systems provide the operating system, libraries and other tools for building firmware for specific hardware. The Nerves Core Team ...
New
jjcarstens
I know you might be thinking ¬ “Why make another SSH daemon wrapper when there already exists many like sshex and esshd??” Well, grea...
New
hugobarauna
This post announces the Livebook desktop app, a way to install Livebook on your machine without the requirement to have Elixir installed ...
New
zachdaniel
Join us for our first Ash Office Hours next Thursday at 6PM EST! Myself and anyone from the core team who can make it will be answering q...
New
mat-hek
Hi everyone, I’d like to share with you a new library from the Membrane team - Boombox. It’s a simple streaming tool built on top of Mem...
New
bartblast
Hi friends, I wanted to share an update on Hologram that’s been on my mind lately. After nearly 3 years of full-time work on Hologram, ...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49134 226
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement