balena-cli inconsistancies with 'balena device' command subset

Hi guys,

I’ve noticed a few inconsistencies that have started to annoy me since I’ve noticed them. These are all in the ‘balena device’ subset of commands…

If we use balena devices, we get a list of devices. Good.

$ balena devices
ID UUID    DEVICE NAME   DEVICE TYPE APPLICATION NAME STATUS IS ONLINE SUPERVISOR VERSION OS VERSION
35 7341412 still-glitter jetson-nano triage           Idle   true      11.14.0            balenaOS 2.60.1+rev1

Now to bring up the information on that device, the help says:

$ balena help --verbose
USAGE
$ balena [COMMAND] [OPTIONS]

PRIMARY COMMANDS
........
  devices                                list all devices
  device <uuid>

Using the shortened UUID as per the output of balena devices, we get:

$ balena device 7341412
BalenaDeviceNotFound: Device not found: 7341412

Ok, what about the DEVICE NAME field… Nope:

$ balena device still-glitter
BalenaDeviceNotFound: Device not found: still-glitter

But when we use the ID:

$ balena device 35
== STILL GLITTER
ID:                    35
DEVICE TYPE:           jetson-nano
STATUS:                idle
IS ONLINE:             true
IP ADDRESS:            10.1.1.194
......
UUID:                  73414124ca8ab35699814c985d555a02

So now we can get the full UUID, which also seems to work:

$ balena device 73414124ca8ab35699814c985d555a02
== STILL GLITTER
ID:                    35
DEVICE TYPE:           jetson-nano
STATUS:                idle
IS ONLINE:             true
IP ADDRESS:            10.1.1.194

So, what should I suggest to make this command set logical and follow what the help actually states?

Should it also match the shortened UUID? Should the documentation / help say to use the ID and not UUID? Should it be something else?

Thanks in advance.

Hello Steve,

Thanks for reaching out. On balena CLI version v12.12.0
Both commands balena device <short-UUID> and balena device <full-UUID> works for me. I haven’t tried using balena device <ID> yet and TIL that it works as well. I am not sure, device field ever worked though which is why there is no mention of balena device <device-name> in the documentation or command help that I pasted below.

➜  ~ balena help device --verbose
Show info about a single device.

USAGE
  $ balena device <uuid>

ARGUMENTS
  <uuid>  the device uuid

OPTIONS
  -h, --help  show CLI help

DESCRIPTION
  Show information about a single device.

EXAMPLE
  $ balena device 7cf02a6

Regarding documentation/help, I would say UUID is the recommended way to go. I feel we can start by investigating why balena device <short-UUID> didn’t work for you.

I’m using a newer client - could this be a regression?

$ balena --version
12.28.2

Against open-balena 3.1.1.

Hi

There are some known issues with balena CLI and openBalena - see this issue for more information about it - https://github.com/balena-io/balena-cli/issues/1610

Can you downgrade your CLI to v12.2.2 -