Skip to content

Commit 6c7055a

Browse files
committed
Update commands for CLI v20
Change-type: patch
1 parent efa1d62 commit 6c7055a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you have any questions about this masterclass as you proceed through it, or w
2727
It is assumed that the reader has access to the following:
2828

2929
- A locally cloned copy of this repository [Balena CLI Advanced Masterclass](https://github.com/balena-io/balena-cli-advanced-masterclass) using either `git clone https://github.com/balena-io/balena-cli-advanced-masterclass.git` or by downloading the ZIP file (from 'Code'->'Download ZIP') and then unzipping it to a suitable directory
30-
- A balena supported device, such as a [Raspberry Pi 3B+](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) or an [Intel NUC](https://www.intel.co.uk/content/www/uk/en/products/boards-kits/nuc.html). If you don't have a device, you can emulate an Intel NUC by installing VirtualBox and following [this guide](https://www.balena.io/blog/no-hardware-use-virtualbox/). In this guide, we'll be using a Raspberry Pi 4 device.
30+
- A balena supported device, such as a [Raspberry Pi 5](https://www.raspberrypi.org/products/raspberry-pi-5/) or an [Intel NUC](https://www.intel.co.uk/content/www/uk/en/products/boards-kits/nuc.html). If you don't have a device, you can emulate an Intel NUC by installing VirtualBox and following [this guide](https://www.balena.io/blog/no-hardware-use-virtualbox/). In this guide, we'll be using a Raspberry Pi 4 device.
3131
- A suitable text editor for developing code on your development platform (e.g. [Visual Code](https://code.visualstudio.com/))
3232
- A suitable shell environment for command execution (such as `bash` or `zsh`)
3333
- A [balenaCloud](https://dashboard.balena-cloud.com/signup) account and a [balenaCloud staging](https://dashboard.balena-staging.com/signup) account
@@ -99,7 +99,7 @@ balenaUrl: 'balena-staging.com'
9999
Now try listing the fleets from the staging environment again:
100100

101101
```shell
102-
$ balena fleets
102+
$ balena fleet list
103103
Id App name Slug Device type Device count Online devices
104104
────── ─────────────────── ──────────────────────────────────────── ─────────────── ──────────── ──────────────
105105
146558 fleetOne ryanh/fleetone intel-nuc 0 0
@@ -182,14 +182,14 @@ You can now switch between environments by changing directory to the one with th
182182

183183
```shell
184184
$ cd ~/balenaStaging
185-
$ balena fleets
185+
$ balena fleet list
186186
Id App name Slug Device type Device count Online devices
187187
────── ─────────────────── ──────────────────────────────────────── ─────────────── ──────────── ──────────────
188188
146558 fleetOne ryanh/fleetone intel-nuc 0 0
189189
146559 fleetTwo ryanh/fleettwo raspberrypi4-64 0 0
190190

191191
$ cd ~/balenaProduction
192-
$ balena fleets
192+
$ balena fleet list
193193
Id App name Slug Device type Device count Online devices
194194
─────── ────────────── ──────────────────── ─────────────── ──────────── ──────────────
195195
1913403 balena-health ryanh/balena-health raspberrypi4-64 1 0
@@ -234,7 +234,7 @@ We should already have a device connecting to our previous 'cliFleet' (from the
234234

235235
```shell
236236
$ cd ~/balenaProduction
237-
$ balena devices
237+
$ balena device list
238238
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
239239
9272148 ee13198 wide-street raspberrypi4-64 ryanh/clifleet Idle true 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/ee13198bbda819053446a47a9ad98853/summary
240240
```
@@ -299,11 +299,11 @@ For a device running a development image, you can use `balena leave` and `balena
299299

300300
First, provision a device using a development image. You can do this using the balenaCloud dashboard's 'Add Device' downloading a 'Development' edition image from the `cliFleet` Fleet page. Provision your device with this image using either [balenaEtcher](https://www.balena.io/etcher/) or the [balena CLI].
301301

302-
Once the device is provisioned and has connected to the balena network, discover its hostname or IP address by using `balena devices`:
302+
Once the device is provisioned and has connected to the balena network, discover its hostname or IP address by using `balena device list`:
303303

304304
```shell
305305
$ cd ~/balenaProduction
306-
$ balena devices
306+
$ balena device list
307307
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
308308
9272148 ee13198 wide-street raspberrypi4-64 ryanh/clifleet Idle true 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/ee13198bbda819053446a47a9ad98853/summary
309309

@@ -371,7 +371,7 @@ We can now check the devices on the staging environment to ensure it's joined su
371371

372372
```shell
373373
$ cd ~/balenaStaging
374-
$ balena devices
374+
$ balena device list
375375
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
376376
446451 ee13198 steamed-thunder raspberrypi4-64 ryanh/stagingclifleet Idle false 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-staging.com/devices/ee13198bbda819053446a47a9ad98853/summary
377377
```
@@ -525,7 +525,7 @@ Note that you _must_ supply the device type, although the drive to write to is o
525525
Once provisioned, safely remove the SD card from you machine, insert it into your device and power it on. Shortly afterwards, it will connect to balenaCloud:
526526

527527
```shell
528-
$ balena devices
528+
$ balena device list
529529
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
530530
9272981 0b9df5c average-darkness raspberrypi4-64 ryanh/clifleet Idle true 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/0b9df5cf5a21f8ae903b4e8eb0d94ad9/summary
531531
```
@@ -605,7 +605,7 @@ $ balena push cliFleet
605605
Once built and pushed to the device, you should see the following logs:
606606
607607
```shell
608-
$ balena logs 0b9df5c
608+
$ balena device logs 0b9df5c
609609
[Logs] [11/11/2022, 10:38:35 AM] Installing service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
610610
[Logs] [11/11/2022, 10:38:35 AM] Installed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
611611
[Logs] [11/11/2022, 10:38:35 AM] Starting service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
@@ -624,10 +624,10 @@ As you can see in `helloworld.js`, it looks like if we set the `LOG_DEBUG` envir
624624
$ balena env add LOG_DEBUG true --fleet cliFleet
625625
```
626626
627-
Now go to the dashboard for the `cliFleet` Fleet, and select 'variables'. 'Add' a new variable, called `DASH_VAR` and set it to `from-dash`. To verify we've now set our variables, let's use `balena envs` which will show all the environment variables set for our Fleet:
627+
Now go to the dashboard for the `cliFleet` Fleet, and select 'variables'. 'Add' a new variable, called `DASH_VAR` and set it to `from-dash`. To verify we've now set our variables, let's use `balena env list` which will show all the environment variables set for our Fleet:
628628
629629
```shell
630-
$ balena envs --fleet cliFleet
630+
$ balena env list --fleet cliFleet
631631
ID NAME VALUE FLEET SERVICE
632632
676489 DASH_VAR from-dash ryanh/clifleet *
633633
676488 LOG_DEBUG true ryanh/clifleet *
@@ -636,7 +636,7 @@ ID NAME VALUE FLEET SERVICE
636636
As you can see, both variables now show up in our list. However, if we now list the logs for the device, we'll see something else:
637637
638638
```shell
639-
$ balena logs 0b9df5c
639+
$ balena device logs 0b9df5c
640640
[Logs] [11/11/2022, 10:41:39 AM] Killed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
641641
[Logs] [11/11/2022, 10:41:40 AM] Installing service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
642642
[Logs] [11/11/2022, 10:41:41 AM] Installed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
@@ -654,7 +654,7 @@ When we set the environment variable, the Supervisor on the device noted that th
654654
655655
```shell
656656
$ balena env rm 676488 --yes
657-
$ balena envs --fleet cliFleet
657+
$ balena env list --fleet cliFleet
658658
ID NAME VALUE FLEET SERVICE
659659
676489 DASH_VAR from-dash ryanh/clifleet *
660660
```
@@ -664,7 +664,7 @@ Note that we used the `--yes` switch to force the deletion of the variable. With
664664
Wait a little while to let the Supervisor see that the environment variable has been deleted, and then look at the logs again:
665665
666666
```shell
667-
$ balena logs 0b9df5c
667+
$ balena device logs 0b9df5c
668668
[Logs] [11/11/2022, 10:45:07 AM] Service exited 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
669669
[Logs] [11/11/2022, 10:45:07 AM] Killed service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
670670
[Logs] [11/11/2022, 10:45:08 AM] Installing service 'main sha256:2a357357dc8ac0cf055418c5d8e9ebfe6d499e5a8e6dfd378c76b1b355e8bf37'
@@ -722,7 +722,7 @@ If we hadn't specified the `latest` commit, we'd have been given an interactive
722722
723723
Now provision your device using the resulting image using `balena os initialize` or balenaEtcher. Once booted look at the logs for that device and notice that no download ocurred, and the Supervisor immediately started the preloaded application.
724724
725-
`balena preload` has a wealth of switches, and can modify the device significantly. It's well worth familiarizing yourself with the options [here](https://github.com/balena-io/balena-cli/blob/master/docs/balena-cli.md#preload).
725+
`balena preload` has a wealth of switches, and can modify the device significantly. It's well worth familiarizing yourself with the options [here](https://docs.balena.io/reference/balena-cli/latest/#preload).
726726
727727
#### 5.2 Preregistering a Device
728728
@@ -733,7 +733,7 @@ We'll generate a unique key for the device first, which we'll then use to modify
733733
We'll verify that we're registering a device by first listing the devices currently associated with the `cliFleet` Fleet:
734734
735735
```shell
736-
$ balena devices --fleet cliFleet
736+
$ balena device list --fleet cliFleet
737737
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
738738
9272981 0b9df5c average-darkness raspberrypi4-64 ryanh/clifleet Idle true 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/0b9df5cf5a21f8ae903b4e8eb0d94ad9/**summary**
739739
```
@@ -768,7 +768,7 @@ https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting
768768
Now we'll look at the device list for the Fleet again:
769769
770770
```shell
771-
$ balena devices --fleet cliFleet
771+
$ balena device list --fleet cliFleet
772772
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
773773
9272981 0b9df5c average-darkness raspberrypi4-64 ryanh/clifleet Idle true 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/0b9df5cf5a21f8ae903b4e8eb0d94ad9/summary
774774
9273485 f494e3f tense-moon raspberrypi4-64 ryanh/clifleet N/a false N/a N/a https://dashboard.balena-cloud.com/devices/f494e3ff06df7dc5629208b2f2b01483/summary
@@ -813,7 +813,7 @@ Finally write it to the SD card, either using `balena os initialize` or balenaEt
813813
After it's been provisioned, power up the device again. You'll soon see our preregistered device come online:
814814
815815
```shell
816-
$ balena devices --fleet cliFleet
816+
$ balena device list --fleet cliFleet
817817
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
818818
9272981 0b9df5c average-darkness raspberrypi4-64 ryanh/clifleet Idle false 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/0b9df5cf5a21f8ae903b4e8eb0d94ad9/summary
819819
9273485 f494e3f tense-moon raspberrypi4-64 ryanh/clifleet Idle true 14.0.14 balenaOS 2022.10.0 https://dashboard.balena-cloud.com/devices/f494e3ff06df7dc5629208b2f2b01483/summary
@@ -832,7 +832,7 @@ Once the device is online and connected to the balenaCloud infrastructure,
832832
verify this with:
833833
834834
```shell
835-
$ balena devices --fleet cliFleet
835+
$ balena device list --fleet cliFleet
836836
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
837837
9273603 b397534 still-sun raspberrypi4-64 ryanh/clifleet Idle true 14.0.8 balenaOS 2.99.27 https://dashboard.balena-cloud.com/devices/b3975341060c1c0f6297576092924fbf/summary
838838
```
@@ -853,7 +853,7 @@ If we hadn't passed the `--version` switch, balena CLI would have asked us to ch
853853
Finally, let's run `balena devices` again to see the new version of the device:
854854
855855
```shell
856-
$ balena devices --fleet cliFleet
856+
$ balena device list --fleet cliFleet
857857
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
858858
9273603 b397534 still-sun raspberrypi4-64 ryanh/clifleet Idle true 14.3.0 balenaOS 2.106.2 https://dashboard.balena-cloud.com/devices/b3975341060c1c0f6297576092924fbf/summary
859859
```

0 commit comments

Comments
 (0)