2020-10-20 21:11:17 +00:00
|
|
|
# balena CLI Documentation
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-10-20 21:11:17 +00:00
|
|
|
The balena CLI is a Command Line Interface for [balenaCloud](https://www.balena.io/cloud/) or
|
2020-09-18 14:35:36 +00:00
|
|
|
[openBalena](https://www.balena.io/open/). It is a software tool available for Windows, macOS and
|
|
|
|
Linux, used through a command prompt / terminal window. It can be used interactively or invoked in
|
2020-10-20 21:11:17 +00:00
|
|
|
scripts. The balena CLI builds on the [balena API](https://www.balena.io/docs/reference/api/overview/)
|
2020-09-18 14:35:36 +00:00
|
|
|
and the [balena SDK](https://www.balena.io/docs/reference/sdk/node-sdk/), and can also be directly
|
2020-10-20 21:11:17 +00:00
|
|
|
imported in Node.js applications. The balena CLI is an [open-source project on
|
2020-09-18 14:35:36 +00:00
|
|
|
GitHub](https://github.com/balena-io/balena-cli/), and your contribution is also welcome!
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
## Installation
|
2017-01-18 15:57:52 +00:00
|
|
|
|
2020-10-20 21:11:17 +00:00
|
|
|
Check the [balena CLI installation instructions on
|
2020-09-18 14:35:36 +00:00
|
|
|
GitHub](https://github.com/balena-io/balena-cli/blob/master/INSTALL.md).
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-09-18 14:35:36 +00:00
|
|
|
## Choosing a shell (command prompt/terminal)
|
2018-12-27 20:33:12 +00:00
|
|
|
|
2019-04-29 15:33:09 +00:00
|
|
|
On **Windows,** the standard Command Prompt (`cmd.exe`) and
|
|
|
|
[PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-6)
|
2020-09-18 14:35:36 +00:00
|
|
|
are supported. Alternative shells include:
|
2018-03-12 19:06:21 +00:00
|
|
|
|
2019-10-09 15:32:54 +00:00
|
|
|
* [MSYS2](https://www.msys2.org/):
|
|
|
|
* Install additional packages with the command:
|
2021-03-22 16:03:44 +00:00
|
|
|
`pacman -S git gcc make openssh p7zip`
|
2019-10-09 15:32:54 +00:00
|
|
|
* [Set a Windows environment variable](https://www.onmsft.com/how-to/how-to-set-an-environment-variable-in-windows-10): `MSYS2_PATH_TYPE=inherit`
|
|
|
|
* Note that a bug in the MSYS2 launch script (`msys2_shell.cmd`) makes text-based interactive CLI
|
|
|
|
menus to break. [Check this Github issue for a
|
|
|
|
workaround](https://github.com/msys2/MINGW-packages/issues/1633#issuecomment-240583890).
|
2021-03-19 15:25:38 +00:00
|
|
|
|
2021-03-22 16:03:44 +00:00
|
|
|
* [MSYS](http://www.mingw.org/wiki/MSYS)
|
2019-05-25 21:11:26 +00:00
|
|
|
* [Git for Windows](https://git-for-windows.github.io/)
|
2019-11-20 23:35:17 +00:00
|
|
|
* During the installation, you will be prompted to choose between _"Use MinTTY"_ and _"Use
|
|
|
|
Windows' default console window"._ Choose the latter, because of the same [MSYS2
|
|
|
|
bug](https://github.com/msys2/MINGW-packages/issues/1633) mentioned above (Git for Windows
|
|
|
|
actually uses MSYS2). For a screenshot, check this
|
|
|
|
[comment](https://github.com/balena-io/balena-cli/issues/598#issuecomment-556513098).
|
2021-03-19 15:25:38 +00:00
|
|
|
|
2019-10-09 15:32:54 +00:00
|
|
|
* Microsoft's [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about)
|
|
|
|
(WSL). In this case, a Linux distribution like Ubuntu is installed via the Microsoft Store, and a
|
2020-10-20 21:11:17 +00:00
|
|
|
balena CLI release **for Linux** should be selected. See
|
|
|
|
[FAQ](https://github.com/balena-io/balena-cli/blob/master/TROUBLESHOOTING.md) for using the
|
|
|
|
balena CLI with WSL and Docker Desktop for Windows.
|
2018-03-12 19:06:21 +00:00
|
|
|
|
2020-09-18 14:35:36 +00:00
|
|
|
On **macOS** and **Linux,** the standard terminal window is supported. Optionally, `bash` command
|
2019-04-29 15:33:09 +00:00
|
|
|
auto completion may be enabled by copying the
|
2021-02-28 20:40:25 +00:00
|
|
|
[balena_comp](https://github.com/balena-io/balena-cli/blob/master/completion/balena-completion.bash)
|
2019-04-29 15:33:09 +00:00
|
|
|
file to your system's `bash_completion` directory: check [Docker's command completion
|
|
|
|
guide](https://docs.docker.com/compose/completion/) for system setup instructions.
|
|
|
|
|
2020-09-18 14:35:36 +00:00
|
|
|
## Logging in
|
2018-03-12 19:06:21 +00:00
|
|
|
|
2019-04-29 15:33:09 +00:00
|
|
|
Several CLI commands require access to your balenaCloud account, for example in order to push a
|
2021-07-15 13:41:38 +00:00
|
|
|
new release to your fleet. Those commands require creating a CLI login session by running:
|
2018-03-12 19:06:21 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
```sh
|
|
|
|
$ balena login
|
|
|
|
```
|
2018-03-12 19:06:21 +00:00
|
|
|
|
2020-09-18 14:35:36 +00:00
|
|
|
## Proxy support
|
2018-03-12 19:06:21 +00:00
|
|
|
|
2020-01-24 18:43:04 +00:00
|
|
|
HTTP(S) proxies can be configured through any of the following methods, in precedence order
|
|
|
|
(from higher to lower):
|
|
|
|
|
|
|
|
* The `BALENARC_PROXY` environment variable in URL format, with protocol (`http` or `https`),
|
|
|
|
host, port and optionally basic auth. Examples:
|
|
|
|
* `export BALENARC_PROXY='https://bob:secret@proxy.company.com:12345'`
|
|
|
|
* `export BALENARC_PROXY='http://localhost:8000'`
|
|
|
|
|
|
|
|
* The `proxy` setting in the [CLI config
|
|
|
|
file](https://www.npmjs.com/package/balena-settings-client#documentation). It may be:
|
|
|
|
* A string in URL format, e.g. `proxy: 'http://localhost:8000'`
|
|
|
|
* An object in the format:
|
|
|
|
```yaml
|
|
|
|
proxy:
|
|
|
|
protocol: 'http'
|
|
|
|
host: 'proxy.company.com'
|
|
|
|
port: 12345
|
|
|
|
proxyAuth: 'bob:secret'
|
|
|
|
```
|
|
|
|
|
|
|
|
* The `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables, in the same URL format as
|
|
|
|
`BALENARC_PROXY`.
|
|
|
|
|
2020-09-18 14:35:36 +00:00
|
|
|
### Proxy setup for balena ssh
|
2020-09-16 13:53:46 +00:00
|
|
|
|
|
|
|
In order to work behind a proxy server, the `balena ssh` command requires the
|
|
|
|
[`proxytunnel`](http://proxytunnel.sourceforge.net/) package (command-line tool) to be installed.
|
|
|
|
`proxytunnel` is available for Linux distributions like Ubuntu/Debian (`apt install proxytunnel`),
|
|
|
|
and for macOS through [Homebrew](https://brew.sh/). Windows support is limited to the [Windows
|
|
|
|
Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about) (e.g., by installing
|
|
|
|
Ubuntu through the Microsoft App Store).
|
|
|
|
|
|
|
|
Ensure that the proxy server is configured to allow proxy requests to ssh port 22, using
|
|
|
|
SSL encryption. For example, in the case of the [Squid](http://www.squid-cache.org/) proxy
|
|
|
|
server, it should be configured with the following rules in the `squid.conf` file:
|
|
|
|
`acl SSL_ports port 22`
|
|
|
|
`acl Safe_ports port 22`
|
2020-03-29 22:59:44 +00:00
|
|
|
|
2020-09-18 14:35:36 +00:00
|
|
|
### Proxy exclusion
|
2020-03-29 22:59:44 +00:00
|
|
|
|
|
|
|
The `BALENARC_NO_PROXY` variable may be used to exclude specified destinations from proxying.
|
|
|
|
|
2020-10-20 21:11:17 +00:00
|
|
|
> * This feature requires CLI version 11.30.8 or later. In the case of the npm [installation
|
2020-03-29 22:59:44 +00:00
|
|
|
> option](https://github.com/balena-io/balena-cli/blob/master/INSTALL.md), it also requires
|
|
|
|
> Node.js version 10.16.0 or later.
|
|
|
|
> * To exclude a `balena ssh` target from proxying (IP address or `.local` hostname), the
|
|
|
|
> `--noproxy` option should be specified in addition to the `BALENARC_NO_PROXY` variable.
|
|
|
|
|
|
|
|
By default (if `BALENARC_NO_PROXY` is not defined), all [private IPv4
|
|
|
|
addresses](https://en.wikipedia.org/wiki/Private_network) and `'*.local'` hostnames are excluded
|
|
|
|
from proxying. Other hostnames that resolve to private IPv4 addresses are **not** excluded by
|
|
|
|
default, because matching takes place before name resolution.
|
|
|
|
|
|
|
|
`localhost` and `127.0.0.1` are always excluded from proxying, regardless of the value of
|
|
|
|
BALENARC_NO_PROXY.
|
2020-01-24 18:43:04 +00:00
|
|
|
|
|
|
|
The format of the `BALENARC_NO_PROXY` environment variable is a comma-separated list of patterns
|
|
|
|
that are matched against hostnames or IP addresses. For example:
|
|
|
|
|
|
|
|
```
|
|
|
|
export BALENARC_NO_PROXY='*.local,dev*.mycompany.com,192.168.*'
|
|
|
|
```
|
|
|
|
|
2020-03-29 22:59:44 +00:00
|
|
|
Matched patterns are excluded from proxying. Wildcard expressions are documented at
|
|
|
|
[matcher](https://www.npmjs.com/package/matcher#usage). Matching takes place _before_ name
|
|
|
|
resolution, so a pattern like `'192.168.*'` will **not** match a hostname that resolves to an IP
|
|
|
|
address like `192.168.1.2`.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
## Support, FAQ and troubleshooting
|
2017-04-26 13:16:06 +00:00
|
|
|
|
2020-11-18 00:57:26 +00:00
|
|
|
To learn more, troubleshoot issues, or to contact us for support:
|
2017-04-26 13:16:06 +00:00
|
|
|
|
2020-11-18 00:57:26 +00:00
|
|
|
* Check the [masterclass tutorials](https://www.balena.io/docs/learn/more/masterclasses/overview/)
|
|
|
|
* Check our [FAQ / troubleshooting document](https://github.com/balena-io/balena-cli/blob/master/TROUBLESHOOTING.md)
|
2021-04-21 06:53:51 +00:00
|
|
|
* Ask us a question in the [balena forums](https://forums.balena.io/c/product-support)
|
2020-11-18 00:57:26 +00:00
|
|
|
|
|
|
|
For CLI bug reports or feature requests, check the
|
|
|
|
[CLI GitHub issues](https://github.com/balena-io/balena-cli/issues/).
|
2017-04-26 13:16:06 +00:00
|
|
|
|
2020-05-11 08:12:27 +00:00
|
|
|
## Deprecation policy
|
|
|
|
|
2020-10-20 21:11:17 +00:00
|
|
|
The balena CLI uses [semver versioning](https://semver.org/), with the concepts
|
2020-05-11 08:12:27 +00:00
|
|
|
of major, minor and patch version releases.
|
|
|
|
|
2020-10-20 21:11:17 +00:00
|
|
|
The latest release of a major version of the balena CLI will remain compatible with
|
2020-09-18 14:35:36 +00:00
|
|
|
the balenaCloud backend services for at least one year from the date when the
|
2021-06-25 23:42:07 +00:00
|
|
|
following major version is released. For example, balena CLI v11.36.0, as the
|
|
|
|
latest v11 release, would remain compatible with the balenaCloud backend for one
|
|
|
|
year from the date when v12.0.0 was released.
|
|
|
|
|
|
|
|
Half way through to that period (6 months after the release of the next major
|
|
|
|
version), older major versions of the balena CLI will start printing a deprecation
|
|
|
|
warning message when it is used interactively (when `stderr` is attached to a TTY
|
|
|
|
device file). At the end of that period, older major versions will exit with an
|
|
|
|
error message unless the `--unsupported` flag is used. This behavior was
|
|
|
|
introduced in CLI version 12.47.0 and is also documented by `balena help`.
|
|
|
|
To take advantage of the latest backend features and ensure compatibility, users
|
|
|
|
are encouraged to regularly update the balena CLI to the latest version.
|
2020-05-11 08:12:27 +00:00
|
|
|
|
2017-04-26 13:16:06 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
# CLI Command Reference
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- API Keys
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [api-key generate](#api-key-generate)
|
|
|
|
- [api-key revoke](#api-key-revoke)
|
|
|
|
- [api-keys](#api-keys)
|
2018-04-04 12:42:57 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- Apps
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [app create](#app-create)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
- Authentication
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [login](#login)
|
|
|
|
- [logout](#logout)
|
|
|
|
- [whoami](#whoami)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- Blocks
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [block create](#block-create)
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
- Config
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [config generate](#config-generate)
|
|
|
|
- [config inject](#config-inject)
|
|
|
|
- [config read](#config-read)
|
|
|
|
- [config reconfigure](#config-reconfigure)
|
|
|
|
- [config write](#config-write)
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
- Deploy
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [build](#build)
|
|
|
|
- [deploy](#deploy)
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- Devices
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [device deactivate](#device-deactivate)
|
|
|
|
- [device identify](#device-identify)
|
|
|
|
- [device](#device)
|
|
|
|
- [device init](#device-init)
|
2024-09-24 16:26:16 +00:00
|
|
|
- [device list](#device-list)
|
2024-09-30 17:56:48 +00:00
|
|
|
- [device local-mode](#device-local-mode)
|
|
|
|
- [device move](#device-move)
|
|
|
|
- [device os-update](#device-os-update)
|
|
|
|
- [device pin](#device-pin)
|
|
|
|
- [device public-url](#device-public-url)
|
|
|
|
- [device purge](#device-purge)
|
|
|
|
- [device reboot](#device-reboot)
|
|
|
|
- [device register](#device-register)
|
|
|
|
- [device rename](#device-rename)
|
|
|
|
- [device restart](#device-restart)
|
|
|
|
- [device rm](#device-rm)
|
|
|
|
- [device shutdown](#device-shutdown)
|
|
|
|
- [device start-service](#device-start-service)
|
|
|
|
- [device stop-service](#device-stop-service)
|
|
|
|
- [device track-fleet](#device-track-fleet)
|
|
|
|
- [devices supported](#devices-supported)
|
2021-09-29 14:05:41 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
- Environment Variables
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [env add](#env-add)
|
|
|
|
- [env rename](#env-rename)
|
|
|
|
- [env rm](#env-rm)
|
|
|
|
- [envs](#envs)
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- Fleets
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [fleet create](#fleet-create)
|
|
|
|
- [fleet](#fleet)
|
|
|
|
- [fleet pin](#fleet-pin)
|
|
|
|
- [fleet purge](#fleet-purge)
|
|
|
|
- [fleet rename](#fleet-rename)
|
|
|
|
- [fleet restart](#fleet-restart)
|
|
|
|
- [fleet rm](#fleet-rm)
|
|
|
|
- [fleet track-latest](#fleet-track-latest)
|
|
|
|
- [fleets](#fleets)
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
- Local
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [local configure](#local-configure)
|
|
|
|
- [local flash](#local-flash)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
- Logs
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [logs](#logs)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2019-06-05 22:17:59 +00:00
|
|
|
- Network
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [scan](#scan)
|
|
|
|
- [ssh](#ssh)
|
|
|
|
- [tunnel](#tunnel)
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
- Notes
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [notes](#notes)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
- Organizations
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [orgs](#orgs)
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2015-09-29 17:03:14 +00:00
|
|
|
- OS
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [os build-config](#os-build-config)
|
|
|
|
- [os configure](#os-configure)
|
|
|
|
- [os download](#os-download)
|
|
|
|
- [os initialize](#os-initialize)
|
|
|
|
- [os versions](#os-versions)
|
2015-09-29 17:03:14 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
- Platform
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [join](#join)
|
|
|
|
- [leave](#leave)
|
2023-11-07 22:33:48 +00:00
|
|
|
|
2017-10-25 11:17:07 +00:00
|
|
|
- Preload
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [preload](#preload)
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2018-06-26 16:59:44 +00:00
|
|
|
- Push
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [push](#push)
|
2018-06-26 16:59:44 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- Releases
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [release finalize](#release-finalize)
|
|
|
|
- [release](#release)
|
|
|
|
- [release invalidate](#release-invalidate)
|
|
|
|
- [release validate](#release-validate)
|
|
|
|
- [releases](#releases)
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
- Settings
|
2017-06-14 21:23:39 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [settings](#settings)
|
2017-06-14 21:23:39 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- SSH Keys
|
2018-04-04 12:42:57 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [key add](#key-add)
|
|
|
|
- [key](#key)
|
|
|
|
- [key rm](#key-rm)
|
|
|
|
- [keys](#keys)
|
2018-04-04 12:42:57 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
- Support
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [support](#support)
|
2023-11-07 22:33:48 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
- Tags
|
2018-04-04 12:42:57 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [tag rm](#tag-rm)
|
|
|
|
- [tag set](#tag-set)
|
|
|
|
- [tags](#tags)
|
2020-04-22 11:47:12 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
- Utilities
|
2020-04-22 11:47:12 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [util available-drives](#util-available-drives)
|
2020-04-22 11:47:12 +00:00
|
|
|
|
2023-11-08 14:44:32 +00:00
|
|
|
- Version
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
- [version](#version)
|
2023-11-08 14:44:32 +00:00
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# API Keys
|
2015-04-16 14:42:09 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## api-key generate
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Generate a new balenaCloud API key for the current user, with the given
|
|
|
|
name. The key will be logged to the console.
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
This key can be used to log into the CLI using 'balena login --token <key>',
|
|
|
|
or to authenticate requests to the API with an 'Authorization: Bearer <key>' header.
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena api-key generate "Jenkins Key"
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### NAME
|
2022-07-20 13:50:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the API key name
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## api-key revoke
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Revoke balenaCloud API keys with the given
|
|
|
|
comma-separated list of ids.
|
|
|
|
|
|
|
|
The given balenaCloud API keys will no longer be usable.
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2020-04-22 16:08:11 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena api-key revoke 123
|
|
|
|
$ balena api-key revoke 123,124,456
|
2020-04-22 16:08:11 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### IDS
|
2020-04-22 16:08:11 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the API key ids
|
2020-04-22 16:08:11 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## api-keys
|
2023-11-07 22:33:48 +00:00
|
|
|
|
|
|
|
Print a list of balenaCloud API keys.
|
|
|
|
|
|
|
|
Print a list of balenaCloud API keys for the current user or for a specific fleet with the `--fleet` option.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena api-keys
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -u, --user
|
|
|
|
|
|
|
|
show API keys for your user
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Apps
|
2022-07-20 13:45:39 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## app create
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Create a new balena app.
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
You can specify the organization the app should belong to using
|
2020-12-09 15:05:12 +00:00
|
|
|
the `--organization` option. The organization's handle, not its name,
|
|
|
|
should be provided. Organization handles can be listed with the
|
|
|
|
`balena orgs` command.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
The app's default device type is specified with the `--type` option.
|
2020-12-09 15:05:12 +00:00
|
|
|
The `balena devices supported` command can be used to list the available
|
|
|
|
device types.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-12-09 15:05:12 +00:00
|
|
|
Interactive dropdowns will be shown for selection if no device type or
|
|
|
|
organization is specified and there are multiple options to choose from.
|
|
|
|
If there is a single option to choose from, it will be chosen automatically.
|
|
|
|
This interactive behavior can be disabled by explicitly specifying a device
|
|
|
|
type and organization.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena app create MyApp
|
|
|
|
$ balena app create MyApp --organization mmyorg
|
|
|
|
$ balena app create MyApp -o myorg --type raspberry-pi
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-04-22 16:08:11 +00:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### NAME
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
app name
|
2020-04-22 16:08:11 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
### Options
|
|
|
|
|
2020-12-09 15:05:12 +00:00
|
|
|
#### -o, --organization ORGANIZATION
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
handle of the organization the app should belong to
|
2020-12-09 15:05:12 +00:00
|
|
|
|
2020-04-22 16:08:11 +00:00
|
|
|
#### -t, --type TYPE
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
app device type (Check available types with `balena devices supported`)
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
# Authentication
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## login
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Login to your balena account.
|
|
|
|
|
|
|
|
This command will prompt you to login using the following login types:
|
|
|
|
|
|
|
|
- Web authorization: open your web browser and prompt to authorize the CLI
|
|
|
|
from the dashboard.
|
|
|
|
|
|
|
|
- Credentials: using email/password and 2FA.
|
|
|
|
|
|
|
|
- Token: using a session token or API key from the preferences page.
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena login
|
|
|
|
$ balena login --web
|
|
|
|
$ balena login --token "..."
|
|
|
|
$ balena login --credentials
|
|
|
|
$ balena login --credentials --email johndoe@gmail.com --password secret
|
2021-07-15 13:41:38 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### TOKEN
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -w, --web
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
web-based login
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -t, --token
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
session token or API key
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -c, --credentials
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
credential-based login
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -e, --email EMAIL
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
email
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -u, --user USER
|
2020-09-25 09:00:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -p, --password PASSWORD
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
password
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -P, --port PORT
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
TCP port number of local HTTP login server (--web auth only)
|
|
|
|
|
|
|
|
#### -H, --hideExperimentalWarning
|
|
|
|
|
|
|
|
Hides warning for experimental features
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## logout
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Logout from your balena account.
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena logout
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## whoami
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Get the username and email address of the currently logged in user.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena whoami
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Blocks
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## block create
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
Create a new balena block.
|
2023-11-03 14:55:29 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
You can specify the organization the block should belong to using
|
2023-11-03 14:55:29 +00:00
|
|
|
the `--organization` option. The organization's handle, not its name,
|
|
|
|
should be provided. Organization handles can be listed with the
|
|
|
|
`balena orgs` command.
|
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
The block's default device type is specified with the `--type` option.
|
2023-11-03 14:55:29 +00:00
|
|
|
The `balena devices supported` command can be used to list the available
|
|
|
|
device types.
|
|
|
|
|
|
|
|
Interactive dropdowns will be shown for selection if no device type or
|
|
|
|
organization is specified and there are multiple options to choose from.
|
|
|
|
If there is a single option to choose from, it will be chosen automatically.
|
|
|
|
This interactive behavior can be disabled by explicitly specifying a device
|
|
|
|
type and organization.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
$ balena block create MyBlock
|
|
|
|
$ balena block create MyBlock --organization mmyorg
|
|
|
|
$ balena block create MyBlock -o myorg --type raspberry-pi
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-04-22 16:08:11 +00:00
|
|
|
### Arguments
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### NAME
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
block name
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -o, --organization ORGANIZATION
|
2020-10-14 10:02:02 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
handle of the organization the block should belong to
|
2020-10-14 10:02:02 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -t, --type TYPE
|
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
block device type (Check available types with `balena devices supported`)
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
# Config
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## config generate
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Generate a config.json file for a device or fleet.
|
|
|
|
|
|
|
|
The target balenaOS version must be specified with the --version option.
|
|
|
|
|
|
|
|
The '--dev' option is used to configure balenaOS to operate in development mode,
|
|
|
|
allowing anauthenticated root ssh access and exposing network ports such as
|
|
|
|
balenaEngine's 2375 (unencrypted). This option causes `"developmentMode": true`
|
|
|
|
to be inserted in the 'config.json' file in the image's boot partion. Development
|
|
|
|
mode (as a configurable option) is applicable to balenaOS releases from early
|
|
|
|
2022. Older releases have separate development and production balenaOS images
|
|
|
|
that cannot be reconfigured through 'config.json' or the '--dev' option. Do not
|
|
|
|
confuse the balenaOS "development mode" with a device's "local mode", the latter
|
|
|
|
being a supervisor feature that allows the "balena push" command to push a user's
|
|
|
|
application directly to a device in the local network.
|
|
|
|
|
|
|
|
The '--secureBoot' option is used to configure a balenaOS installer image to opt-in
|
|
|
|
secure boot and disk encryption.
|
|
|
|
|
|
|
|
To configure an image for a fleet of mixed device types, use the --fleet option
|
|
|
|
alongside the --deviceType option to specify the target device type.
|
|
|
|
|
|
|
|
To avoid interactive questions, specify a command line option for each question that
|
|
|
|
would otherwise be asked.
|
2020-10-14 10:02:02 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2020-10-14 10:02:02 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena config generate --device 7cf02a6 --version 2.12.7
|
|
|
|
$ balena config generate --device 7cf02a6 --version 2.12.7 --generate-device-api-key
|
|
|
|
$ balena config generate --device 7cf02a6 --version 2.12.7 --deviceApiKey <existingDeviceKey>
|
|
|
|
$ balena config generate --device 7cf02a6 --version 2.12.7 --output config.json
|
|
|
|
$ balena config generate --fleet myorg/fleet --version 2.12.7 --dev
|
|
|
|
$ balena config generate --fleet myorg/fleet --version 2.12.7 --secureBoot
|
|
|
|
$ balena config generate --fleet myorg/fleet --version 2.12.7 --deviceType fincm3
|
|
|
|
$ balena config generate --fleet myorg/fleet --version 2.12.7 --output config.json
|
|
|
|
$ balena config generate --fleet myorg/fleet --version 2.12.7 --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 15
|
2020-10-14 10:02:02 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --version VERSION
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
a balenaOS version
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -f, --fleet FLEET
|
2015-06-02 16:32:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet name or slug (preferred)
|
2016-01-12 13:07:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --dev
|
2015-12-03 14:22:22 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Configure balenaOS to operate in development mode
|
2015-12-03 14:22:22 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --secureBoot
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Configure balenaOS installer to opt-in secure boot and disk encryption
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --device DEVICE
|
2015-12-03 14:22:22 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device UUID
|
2015-12-03 14:22:22 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -k, --deviceApiKey DEVICEAPIKEY
|
2015-12-03 14:22:22 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
custom device key - note that this is only supported on balenaOS 2.0.3+
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --deviceType DEVICETYPE
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device type slug (run 'balena devices supported' for possible values)
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --generate-device-api-key
|
2016-01-12 13:07:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
generate a fresh device key for the device
|
2016-01-12 13:07:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -o, --output OUTPUT
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path of output file
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --network NETWORK
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the network type to use: ethernet or wifi
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --wifiSsid WIFISSID
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the wifi ssid to use (used only if --network is set to wifi)
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --wifiKey WIFIKEY
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the wifi key to use (used only if --network is set to wifi)
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --appUpdatePollInterval APPUPDATEPOLLINTERVAL
|
2020-06-23 10:01:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
supervisor cloud polling interval in minutes (e.g. for device variables)
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --provisioning-key-name PROVISIONING-KEY-NAME
|
2015-12-12 04:09:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
custom key name assigned to generated provisioning api key
|
2020-08-01 00:07:43 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --provisioning-key-expiry-date PROVISIONING-KEY-EXPIRY-DATE
|
2020-08-01 00:07:43 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
2023-08-22 14:28:53 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## config inject
|
2023-08-22 14:28:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Inject a 'config.json' file to a balenaOS image file or attached SD card or
|
|
|
|
USB stick.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Documentation for the balenaOS 'config.json' file can be found at:
|
|
|
|
https://www.balena.io/docs/reference/OS/configuration/
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena config inject my/config.json
|
|
|
|
$ balena config inject my/config.json --drive /dev/disk2
|
2015-04-27 14:51:26 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2015-04-27 14:51:26 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### FILE
|
2015-04-27 14:51:26 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the path to the config.json file to inject
|
2015-04-27 14:51:26 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2015-04-16 14:42:09 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --drive DRIVE
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## config read
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Read the 'config.json' file of a balenaOS image file or attached SD card or
|
|
|
|
USB stick.
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Documentation for the balenaOS 'config.json' file can be found at:
|
|
|
|
https://www.balena.io/docs/reference/OS/configuration/
|
2020-10-14 09:13:47 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena config read
|
|
|
|
$ balena config read --drive /dev/disk2
|
|
|
|
$ balena config read --drive balena.img
|
2020-10-14 09:13:47 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --drive DRIVE
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)
|
2020-10-14 09:13:47 +00:00
|
|
|
|
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## config reconfigure
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Interactively reconfigure a balenaOS image file or attached media.
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
This command extracts the device UUID from the 'config.json' file of the
|
|
|
|
chosen balenaOS image file or attached media, and then passes the UUID as
|
|
|
|
the '--device' argument to the 'balena os configure' command.
|
|
|
|
|
|
|
|
For finer-grained or scripted control of the operation, use the
|
|
|
|
'balena config read' and 'balena os configure' commands separately.
|
2020-10-14 09:13:47 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena config reconfigure
|
|
|
|
$ balena config reconfigure --drive /dev/disk3
|
|
|
|
$ balena config reconfigure --drive balena.img --advanced
|
2020-10-14 09:13:47 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --drive DRIVE
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -v, --advanced
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
show advanced commands
|
|
|
|
|
|
|
|
#### --version VERSION
|
|
|
|
|
|
|
|
balenaOS version, for example "2.32.0" or "2.44.0+rev1"
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## config write
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Write a key-value pair to the 'config.json' file of a balenaOS image file or
|
|
|
|
attached SD card or USB stick.
|
|
|
|
|
|
|
|
Documentation for the balenaOS 'config.json' file can be found at:
|
|
|
|
https://www.balena.io/docs/reference/OS/configuration/
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena config write ntpServers "0.resinio.pool.ntp.org 1.resinio.pool.ntp.org"
|
|
|
|
$ balena config write --drive /dev/disk2 hostname custom-hostname
|
|
|
|
$ balena config write --drive balena.img os.network.connectivity.interval 300
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### KEY
|
|
|
|
|
|
|
|
the key of the config parameter to write
|
|
|
|
|
|
|
|
#### VALUE
|
|
|
|
|
|
|
|
the value of the config parameter to write
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -d, --drive DRIVE
|
|
|
|
|
|
|
|
path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)
|
|
|
|
|
|
|
|
# Deploy
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## build
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Use this command to build an image or a complete multicontainer project with
|
|
|
|
the provided docker daemon in your development machine or balena device.
|
|
|
|
(See also the `balena push` command for the option of building images in the
|
|
|
|
balenaCloud build servers.)
|
|
|
|
|
|
|
|
You must specify either a fleet, or the device type and architecture.
|
|
|
|
|
|
|
|
This command will look into the given source directory (or the current working
|
|
|
|
directory if one isn't specified) for a docker-compose.yml file, and if found,
|
|
|
|
each service defined in the compose file will be built. If a compose file isn't
|
|
|
|
found, it will look for a Dockerfile[.template] file (or alternative Dockerfile
|
|
|
|
specified with the `--dockerfile` option), and if no dockerfile is found, it
|
|
|
|
will try to generate one.
|
|
|
|
|
|
|
|
REGISTRY SECRETS
|
|
|
|
The --registry-secrets option specifies a JSON or YAML file containing private
|
|
|
|
Docker registry usernames and passwords to be used when pulling base images.
|
|
|
|
Sample registry-secrets YAML file:
|
|
|
|
```
|
|
|
|
'my-registry-server.com:25000':
|
|
|
|
username: ann
|
|
|
|
password: hunter2
|
|
|
|
'': # Use the empty string to refer to the Docker Hub
|
|
|
|
username: mike
|
|
|
|
password: cze14
|
|
|
|
'eu.gcr.io': # Google Container Registry
|
|
|
|
username: '_json_key'
|
|
|
|
password: '{escaped contents of the GCR keyfile.json file}'
|
|
|
|
```
|
|
|
|
For a sample project using registry secrets with the Google Container Registry,
|
|
|
|
check: https://github.com/balena-io-examples/sample-gcr-registry-secrets
|
|
|
|
|
|
|
|
If the --registry-secrets option is not specified, and a secrets.yml or
|
|
|
|
secrets.json file exists in the balena directory (usually $HOME/.balena),
|
|
|
|
this file will be used instead.
|
|
|
|
|
|
|
|
DOCKERIGNORE AND GITIGNORE FILES
|
|
|
|
By default, the balena CLI will use a single ".dockerignore" file (if any) at
|
|
|
|
the project root (--source directory) in order to decide which source files to
|
|
|
|
exclude from the "build context" (tar stream) sent to balenaCloud, Docker
|
|
|
|
daemon or balenaEngine. In a microservices (multicontainer) fleet, the
|
|
|
|
source directory is the directory that contains the "docker-compose.yml" file.
|
|
|
|
|
|
|
|
The --multi-dockerignore (-m) option may be used with microservices
|
|
|
|
(multicontainer) fleets that define a docker-compose.yml file. When this
|
|
|
|
option is used, each service subdirectory (defined by the `build` or
|
|
|
|
`build.context` service properties in the docker-compose.yml file) is
|
|
|
|
filtered separately according to a .dockerignore file defined in the service
|
|
|
|
subdirectory. If no .dockerignore file exists in a service subdirectory, then
|
|
|
|
only the default .dockerignore patterns (see below) apply for that service
|
|
|
|
subdirectory.
|
|
|
|
|
|
|
|
When the --multi-dockerignore (-m) option is used, the .dockerignore file (if
|
|
|
|
any) defined at the overall project root will be used to filter files and
|
|
|
|
subdirectories other than service subdirectories. It will not have any effect
|
|
|
|
on service subdirectories, whether or not a service subdirectory defines its
|
|
|
|
own .dockerignore file. Multiple .dockerignore files are not merged or added
|
|
|
|
together, and cannot override or extend other files. This behavior maximizes
|
|
|
|
compatibility with the standard docker-compose tool, while still allowing a
|
|
|
|
root .dockerignore file (at the overall project root) to filter files and
|
|
|
|
folders that are outside service subdirectories.
|
|
|
|
|
|
|
|
balena CLI v11 also took .gitignore files into account. This behavior was
|
|
|
|
deprecated in CLI v12 and removed in CLI v13. Please use .dockerignore files
|
|
|
|
instead.
|
|
|
|
|
|
|
|
Default .dockerignore patterns
|
|
|
|
A few default/hardcoded dockerignore patterns are "merged" (in memory) with the
|
|
|
|
patterns found in the applicable .dockerignore files, in the following order:
|
|
|
|
```
|
|
|
|
**/.git
|
|
|
|
< user's patterns from the applicable '.dockerignore' file, if any >
|
|
|
|
!**/.balena
|
|
|
|
!**/.resin
|
|
|
|
!**/Dockerfile
|
|
|
|
!**/Dockerfile.*
|
|
|
|
!**/docker-compose.yml
|
|
|
|
```
|
|
|
|
These patterns always apply, whether or not .dockerignore files exist in the
|
|
|
|
project. If necessary, the effect of the `**/.git` pattern may be modified by
|
|
|
|
adding exception patterns to the applicable .dockerignore file(s), for example
|
|
|
|
`!mysubmodule/.git`. For documentation on pattern format, see:
|
|
|
|
- https://docs.docker.com/engine/reference/builder/#dockerignore-file
|
|
|
|
- https://www.npmjs.com/package/@balena/dockerignore
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena build --fleet myFleet
|
|
|
|
$ balena build ./source/ --fleet myorg/myfleet
|
2024-04-17 14:53:41 +00:00
|
|
|
$ balena build --deviceType raspberrypi3 --emulated
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena build --deviceType raspberrypi3 --arch armv7hf --emulated
|
|
|
|
$ balena build --docker /var/run/docker.sock --fleet myFleet # Linux, Mac
|
|
|
|
$ balena build --docker //./pipe/docker_engine --fleet myFleet # Windows
|
|
|
|
$ balena build --dockerHost my.docker.host --dockerPort 2376 --ca ca.pem --key key.pem --cert cert.pem -f myFleet
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### SOURCE
|
|
|
|
|
|
|
|
path of project source directory
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -A, --arch ARCH
|
|
|
|
|
|
|
|
the architecture to build for
|
|
|
|
|
|
|
|
#### -d, --deviceType DEVICETYPE
|
|
|
|
|
|
|
|
the type of device this build is for
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
|
|
|
#### -e, --emulated
|
|
|
|
|
|
|
|
Use QEMU for ARM architecture emulation during the image build
|
|
|
|
|
|
|
|
#### --dockerfile DOCKERFILE
|
|
|
|
|
|
|
|
Alternative Dockerfile name/path, relative to the source folder
|
|
|
|
|
|
|
|
#### --nologs
|
|
|
|
|
|
|
|
Hide the image build log output (produce less verbose output)
|
|
|
|
|
|
|
|
#### -m, --multi-dockerignore
|
|
|
|
|
|
|
|
Have each service use its own .dockerignore file. See "balena help build".
|
|
|
|
|
|
|
|
#### --noparent-check
|
|
|
|
|
|
|
|
Disable project validation check of 'docker-compose.yml' file in parent folder
|
|
|
|
|
|
|
|
#### -R, --registry-secrets REGISTRY-SECRETS
|
|
|
|
|
|
|
|
Path to a YAML or JSON file with passwords for a private Docker registry
|
|
|
|
|
|
|
|
#### --noconvert-eol
|
|
|
|
|
|
|
|
Don't convert line endings from CRLF (Windows format) to LF (Unix format).
|
|
|
|
|
|
|
|
#### -n, --projectName PROJECTNAME
|
|
|
|
|
|
|
|
Name prefix for locally built images. This is the 'projectName' portion
|
|
|
|
in 'projectName_serviceName:tag'. The default is the directory name.
|
|
|
|
|
|
|
|
#### -t, --tag TAG
|
|
|
|
|
|
|
|
Tag locally built Docker images. This is the 'tag' portion
|
|
|
|
in 'projectName_serviceName:tag'. The default is 'latest'.
|
|
|
|
|
|
|
|
#### -B, --buildArg BUILDARG
|
|
|
|
|
|
|
|
[Deprecated] Set a build-time variable (eg. "-B 'ARG=value'"). Can be specified multiple times.
|
|
|
|
|
|
|
|
#### --cache-from CACHE-FROM
|
|
|
|
|
|
|
|
Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the "docker build --cache-from" option.
|
|
|
|
|
|
|
|
#### --nocache
|
|
|
|
|
|
|
|
Don't use docker layer caching when building
|
|
|
|
|
|
|
|
#### --pull
|
|
|
|
|
|
|
|
Pull the base images again even if they exist locally
|
|
|
|
|
|
|
|
#### --squash
|
|
|
|
|
|
|
|
Squash newly built layers into a single new layer
|
|
|
|
|
|
|
|
#### -P, --docker DOCKER
|
|
|
|
|
|
|
|
Path to a local docker socket (e.g. /var/run/docker.sock)
|
|
|
|
|
|
|
|
#### -h, --dockerHost DOCKERHOST
|
|
|
|
|
|
|
|
Docker daemon hostname or IP address (dev machine or balena device)
|
|
|
|
|
|
|
|
#### -p, --dockerPort DOCKERPORT
|
|
|
|
|
|
|
|
Docker daemon TCP port number (hint: 2375 for balena devices)
|
|
|
|
|
|
|
|
#### --ca CA
|
|
|
|
|
|
|
|
Docker host TLS certificate authority file
|
|
|
|
|
|
|
|
#### --cert CERT
|
|
|
|
|
|
|
|
Docker host TLS certificate file
|
|
|
|
|
|
|
|
#### --key KEY
|
|
|
|
|
|
|
|
Docker host TLS key file
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## deploy
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Usage: `deploy <fleet> ([image] | --build [--source build-dir])`
|
|
|
|
|
|
|
|
Use this command to deploy an image or a complete multicontainer project to a
|
|
|
|
fleet, optionally building it first. The source images are searched for
|
|
|
|
(and optionally built) using the docker daemon in your development machine or
|
|
|
|
balena device. (See also the `balena push` command for the option of building
|
|
|
|
the image in the balenaCloud build servers.)
|
|
|
|
|
|
|
|
Unless an image is specified, this command will look into the current directory
|
|
|
|
(or the one specified by --source) for a docker-compose.yml file. If one is
|
|
|
|
found, this command will deploy each service defined in the compose file,
|
|
|
|
building it first if an image for it doesn't exist. Image names will be looked
|
|
|
|
up according to the scheme: `<projectName>_<serviceName>`.
|
|
|
|
|
|
|
|
If a compose file isn't found, the command will look for a Dockerfile[.template]
|
|
|
|
file (or alternative Dockerfile specified with the `-f` option), and if yet
|
|
|
|
that isn't found, it will try to generate one.
|
|
|
|
|
|
|
|
To deploy to a fleet where you are a collaborator, use fleet slug including the
|
|
|
|
organization: `balena deploy <organization>/<fleet>`.
|
|
|
|
|
|
|
|
REGISTRY SECRETS
|
|
|
|
The --registry-secrets option specifies a JSON or YAML file containing private
|
|
|
|
Docker registry usernames and passwords to be used when pulling base images.
|
|
|
|
Sample registry-secrets YAML file:
|
|
|
|
```
|
|
|
|
'my-registry-server.com:25000':
|
|
|
|
username: ann
|
|
|
|
password: hunter2
|
|
|
|
'': # Use the empty string to refer to the Docker Hub
|
|
|
|
username: mike
|
|
|
|
password: cze14
|
|
|
|
'eu.gcr.io': # Google Container Registry
|
|
|
|
username: '_json_key'
|
|
|
|
password: '{escaped contents of the GCR keyfile.json file}'
|
|
|
|
```
|
|
|
|
For a sample project using registry secrets with the Google Container Registry,
|
|
|
|
check: https://github.com/balena-io-examples/sample-gcr-registry-secrets
|
|
|
|
|
|
|
|
If the --registry-secrets option is not specified, and a secrets.yml or
|
|
|
|
secrets.json file exists in the balena directory (usually $HOME/.balena),
|
|
|
|
this file will be used instead.
|
|
|
|
|
|
|
|
DOCKERIGNORE AND GITIGNORE FILES
|
|
|
|
By default, the balena CLI will use a single ".dockerignore" file (if any) at
|
|
|
|
the project root (--source directory) in order to decide which source files to
|
|
|
|
exclude from the "build context" (tar stream) sent to balenaCloud, Docker
|
|
|
|
daemon or balenaEngine. In a microservices (multicontainer) fleet, the
|
|
|
|
source directory is the directory that contains the "docker-compose.yml" file.
|
|
|
|
|
|
|
|
The --multi-dockerignore (-m) option may be used with microservices
|
|
|
|
(multicontainer) fleets that define a docker-compose.yml file. When this
|
|
|
|
option is used, each service subdirectory (defined by the `build` or
|
|
|
|
`build.context` service properties in the docker-compose.yml file) is
|
|
|
|
filtered separately according to a .dockerignore file defined in the service
|
|
|
|
subdirectory. If no .dockerignore file exists in a service subdirectory, then
|
|
|
|
only the default .dockerignore patterns (see below) apply for that service
|
|
|
|
subdirectory.
|
|
|
|
|
|
|
|
When the --multi-dockerignore (-m) option is used, the .dockerignore file (if
|
|
|
|
any) defined at the overall project root will be used to filter files and
|
|
|
|
subdirectories other than service subdirectories. It will not have any effect
|
|
|
|
on service subdirectories, whether or not a service subdirectory defines its
|
|
|
|
own .dockerignore file. Multiple .dockerignore files are not merged or added
|
|
|
|
together, and cannot override or extend other files. This behavior maximizes
|
|
|
|
compatibility with the standard docker-compose tool, while still allowing a
|
|
|
|
root .dockerignore file (at the overall project root) to filter files and
|
|
|
|
folders that are outside service subdirectories.
|
|
|
|
|
|
|
|
balena CLI v11 also took .gitignore files into account. This behavior was
|
|
|
|
deprecated in CLI v12 and removed in CLI v13. Please use .dockerignore files
|
|
|
|
instead.
|
|
|
|
|
|
|
|
Default .dockerignore patterns
|
|
|
|
A few default/hardcoded dockerignore patterns are "merged" (in memory) with the
|
|
|
|
patterns found in the applicable .dockerignore files, in the following order:
|
|
|
|
```
|
|
|
|
**/.git
|
|
|
|
< user's patterns from the applicable '.dockerignore' file, if any >
|
|
|
|
!**/.balena
|
|
|
|
!**/.resin
|
|
|
|
!**/Dockerfile
|
|
|
|
!**/Dockerfile.*
|
|
|
|
!**/docker-compose.yml
|
|
|
|
```
|
|
|
|
These patterns always apply, whether or not .dockerignore files exist in the
|
|
|
|
project. If necessary, the effect of the `**/.git` pattern may be modified by
|
|
|
|
adding exception patterns to the applicable .dockerignore file(s), for example
|
|
|
|
`!mysubmodule/.git`. For documentation on pattern format, see:
|
|
|
|
- https://docs.docker.com/engine/reference/builder/#dockerignore-file
|
|
|
|
- https://www.npmjs.com/package/@balena/dockerignore
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena deploy myFleet
|
|
|
|
$ balena deploy myorg/myfleet --build --source myBuildDir/
|
|
|
|
$ balena deploy myorg/myfleet --build --source myBuildDir/ --note "this is the note for this release"
|
|
|
|
$ balena deploy myorg/myfleet myRepo/myImage
|
|
|
|
$ balena deploy myFleet myRepo/myImage --release-tag key1 "" key2 "value2 with spaces"
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
|
|
|
#### IMAGE
|
|
|
|
|
|
|
|
the image to deploy
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -s, --source SOURCE
|
|
|
|
|
|
|
|
specify an alternate source directory; default is the working directory
|
|
|
|
|
|
|
|
#### -b, --build
|
|
|
|
|
|
|
|
force a rebuild before deploy
|
|
|
|
|
|
|
|
#### --nologupload
|
|
|
|
|
|
|
|
don't upload build logs to the dashboard with image (if building)
|
|
|
|
|
|
|
|
#### --release-tag RELEASE-TAG
|
|
|
|
|
|
|
|
Set release tags if the image deployment is successful. Multiple
|
|
|
|
arguments may be provided, alternating tag keys and values (see examples).
|
|
|
|
Hint: Empty values may be specified with "" (bash, cmd.exe) or '""' (PowerShell).
|
|
|
|
|
|
|
|
#### --draft
|
|
|
|
|
|
|
|
Deploy the release as a draft. Draft releases are ignored
|
|
|
|
by the 'track latest' release policy but can be used through release pinning.
|
|
|
|
Draft releases can be marked as final through the API. Releases are created
|
|
|
|
as final by default unless this option is given.
|
|
|
|
|
|
|
|
#### --note NOTE
|
|
|
|
|
|
|
|
The notes for this release
|
|
|
|
|
|
|
|
#### -e, --emulated
|
|
|
|
|
|
|
|
Use QEMU for ARM architecture emulation during the image build
|
|
|
|
|
|
|
|
#### --dockerfile DOCKERFILE
|
|
|
|
|
|
|
|
Alternative Dockerfile name/path, relative to the source folder
|
|
|
|
|
|
|
|
#### --nologs
|
|
|
|
|
|
|
|
Hide the image build log output (produce less verbose output)
|
|
|
|
|
|
|
|
#### -m, --multi-dockerignore
|
|
|
|
|
|
|
|
Have each service use its own .dockerignore file. See "balena help build".
|
|
|
|
|
|
|
|
#### --noparent-check
|
|
|
|
|
|
|
|
Disable project validation check of 'docker-compose.yml' file in parent folder
|
|
|
|
|
|
|
|
#### -R, --registry-secrets REGISTRY-SECRETS
|
|
|
|
|
|
|
|
Path to a YAML or JSON file with passwords for a private Docker registry
|
|
|
|
|
|
|
|
#### --noconvert-eol
|
|
|
|
|
|
|
|
Don't convert line endings from CRLF (Windows format) to LF (Unix format).
|
|
|
|
|
|
|
|
#### -n, --projectName PROJECTNAME
|
|
|
|
|
|
|
|
Name prefix for locally built images. This is the 'projectName' portion
|
|
|
|
in 'projectName_serviceName:tag'. The default is the directory name.
|
|
|
|
|
|
|
|
#### -t, --tag TAG
|
|
|
|
|
|
|
|
Tag locally built Docker images. This is the 'tag' portion
|
|
|
|
in 'projectName_serviceName:tag'. The default is 'latest'.
|
|
|
|
|
|
|
|
#### -B, --buildArg BUILDARG
|
|
|
|
|
|
|
|
[Deprecated] Set a build-time variable (eg. "-B 'ARG=value'"). Can be specified multiple times.
|
|
|
|
|
|
|
|
#### --cache-from CACHE-FROM
|
|
|
|
|
|
|
|
Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the "docker build --cache-from" option.
|
|
|
|
|
|
|
|
#### --nocache
|
|
|
|
|
|
|
|
Don't use docker layer caching when building
|
|
|
|
|
|
|
|
#### --pull
|
|
|
|
|
|
|
|
Pull the base images again even if they exist locally
|
|
|
|
|
|
|
|
#### --squash
|
|
|
|
|
|
|
|
Squash newly built layers into a single new layer
|
|
|
|
|
|
|
|
#### -P, --docker DOCKER
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Path to a local docker socket (e.g. /var/run/docker.sock)
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -h, --dockerHost DOCKERHOST
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Docker daemon hostname or IP address (dev machine or balena device)
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -p, --dockerPort DOCKERPORT
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Docker daemon TCP port number (hint: 2375 for balena devices)
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --ca CA
|
2020-10-14 09:13:47 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Docker host TLS certificate authority file
|
2022-07-14 18:56:51 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --cert CERT
|
|
|
|
|
|
|
|
Docker host TLS certificate file
|
|
|
|
|
|
|
|
#### --key KEY
|
|
|
|
|
|
|
|
Docker host TLS key file
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Devices
|
2022-07-14 18:56:51 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device deactivate
|
2021-02-23 22:10:52 +00:00
|
|
|
|
|
|
|
Deactivate a device.
|
|
|
|
|
|
|
|
Note this command asks for confirmation interactively.
|
|
|
|
You can avoid this by passing the `--yes` option.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device deactivate 7cf02a6
|
|
|
|
$ balena device deactivate 7cf02a6 --yes
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the UUID of the device to be deactivated
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
answer "yes" to all questions (non interactive use)
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device identify
|
2020-07-02 13:58:07 +00:00
|
|
|
|
|
|
|
Identify a device by making the ACT LED blink (Raspberry Pi).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device identify 23c73a1
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the uuid of the device to identify
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Show information about a single device.
|
|
|
|
|
2023-10-27 16:54:36 +00:00
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because field names are less likely to change in JSON format and because it
|
|
|
|
better represents data types like arrays, empty strings and null values.
|
|
|
|
The 'jq' utility may be helpful for querying JSON fields in shell scripts
|
|
|
|
(https://stedolan.github.io/jq/manual/).
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device 7cf02a6
|
|
|
|
$ balena device 7cf02a6 --view
|
2023-10-27 16:54:36 +00:00
|
|
|
$ balena device 7cf02a6 --json
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the device uuid
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-10-27 16:54:36 +00:00
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --view
|
|
|
|
|
|
|
|
open device dashboard page
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device init
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2021-11-24 18:24:14 +00:00
|
|
|
Register a new device in the selected fleet, download the OS image for the
|
|
|
|
fleet's default device type, configure the image and write it to an SD card.
|
|
|
|
This command effectively combines several other balena CLI commands in one,
|
|
|
|
namely:
|
2015-04-27 15:20:53 +00:00
|
|
|
|
2021-11-24 18:24:14 +00:00
|
|
|
'balena device register'
|
|
|
|
'balena os download'
|
|
|
|
'balena os build-config' or 'balena config generate'
|
|
|
|
'balena os configure'
|
|
|
|
'balena os local flash'
|
|
|
|
|
|
|
|
Possible arguments for the '--fleet', '--os-version' and '--drive' options can
|
|
|
|
be listed respectively with the commands:
|
|
|
|
|
|
|
|
'balena fleets'
|
|
|
|
'balena os versions'
|
|
|
|
'balena util available-drives'
|
|
|
|
|
|
|
|
If the '--fleet' or '--drive' options are omitted, interactive menus will be
|
|
|
|
presented with values to choose from. If the '--os-version' option is omitted,
|
|
|
|
the latest released OS version for the fleet's default device type will be used.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2021-11-24 18:24:14 +00:00
|
|
|
Image configuration questions will be asked interactively unless a pre-configured
|
|
|
|
'config.json' file is provided with the '--config' option. The file can be
|
|
|
|
generated with the 'balena config generate' or 'balena os build-config' commands.
|
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
Examples:
|
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
$ balena device init
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena device init -f myorg/myfleet
|
2022-09-06 10:26:26 +00:00
|
|
|
$ balena device init --fleet myFleet --os-version 2.101.7 --drive /dev/disk5 --config config.json --yes
|
2021-11-24 18:24:14 +00:00
|
|
|
$ balena device init --fleet myFleet --os-version 2.83.21+rev1.prod --drive /dev/disk5 --config config.json --yes
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-07-02 13:58:07 +00:00
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
answer "yes" to all questions (non interactive use)
|
|
|
|
|
|
|
|
#### -v, --advanced
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
show advanced configuration options
|
2015-09-29 18:33:31 +00:00
|
|
|
|
2020-07-02 13:58:07 +00:00
|
|
|
#### --os-version OS-VERSION
|
2015-09-29 18:33:31 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
exact version number, or a valid semver range,
|
|
|
|
or 'latest' (includes pre-releases),
|
|
|
|
or 'default' (excludes pre-releases if at least one stable version is available),
|
|
|
|
or 'recommended' (excludes pre-releases, will fail if only pre-release versions are available),
|
|
|
|
or 'menu' (will show the interactive menu)
|
2015-09-29 18:33:31 +00:00
|
|
|
|
2020-07-02 13:58:07 +00:00
|
|
|
#### -d, --drive DRIVE
|
2015-09-29 18:33:31 +00:00
|
|
|
|
2020-07-15 19:13:18 +00:00
|
|
|
the drive to write the image to, eg. `/dev/sdb` or `/dev/mmcblk0`.
|
|
|
|
Careful with this as you can erase your hard drive.
|
|
|
|
Check `balena util available-drives` for available options.
|
2015-10-19 18:16:47 +00:00
|
|
|
|
2020-07-02 13:58:07 +00:00
|
|
|
#### --config CONFIG
|
2015-10-19 18:16:47 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
path to the config JSON file, see `balena os build-config`
|
2015-10-19 18:16:47 +00:00
|
|
|
|
2021-07-20 06:42:15 +00:00
|
|
|
#### --provisioning-key-name PROVISIONING-KEY-NAME
|
|
|
|
|
|
|
|
custom key name assigned to generated provisioning api key
|
|
|
|
|
2022-05-10 18:02:45 +00:00
|
|
|
#### --provisioning-key-expiry-date PROVISIONING-KEY-EXPIRY-DATE
|
|
|
|
|
|
|
|
expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
|
|
|
|
2024-09-24 16:26:16 +00:00
|
|
|
## device list
|
|
|
|
|
|
|
|
List all of your devices.
|
|
|
|
|
|
|
|
Devices can be filtered by fleet with the `--fleet` option.
|
|
|
|
|
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
|
|
|
|
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because field names are less likely to change in JSON format and because it
|
|
|
|
better represents data types like arrays, empty strings and null values.
|
|
|
|
The 'jq' utility may be helpful for querying JSON fields in shell scripts
|
|
|
|
(https://stedolan.github.io/jq/manual/).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device list
|
|
|
|
$ balena device list --fleet MyFleet
|
|
|
|
$ balena device list -f myorg/myfleet
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device local-mode
|
2021-02-23 22:10:52 +00:00
|
|
|
|
|
|
|
Output current local mode status, or enable/disable local mode
|
|
|
|
for specified device.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device local-mode 23c73a1
|
|
|
|
$ balena device local-mode 23c73a1 --enable
|
|
|
|
$ balena device local-mode 23c73a1 --disable
|
|
|
|
$ balena device local-mode 23c73a1 --status
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the uuid of the device to manage
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### --enable
|
|
|
|
|
|
|
|
enable local mode
|
|
|
|
|
|
|
|
#### --disable
|
|
|
|
|
|
|
|
disable local mode
|
|
|
|
|
|
|
|
#### --status
|
|
|
|
|
|
|
|
output boolean indicating local mode status
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device move
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Move one or more devices to another fleet.
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
If --fleet is omitted, the fleet will be prompted for interactively.
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device move 7cf02a6
|
2020-07-15 14:26:31 +00:00
|
|
|
$ balena device move 7cf02a6,dc39e52
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena device move 7cf02a6 --fleet MyNewFleet
|
|
|
|
$ balena device move 7cf02a6 -f myorg/mynewfleet
|
2020-06-17 13:46:25 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
2020-07-15 14:26:31 +00:00
|
|
|
comma-separated list (no blank spaces) of device UUIDs to be moved
|
2020-06-17 13:46:25 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### -f, --fleet FLEET
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device os-update
|
2016-03-04 13:38:11 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Start a Host OS update for a device.
|
|
|
|
|
|
|
|
Note this command will ask for confirmation interactively.
|
|
|
|
This can be avoided by passing the `--yes` option.
|
|
|
|
|
|
|
|
Requires balenaCloud; will not work with openBalena or standalone balenaOS.
|
2016-03-04 13:38:11 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device os-update 23c73a1
|
2022-09-06 10:26:26 +00:00
|
|
|
$ balena device os-update 23c73a1 --version 2.101.7
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device os-update 23c73a1 --version 2.31.0+rev1.prod
|
2024-01-22 15:02:25 +00:00
|
|
|
$ balena device os-update 23c73a1 --include-draft
|
2016-03-04 13:38:11 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
the uuid of the device to update
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2016-10-26 14:46:20 +00:00
|
|
|
### Options
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### --version VERSION
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
a balenaOS version
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2024-01-22 15:02:25 +00:00
|
|
|
#### --include-draft
|
|
|
|
|
|
|
|
include pre-release balenaOS versions
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### -y, --yes
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
answer "yes" to all questions (non interactive use)
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device pin
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Pin a device to a release.
|
|
|
|
|
|
|
|
Note, if the commit is omitted, the currently pinned release will be printed, with instructions for how to see a list of releases
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device pin 7cf02a6
|
|
|
|
$ balena device pin 7cf02a6 91165e5
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the uuid of the device to pin to a release
|
|
|
|
|
|
|
|
#### RELEASETOPINTO
|
|
|
|
|
|
|
|
the commit of the release for the device to get pinned to
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device public-url
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
This command will output the current public URL for the
|
|
|
|
specified device. It can also enable or disable the URL,
|
|
|
|
or output the enabled status, using the respective options.
|
2020-06-17 13:46:25 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Examples:
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device public-url 23c73a1
|
|
|
|
$ balena device public-url 23c73a1 --enable
|
|
|
|
$ balena device public-url 23c73a1 --disable
|
|
|
|
$ balena device public-url 23c73a1 --status
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
### Arguments
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### UUID
|
2016-10-26 14:46:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
the uuid of the device to manage
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
### Options
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### --enable
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
enable the public URL
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### --disable
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
disable the public URL
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### --status
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
determine if public URL is enabled
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device purge
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Purge data from a device.
|
|
|
|
This will clear the device's "/data" directory.
|
2015-11-11 19:00:02 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Multiple devices may be specified with a comma-separated list
|
|
|
|
of values (no spaces).
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
Examples:
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device purge 23c73a1
|
|
|
|
$ balena device purge 55d43b3,23c73a1
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
### Arguments
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
#### UUID
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
comma-separated list (no blank spaces) of device UUIDs
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
### Options
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device reboot
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Remotely reboot a device.
|
2020-09-25 09:00:18 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device reboot 23c73a1
|
2020-09-25 09:00:18 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
the uuid of the device to reboot
|
2020-09-25 09:00:18 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### -f, --force
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
force action if the update lock is set
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device register
|
2021-07-15 13:41:38 +00:00
|
|
|
|
|
|
|
Register a new device with a balena fleet.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
If --uuid is not provided, a new UUID will be automatically assigned.
|
2015-10-20 13:16:56 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
Examples:
|
2015-10-20 13:16:56 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena device register MyFleet
|
|
|
|
$ balena device register MyFleet --uuid <uuid>
|
|
|
|
$ balena device register myorg/myfleet --uuid <uuid>
|
2022-10-11 17:52:02 +00:00
|
|
|
$ balena device register myorg/myfleet --uuid <uuid> --deviceType <deviceTypeSlug>
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
### Arguments
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### FLEET
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-06-17 13:46:25 +00:00
|
|
|
### Options
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### -u, --uuid UUID
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
custom uuid
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2022-10-11 17:52:02 +00:00
|
|
|
#### --deviceType DEVICETYPE
|
|
|
|
|
|
|
|
device type slug (run 'balena devices supported' for possible values)
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device rename
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Rename a device.
|
2020-03-26 12:19:35 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Note, if the name is omitted, it will be prompted for interactively.
|
2020-08-07 14:08:20 +00:00
|
|
|
|
2019-06-11 12:08:15 +00:00
|
|
|
Examples:
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device rename 7cf02a6
|
|
|
|
$ balena device rename 7cf02a6 MyPi
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
### Arguments
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### UUID
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
the uuid of the device to rename
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### NEWNAME
|
2019-06-11 12:08:15 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
the new name for the device
|
2020-08-07 14:08:20 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
### Options
|
2020-08-07 14:08:20 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device restart
|
2019-11-07 10:02:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Restart containers on a device.
|
|
|
|
If the --service flag is provided, then only those services' containers
|
|
|
|
will be restarted, otherwise all containers on the device will be restarted.
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Multiple devices and services may be specified with a comma-separated list
|
|
|
|
of values (no spaces).
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Note this does not reboot the device, to do so use instead `balena device reboot`.
|
2019-11-07 10:02:44 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device restart 23c73a1
|
|
|
|
$ balena device restart 55d43b3,23c73a1
|
|
|
|
$ balena device restart 23c73a1 --service myService
|
|
|
|
$ balena device restart 23c73a1 -s myService1,myService2
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
### Arguments
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### UUID
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
comma-separated list (no blank spaces) of device UUIDs to restart
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
### Options
|
2019-12-26 22:59:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
#### -s, --service SERVICE
|
2019-11-07 10:02:44 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
comma-separated list (no blank spaces) of service names to restart
|
2020-06-18 13:36:46 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device rm
|
2020-06-18 13:36:46 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Remove one or more devices from balena.
|
2020-06-18 13:36:46 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Note this command asks for confirmation interactively.
|
|
|
|
You can avoid this by passing the `--yes` option.
|
2020-06-18 13:36:46 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device rm 7cf02a6
|
|
|
|
$ balena device rm 7cf02a6,dc39e52
|
|
|
|
$ balena device rm 7cf02a6 --yes
|
2020-06-18 13:36:46 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
comma-separated list (no blank spaces) of device UUIDs to be removed
|
2020-06-18 13:36:46 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
answer "yes" to all questions (non interactive use)
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device shutdown
|
2020-06-02 08:01:04 +00:00
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
Remotely shutdown a device.
|
2020-06-02 08:01:04 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2020-10-14 09:13:47 +00:00
|
|
|
$ balena device shutdown 23c73a1
|
2020-06-02 08:01:04 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the uuid of the device to shutdown
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -f, --force
|
|
|
|
|
|
|
|
force action if the update lock is set
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device start-service
|
2023-11-04 14:38:30 +00:00
|
|
|
|
|
|
|
Start containers on a device.
|
|
|
|
|
|
|
|
Multiple devices and services may be specified with a comma-separated list
|
|
|
|
of values (no spaces).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device start-service 23c73a1 myService
|
|
|
|
$ balena device start-service 23c73a1 myService1,myService2
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
comma-separated list (no blank spaces) of device UUIDs
|
|
|
|
|
|
|
|
#### SERVICE
|
|
|
|
|
|
|
|
comma-separated list (no blank spaces) of service names
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device stop-service
|
2023-11-04 14:38:30 +00:00
|
|
|
|
|
|
|
Stop containers on a device.
|
|
|
|
|
|
|
|
Multiple devices and services may be specified with a comma-separated list
|
|
|
|
of values (no spaces).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device stop-service 23c73a1 myService
|
|
|
|
$ balena device stop-service 23c73a1 myService1,myService2
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
comma-separated list (no blank spaces) of device UUIDs
|
|
|
|
|
|
|
|
#### SERVICE
|
|
|
|
|
|
|
|
comma-separated list (no blank spaces) of service names
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## device track-fleet
|
2023-11-07 22:33:48 +00:00
|
|
|
|
|
|
|
Make a device track the fleet's pinned release.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena device track-fleet 7cf02a6
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### UUID
|
|
|
|
|
|
|
|
the uuid of the device to make track the fleet's release
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## devices supported
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
List the supported device types (like 'raspberrypi3' or 'intel-nuc').
|
|
|
|
|
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because the JSON format is less likely to change and it better represents data
|
|
|
|
types like lists and empty strings (for example, the ALIASES column contains a
|
|
|
|
list of zero or more values). The 'jq' utility may be helpful in shell scripts
|
|
|
|
(https://stedolan.github.io/jq/manual/).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena devices supported
|
|
|
|
$ balena devices supported --json
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Environment Variables
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## env add
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Add an environment or config variable to one or more fleets, devices or
|
|
|
|
services, as selected by the respective command-line options. Either the
|
|
|
|
--fleet or the --device option must be provided, and either may be be
|
|
|
|
used alongside the --service option to define a service-specific variable.
|
|
|
|
(A service corresponds to a Docker image/container in a microservices fleet.)
|
|
|
|
When the --service option is used in conjunction with the --device option,
|
|
|
|
the service variable applies to the selected device only. Otherwise, it
|
|
|
|
applies to all devices of the selected fleet. If the --service option is
|
|
|
|
omitted, the variable applies to all services.
|
|
|
|
|
|
|
|
If VALUE is omitted, the CLI will attempt to use the value of the environment
|
|
|
|
variable of same name in the CLI process' environment. In this case, a warning
|
|
|
|
message will be printed. Use `--quiet` to suppress it.
|
|
|
|
|
|
|
|
'BALENA_' or 'RESIN_' are reserved variable name prefixes used to identify
|
|
|
|
"configuration variables". Configuration variables control balena platform
|
|
|
|
features and are treated specially by balenaOS and the balena supervisor
|
|
|
|
running on devices. They are also stored differently in the balenaCloud API
|
|
|
|
database. Configuration variables cannot be set for specific services,
|
|
|
|
therefore the --service option cannot be used when the variable name starts
|
|
|
|
with a reserved prefix. When defining custom fleet variables, please avoid
|
|
|
|
these reserved prefixes.
|
|
|
|
|
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena env add TERM --fleet MyFleet
|
|
|
|
$ balena env add EDITOR vim -f myorg/myfleet
|
|
|
|
$ balena env add EDITOR vim --fleet MyFleet,MyFleet2
|
|
|
|
$ balena env add EDITOR vim --fleet MyFleet --service MyService
|
|
|
|
$ balena env add EDITOR vim --fleet MyFleet,MyFleet2 --service MyService,MyService2
|
|
|
|
$ balena env add EDITOR vim --device 7cf02a6
|
|
|
|
$ balena env add EDITOR vim --device 7cf02a6,d6f1433
|
|
|
|
$ balena env add EDITOR vim --device 7cf02a6 --service MyService
|
|
|
|
$ balena env add EDITOR vim --device 7cf02a6,d6f1433 --service MyService,MyService2
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### NAME
|
|
|
|
|
|
|
|
environment or config variable name
|
|
|
|
|
|
|
|
#### VALUE
|
|
|
|
|
|
|
|
variable value; if omitted, use value from this process' environment
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
|
|
|
#### -d, --device DEVICE
|
|
|
|
|
|
|
|
device UUID
|
|
|
|
|
|
|
|
#### -q, --quiet
|
|
|
|
|
|
|
|
suppress warning messages
|
|
|
|
|
|
|
|
#### -s, --service SERVICE
|
|
|
|
|
|
|
|
service name
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## env rename
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Change the value of a configuration or environment variable for a fleet,
|
|
|
|
device or service, as selected by command-line options.
|
|
|
|
|
|
|
|
Variables are selected by their database ID (as reported by the 'balena envs'
|
|
|
|
command) and one of six database "resource types":
|
|
|
|
|
|
|
|
- fleet environment variable
|
|
|
|
- fleet configuration variable (--config)
|
|
|
|
- fleet service variable (--service)
|
|
|
|
- device environment variable (--device)
|
|
|
|
- device configuration variable (--device --config)
|
|
|
|
- device service variable (--device --service)
|
|
|
|
|
|
|
|
The --device option selects a device-specific variable instead of a fleet
|
|
|
|
variable.
|
|
|
|
|
|
|
|
The --config option selects a configuration variable. Configuration variable
|
|
|
|
names typically start with the 'BALENA_' or 'RESIN_' prefixes and are used to
|
|
|
|
configure balena platform features.
|
|
|
|
|
|
|
|
The --service option selects a service variable, which is an environment variable
|
|
|
|
that applies to a specifc service (container) in a microservices (multicontainer)
|
|
|
|
fleet.
|
|
|
|
|
|
|
|
The --service and --config options cannot be used together, but they can be
|
|
|
|
used alongside the --device option to select a device-specific service or
|
|
|
|
configuration variable.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena env rename 123123 emacs
|
|
|
|
$ balena env rename 234234 emacs --service
|
|
|
|
$ balena env rename 345345 emacs --device
|
|
|
|
$ balena env rename 456456 emacs --device --service
|
|
|
|
$ balena env rename 567567 1 --config
|
|
|
|
$ balena env rename 678678 1 --device --config
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### ID
|
2020-06-02 08:01:04 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
variable's numeric database ID
|
2020-06-02 08:01:04 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### VALUE
|
2020-06-02 08:01:04 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
variable value; if omitted, use value from this process' environment
|
2020-06-02 08:01:04 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-06-02 08:01:04 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -c, --config
|
2021-09-29 14:05:41 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
select a configuration variable (may be used together with the --device option)
|
2021-09-29 14:05:41 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --device
|
2021-09-29 14:05:41 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
select a device-specific variable instead of a fleet variable
|
2021-09-29 14:05:41 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -s, --service
|
2023-10-17 15:00:01 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
select a service variable (may be used together with the --device option)
|
2021-09-29 14:05:41 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## env rm
|
2024-09-30 15:25:43 +00:00
|
|
|
|
|
|
|
Remove a configuration or environment variable from a fleet, device
|
|
|
|
or service, as selected by command-line options.
|
|
|
|
|
|
|
|
Variables are selected by their database ID (as reported by the 'balena envs'
|
|
|
|
command) and one of six database "resource types":
|
|
|
|
|
|
|
|
- fleet environment variable
|
|
|
|
- fleet configuration variable (--config)
|
|
|
|
- fleet service variable (--service)
|
|
|
|
- device environment variable (--device)
|
|
|
|
- device configuration variable (--device --config)
|
|
|
|
- device service variable (--device --service)
|
|
|
|
|
|
|
|
The --device option selects a device-specific variable instead of a fleet
|
|
|
|
variable.
|
|
|
|
|
|
|
|
The --config option selects a configuration variable. Configuration variable
|
|
|
|
names typically start with the 'BALENA_' or 'RESIN_' prefixes and are used to
|
|
|
|
configure balena platform features.
|
|
|
|
|
|
|
|
The --service option selects a service variable, which is an environment variable
|
|
|
|
that applies to a specifc service (container) in a microservices (multicontainer)
|
|
|
|
fleet.
|
|
|
|
|
|
|
|
The --service and --config options cannot be used together, but they can be
|
|
|
|
used alongside the --device option to select a device-specific service or
|
|
|
|
configuration variable.
|
|
|
|
|
|
|
|
Interactive confirmation is normally asked before the variable is deleted.
|
|
|
|
The --yes option disables this behavior.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena env rm 123123
|
|
|
|
$ balena env rm 234234 --yes
|
|
|
|
$ balena env rm 345345 --config
|
|
|
|
$ balena env rm 456456 --service
|
|
|
|
$ balena env rm 567567 --device
|
|
|
|
$ balena env rm 678678 --device --config
|
|
|
|
$ balena env rm 789789 --device --service --yes
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### ID
|
|
|
|
|
|
|
|
variable's numeric database ID
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -c, --config
|
|
|
|
|
|
|
|
select a configuration variable (may be used together with the --device option)
|
|
|
|
|
|
|
|
#### -d, --device
|
|
|
|
|
|
|
|
select a device-specific variable instead of a fleet variable
|
|
|
|
|
|
|
|
#### -s, --service
|
|
|
|
|
|
|
|
select a service variable (may be used together with the --device option)
|
|
|
|
|
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
do not prompt for confirmation before deleting the variable
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## envs
|
2024-09-30 15:25:43 +00:00
|
|
|
|
|
|
|
List the environment or configuration variables of a fleet, device or
|
|
|
|
service, as selected by the respective command-line options. (A service
|
|
|
|
corresponds to a Docker image/container in a microservices fleet.)
|
|
|
|
|
|
|
|
The results include fleet-wide (multiple devices), device-specific (multiple
|
|
|
|
services on a specific device) and service-specific variables that apply to the
|
|
|
|
selected fleet, device or service. It can be thought of as including inherited
|
|
|
|
variables; for example, a service inherits device-wide variables, and a device
|
|
|
|
inherits fleet-wide variables.
|
|
|
|
|
|
|
|
The printed output may include DEVICE and/or SERVICE columns to distinguish
|
|
|
|
between fleet-wide, device-specific and service-specific variables.
|
|
|
|
An asterisk in these columns indicates that the variable applies to
|
|
|
|
"all devices" or "all services".
|
|
|
|
|
|
|
|
The --config option is used to list "configuration variables" that control
|
|
|
|
balena platform features, as opposed to custom environment variables defined
|
|
|
|
by the user. The --config and the --service options are mutually exclusive
|
|
|
|
because configuration variables cannot be set for specific services.
|
|
|
|
|
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because the JSON format is less likely to change and it better represents data
|
|
|
|
types like lists and empty strings. The 'jq' utility may be helpful in shell
|
|
|
|
scripts (https://stedolan.github.io/jq/manual/). When --json is used, an empty
|
|
|
|
JSON array ([]) is printed instead of an error message when no variables exist
|
|
|
|
for the given query. When querying variables for a device, note that the fleet
|
|
|
|
name may be null in JSON output (or 'N/A' in tabular output) if the fleet that
|
|
|
|
the device belonged to is no longer accessible by the current user (for example,
|
|
|
|
in case the current user was removed from the fleet by the fleet's owner).
|
|
|
|
|
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena envs --fleet myorg/myfleet
|
|
|
|
$ balena envs --fleet MyFleet --json
|
|
|
|
$ balena envs --fleet MyFleet --service MyService
|
|
|
|
$ balena envs --fleet MyFleet --config
|
|
|
|
$ balena envs --device 7cf02a6
|
|
|
|
$ balena envs --device 7cf02a6 --json
|
|
|
|
$ balena envs --device 7cf02a6 --config --json
|
|
|
|
$ balena envs --device 7cf02a6 --service MyService
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
|
|
|
#### -c, --config
|
|
|
|
|
|
|
|
show configuration variables only
|
|
|
|
|
|
|
|
#### -d, --device DEVICE
|
|
|
|
|
|
|
|
device UUID
|
|
|
|
|
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
|
|
|
#### -s, --service SERVICE
|
|
|
|
|
|
|
|
service name
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Fleets
|
2019-12-11 00:43:55 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet create
|
2019-12-11 00:43:55 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Create a new balena fleet.
|
2019-12-11 00:43:55 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
You can specify the organization the fleet should belong to using
|
|
|
|
the `--organization` option. The organization's handle, not its name,
|
|
|
|
should be provided. Organization handles can be listed with the
|
|
|
|
`balena orgs` command.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
The fleet's default device type is specified with the `--type` option.
|
|
|
|
The `balena devices supported` command can be used to list the available
|
|
|
|
device types.
|
2019-03-04 15:02:09 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Interactive dropdowns will be shown for selection if no device type or
|
|
|
|
organization is specified and there are multiple options to choose from.
|
|
|
|
If there is a single option to choose from, it will be chosen automatically.
|
|
|
|
This interactive behavior can be disabled by explicitly specifying a device
|
|
|
|
type and organization.
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet create MyFleet
|
|
|
|
$ balena fleet create MyFleet --organization mmyorg
|
|
|
|
$ balena fleet create MyFleet -o myorg --type raspberry-pi
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2019-08-07 09:28:15 +00:00
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### NAME
|
2019-08-07 09:28:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet name
|
2019-08-07 09:28:15 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -o, --organization ORGANIZATION
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
handle of the organization the fleet should belong to
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -t, --type TYPE
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet device type (Check available types with `balena devices supported`)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Display detailed information about a single fleet.
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2021-07-15 13:41:38 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet MyFleet
|
|
|
|
$ balena fleet myorg/myfleet
|
|
|
|
$ balena fleet myorg/myfleet --view
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2019-04-02 11:26:21 +00:00
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### FLEET
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2019-12-10 00:07:16 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --view
|
2019-12-10 00:07:16 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
open fleet dashboard page
|
2019-03-04 15:02:09 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -j, --json
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2024-07-17 14:39:25 +00:00
|
|
|
produce JSON output instead of tabular output
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet pin
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Pin a fleet to a release.
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Note, if the commit is omitted, the currently pinned release will be printed, with instructions for how to see a list of releases
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet pin myfleet
|
|
|
|
$ balena fleet pin myorg/myfleet 91165e5
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2019-09-06 13:43:53 +00:00
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### SLUG
|
2019-09-06 13:43:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the slug of the fleet to pin to a release
|
2019-09-06 13:43:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### RELEASETOPINTO
|
2019-09-06 13:43:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the commit of the release for the fleet to get pinned to
|
2019-09-06 13:43:53 +00:00
|
|
|
|
2015-07-07 22:01:25 +00:00
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet purge
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Purge data from all devices belonging to a fleet.
|
|
|
|
This will clear the fleet's '/data' directory.
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
2015-07-07 22:01:25 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet purge MyFleet
|
|
|
|
$ balena fleet purge myorg/myfleet
|
2019-12-11 17:47:54 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### FLEET
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet name or slug (preferred)
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet rename
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Rename a fleet.
|
|
|
|
|
|
|
|
Note, if the `newName` parameter is omitted, it will be
|
|
|
|
prompted for interactively.
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2020-05-26 09:17:30 +00:00
|
|
|
Examples:
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet rename OldName
|
|
|
|
$ balena fleet rename OldName NewName
|
|
|
|
$ balena fleet rename myorg/oldname NewName
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### FLEET
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### NEWNAME
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the new name for the fleet
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet restart
|
2020-05-26 09:17:30 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Restart all devices belonging to a fleet.
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2018-12-10 21:05:35 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet restart MyFleet
|
|
|
|
$ balena fleet restart myorg/myfleet
|
2020-05-26 09:17:30 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### FLEET
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet rm
|
2020-05-26 09:17:30 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Permanently remove a fleet.
|
2020-05-26 09:17:30 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
The --yes option may be used to avoid interactive confirmation.
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2018-12-10 21:05:35 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleet rm MyFleet
|
|
|
|
$ balena fleet rm MyFleet --yes
|
|
|
|
$ balena fleet rm myorg/myfleet
|
2020-05-26 09:17:30 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### FLEET
|
2020-05-26 09:17:30 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet name or slug (preferred)
|
2020-05-26 09:17:30 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-05-26 09:17:30 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
answer "yes" to all questions (non interactive use)
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleet track-latest
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Make this fleet track the latest release.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena fleet track-latest myorg/myfleet
|
|
|
|
$ balena fleet track-latest myfleet
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### SLUG
|
|
|
|
|
|
|
|
the slug of the fleet to make track the latest release
|
2018-12-10 21:05:35 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## fleets
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
List all your balena fleets.
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
For detailed information on a particular fleet, use
|
|
|
|
`balena fleet <fleet>`
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena fleets
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -j, --json
|
|
|
|
|
2024-07-17 14:39:25 +00:00
|
|
|
produce JSON output instead of tabular output
|
2018-12-10 21:05:35 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
# Local
|
2020-09-16 13:53:46 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## local configure
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Configure or reconfigure a balenaOS drive or image.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena local configure /dev/sdc
|
|
|
|
$ balena local configure path/to/image.img
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-04-17 13:19:33 +00:00
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### TARGET
|
2020-04-17 13:19:33 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path of drive or image to configure
|
2020-04-17 13:19:33 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## local flash
|
2020-04-17 13:19:33 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Flash a balenaOS image to a drive.
|
|
|
|
Image file may be one of: .img|.zip|.gz|.bz2|.xz
|
2020-04-17 13:19:33 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
If --drive is not specified, then it will interactively
|
|
|
|
show a list of available drives for selection.
|
2020-04-17 13:19:33 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena local flash path/to/balenaos.img
|
|
|
|
$ balena local flash path/to/balenaos.img --drive /dev/disk2
|
|
|
|
$ balena local flash path/to/balenaos.img --drive /dev/disk2 --yes
|
2020-04-17 13:19:33 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### IMAGE
|
2020-04-17 13:19:33 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path to OS image
|
2020-04-17 13:19:33 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --drive DRIVE
|
|
|
|
|
|
|
|
the drive to write the image to, eg. `/dev/sdb` or `/dev/mmcblk0`.
|
|
|
|
Careful with this as you can erase your hard drive.
|
|
|
|
Check `balena util available-drives` for available options.
|
|
|
|
|
2020-04-17 13:19:33 +00:00
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
answer "yes" to all questions (non interactive use)
|
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
# Logs
|
2015-04-16 14:42:09 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## logs
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-07-01 13:52:33 +00:00
|
|
|
Show logs for a specific device.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2019-04-24 12:04:49 +00:00
|
|
|
By default, the command prints all log messages and exits.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
To continuously stream output, and see new logs in real time, use the `--tail` option.
|
|
|
|
|
2019-04-24 16:47:08 +00:00
|
|
|
If an IP or .local address is passed to this command, logs are displayed from
|
2019-04-24 12:04:49 +00:00
|
|
|
a local mode device with that address. Note that --tail is implied
|
2019-04-24 16:47:08 +00:00
|
|
|
when this command is provided a local mode device.
|
2019-04-24 11:08:26 +00:00
|
|
|
|
2019-04-24 16:30:18 +00:00
|
|
|
Logs from a single service can be displayed with the --service flag. Just system logs
|
|
|
|
can be shown with the --system flag. Note that these flags can be used together.
|
2019-04-24 13:59:07 +00:00
|
|
|
|
2020-07-01 13:52:33 +00:00
|
|
|
Note: --service and --system flags must come after the device parameter, as per examples.
|
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
Examples:
|
|
|
|
|
2018-10-19 14:38:50 +00:00
|
|
|
$ balena logs 23c73a1
|
2019-04-24 12:04:49 +00:00
|
|
|
$ balena logs 23c73a1 --tail
|
2020-07-01 13:52:33 +00:00
|
|
|
|
2019-04-24 11:08:26 +00:00
|
|
|
$ balena logs 192.168.0.31
|
2019-04-24 13:59:07 +00:00
|
|
|
$ balena logs 192.168.0.31 --service my-service
|
2019-05-28 15:56:39 +00:00
|
|
|
$ balena logs 192.168.0.31 --service my-service-1 --service my-service-2
|
2020-07-01 13:52:33 +00:00
|
|
|
|
2019-04-24 16:47:08 +00:00
|
|
|
$ balena logs 23c73a1.local --system
|
|
|
|
$ balena logs 23c73a1.local --system --service my-service
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-07-01 13:52:33 +00:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### DEVICE
|
|
|
|
|
|
|
|
device UUID, IP, or .local address
|
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
### Options
|
|
|
|
|
2020-11-07 22:28:14 +00:00
|
|
|
#### --max-retry MAX-RETRY
|
|
|
|
|
|
|
|
Maximum number of reconnection attempts on "connection lost" errors
|
|
|
|
(use 0 to disable auto reconnection).
|
|
|
|
|
2020-07-01 13:52:33 +00:00
|
|
|
#### -t, --tail
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
continuously stream output
|
|
|
|
|
2020-07-01 13:52:33 +00:00
|
|
|
#### -s, --service SERVICE
|
2019-04-24 13:59:07 +00:00
|
|
|
|
2019-05-28 15:56:39 +00:00
|
|
|
Reject logs not originating from this service.
|
|
|
|
This can be used in combination with --system or other --service flags.
|
2019-04-24 16:30:18 +00:00
|
|
|
|
2020-07-01 13:52:33 +00:00
|
|
|
#### -S, --system
|
2019-04-24 16:30:18 +00:00
|
|
|
|
|
|
|
Only show system logs. This can be used in combination with --service.
|
2019-04-24 13:59:07 +00:00
|
|
|
|
2019-06-05 22:17:59 +00:00
|
|
|
# Network
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## scan
|
2019-06-05 22:17:59 +00:00
|
|
|
|
2020-03-13 11:32:29 +00:00
|
|
|
Scan for balenaOS devices on your local network.
|
2019-06-05 22:17:59 +00:00
|
|
|
|
2020-11-30 12:50:21 +00:00
|
|
|
The output includes device information collected through balenaEngine for
|
|
|
|
devices running a development image of balenaOS. Devices running a production
|
|
|
|
image do not expose balenaEngine (on TCP port 2375), which is why less
|
|
|
|
information is printed about them.
|
|
|
|
|
2019-06-05 22:17:59 +00:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena scan
|
|
|
|
$ balena scan --timeout 120
|
|
|
|
$ balena scan --verbose
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2020-03-13 11:32:29 +00:00
|
|
|
#### -v, --verbose
|
2019-06-05 22:17:59 +00:00
|
|
|
|
2020-03-13 11:32:29 +00:00
|
|
|
display full info
|
2019-06-05 22:17:59 +00:00
|
|
|
|
2020-03-13 11:32:29 +00:00
|
|
|
#### -t, --timeout TIMEOUT
|
2019-06-05 22:17:59 +00:00
|
|
|
|
2020-03-13 11:32:29 +00:00
|
|
|
scan timeout in seconds
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2020-10-06 17:04:43 +00:00
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## ssh
|
2016-05-19 14:10:45 +00:00
|
|
|
|
2020-06-24 13:24:54 +00:00
|
|
|
Start a shell on a local or remote device. If a service name is not provided,
|
|
|
|
a shell will be opened on the host OS.
|
2019-04-24 17:45:19 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
If a fleet is provided, an interactive menu will be presented for the selection
|
|
|
|
of an online device. A shell will then be opened for the host OS or service
|
|
|
|
container of the chosen device.
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2019-08-09 20:00:20 +00:00
|
|
|
For local devices, the IP address and .local domain name are supported.
|
|
|
|
If the device is referenced by IP or `.local` address, the connection
|
|
|
|
is initiated directly to balenaOS on port `22222` via an
|
|
|
|
openssh-compatible client. Otherwise, any connection initiated remotely
|
|
|
|
traverses the balenaCloud VPN.
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2020-06-24 13:24:54 +00:00
|
|
|
Commands may be piped to the standard input for remote execution (see examples).
|
|
|
|
Note however that remote command execution on service containers (as opposed to
|
|
|
|
the host OS) is not currently possible when a device UUID is used (instead of
|
|
|
|
an IP address) because of a balenaCloud backend limitation.
|
|
|
|
|
|
|
|
Note: `balena ssh` requires an openssh-compatible client to be correctly
|
|
|
|
installed in your shell environment. For more information (including Windows
|
|
|
|
support) please check:
|
|
|
|
https://github.com/balena-io/balena-cli/blob/master/INSTALL.md#additional-dependencies,
|
|
|
|
|
2016-04-24 19:52:41 +00:00
|
|
|
Examples:
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena ssh MyFleet
|
2020-06-24 13:24:54 +00:00
|
|
|
$ balena ssh f49cefd
|
|
|
|
$ balena ssh f49cefd my-service
|
|
|
|
$ balena ssh f49cefd --port <port>
|
|
|
|
$ balena ssh 192.168.0.1 --verbose
|
|
|
|
$ balena ssh f49cefd.local my-service
|
|
|
|
$ echo "uptime; exit;" | balena ssh f49cefd
|
|
|
|
$ echo "uptime; exit;" | balena ssh 192.168.0.1 myService
|
2019-04-24 17:45:19 +00:00
|
|
|
|
2020-06-24 13:24:54 +00:00
|
|
|
### Arguments
|
2019-04-24 17:45:19 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### FLEETORDEVICE
|
2020-06-24 13:24:54 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name/slug, device uuid, or address of local device
|
2020-06-24 13:24:54 +00:00
|
|
|
|
2020-09-04 14:34:34 +00:00
|
|
|
#### SERVICE
|
2020-06-24 13:24:54 +00:00
|
|
|
|
|
|
|
service name, if connecting to a container
|
2016-04-24 19:52:41 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2020-06-24 13:24:54 +00:00
|
|
|
#### -p, --port PORT
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2020-03-27 01:26:37 +00:00
|
|
|
SSH server port number (default 22222) if the target is an IP address or .local
|
|
|
|
hostname. Otherwise, port number for the balenaCloud gateway (default 22).
|
2016-04-24 19:52:41 +00:00
|
|
|
|
2020-06-24 13:24:54 +00:00
|
|
|
#### -t, --tty
|
2020-03-31 13:50:09 +00:00
|
|
|
|
2020-12-16 15:57:25 +00:00
|
|
|
force pseudo-terminal allocation (bypass TTY autodetection for stdin)
|
2020-03-31 13:50:09 +00:00
|
|
|
|
2020-06-24 13:24:54 +00:00
|
|
|
#### -v, --verbose
|
2016-06-22 13:46:18 +00:00
|
|
|
|
2020-12-16 15:57:25 +00:00
|
|
|
increase verbosity
|
2017-12-18 10:36:58 +00:00
|
|
|
|
2017-05-18 22:44:30 +00:00
|
|
|
#### --noproxy
|
2017-05-18 22:25:01 +00:00
|
|
|
|
2020-12-16 15:57:25 +00:00
|
|
|
bypass global proxy configuration for the ssh connection
|
2019-03-11 18:54:22 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## tunnel
|
2019-04-18 15:49:17 +00:00
|
|
|
|
2021-01-22 15:06:18 +00:00
|
|
|
Use this command to open local TCP ports that tunnel to listening sockets in a
|
|
|
|
balenaOS device.
|
2019-04-18 15:49:17 +00:00
|
|
|
|
2021-01-22 15:06:18 +00:00
|
|
|
For example, this command could be used to expose the ssh server of a balenaOS
|
|
|
|
device (port number 22222) on the local machine, or to expose a web server
|
|
|
|
running on the device. The port numbers do not have be the same between the
|
|
|
|
device and the local machine, and multiple ports may be tunneled in a single
|
|
|
|
command line.
|
2019-04-18 15:49:17 +00:00
|
|
|
|
2020-06-29 12:45:32 +00:00
|
|
|
Port mappings are specified in the format: <remotePort>[:[localIP:]localPort]
|
2021-01-22 15:06:18 +00:00
|
|
|
localIP defaults to 'localhost', and localPort defaults to the specified
|
|
|
|
remotePort value.
|
2020-06-29 12:45:32 +00:00
|
|
|
|
2021-01-22 15:06:18 +00:00
|
|
|
Note: the -p (--port) flag must be provided at the end of the command line,
|
|
|
|
as per examples.
|
2019-04-18 15:49:17 +00:00
|
|
|
|
2021-01-22 15:06:18 +00:00
|
|
|
In the case of openBalena, the tunnel command in CLI v12.38.5 or later requires
|
|
|
|
openBalena v3.1.2 or later. Older CLI versions work with older openBalena
|
|
|
|
versions.
|
2020-06-29 12:45:32 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
# map remote port 22222 to localhost:22222
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena tunnel myFleet -p 22222
|
2020-06-29 12:45:32 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
# map remote port 22222 to localhost:222
|
2020-06-29 12:45:32 +00:00
|
|
|
$ balena tunnel 2ead211 -p 22222:222
|
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
# map remote port 22222 to any address on your host machine, port 22222
|
2020-06-29 12:45:32 +00:00
|
|
|
$ balena tunnel 1546690 -p 22222:0.0.0.0
|
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
# map remote port 22222 to any address on your host machine, port 222
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena tunnel myFleet -p 22222:0.0.0.0:222
|
2020-06-29 12:45:32 +00:00
|
|
|
|
2019-04-18 15:49:17 +00:00
|
|
|
# multiple port tunnels can be specified at any one time
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena tunnel myFleet -p 8080:3000 -p 8081:9000
|
2020-06-29 12:45:32 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### DEVICEORFLEET
|
2020-06-29 12:45:32 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
device UUID or fleet name/slug
|
2019-04-18 15:49:17 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2020-06-29 12:45:32 +00:00
|
|
|
#### -p, --port PORT
|
2019-04-18 15:49:17 +00:00
|
|
|
|
2020-06-29 12:45:32 +00:00
|
|
|
port mapping in the format <remotePort>[:[localIP:]localPort]
|
2019-04-18 15:49:17 +00:00
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
# Notes
|
2015-04-16 14:42:09 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## notes
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-03-25 17:07:17 +00:00
|
|
|
Set or update a device note. If the note argument is not provided,
|
|
|
|
it will be read from stdin.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-03-25 17:07:17 +00:00
|
|
|
To view device notes, use the `balena device <uuid>` command.
|
2015-04-16 13:34:40 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2018-10-19 14:38:50 +00:00
|
|
|
$ balena note "My useful note" --device 7cf02a6
|
|
|
|
$ cat note.txt | balena note --device 7cf02a6
|
2015-04-16 13:34:40 +00:00
|
|
|
|
2020-03-25 17:07:17 +00:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### NOTE
|
|
|
|
|
|
|
|
note content
|
|
|
|
|
2015-04-16 13:34:40 +00:00
|
|
|
### Options
|
|
|
|
|
2020-03-25 17:07:17 +00:00
|
|
|
#### -d, --device DEVICE
|
|
|
|
|
|
|
|
device UUID
|
|
|
|
|
|
|
|
#### --dev DEV
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
# Organizations
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## orgs
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
list all the organizations that you are a member of.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena orgs
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2015-09-29 17:03:14 +00:00
|
|
|
# OS
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## os build-config
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2021-12-25 02:19:11 +00:00
|
|
|
Interactively generate a configuration file that can then be used as
|
|
|
|
non-interactive input by the 'balena os configure' command.
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-07-16 10:15:06 +00:00
|
|
|
Examples:
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2018-10-19 14:38:50 +00:00
|
|
|
$ balena os build-config ../path/rpi3.img raspberrypi3 --output rpi3-config.json
|
2019-05-15 18:15:57 +00:00
|
|
|
$ balena os configure ../path/rpi3.img --device 7cf02a6 --config rpi3-config.json
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-07-16 10:15:06 +00:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### IMAGE
|
|
|
|
|
|
|
|
os image
|
|
|
|
|
|
|
|
#### DEVICE-TYPE
|
|
|
|
|
|
|
|
device type
|
|
|
|
|
2017-06-12 10:21:12 +00:00
|
|
|
### Options
|
|
|
|
|
2020-07-16 10:15:06 +00:00
|
|
|
#### -v, --advanced
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2017-06-14 21:51:56 +00:00
|
|
|
show advanced configuration options
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-07-16 10:15:06 +00:00
|
|
|
#### -o, --output OUTPUT
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2020-07-16 10:15:06 +00:00
|
|
|
path to output JSON file
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## os configure
|
2015-09-29 17:36:29 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Configure a previously downloaded balenaOS image for a specific device type
|
|
|
|
or fleet.
|
2015-09-29 17:36:29 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
Configuration settings such as WiFi authentication will be taken from the
|
|
|
|
following sources, in precedence order:
|
|
|
|
1. Command-line options like `--config-wifi-ssid`
|
|
|
|
2. A given `config.json` file specified with the `--config` option.
|
|
|
|
3. User input through interactive prompts (text menus).
|
2018-07-11 18:56:13 +00:00
|
|
|
|
2021-12-24 15:10:59 +00:00
|
|
|
The --device-type option is used to override the fleet's default device type,
|
|
|
|
in case of a fleet with mixed device types.
|
|
|
|
|
|
|
|
The '--dev' option is used to configure balenaOS to operate in development mode,
|
|
|
|
allowing anauthenticated root ssh access and exposing network ports such as
|
|
|
|
balenaEngine's 2375 (unencrypted). This option causes `"developmentMode": true`
|
|
|
|
to be inserted in the 'config.json' file in the image's boot partion. Development
|
|
|
|
mode (as a configurable option) is applicable to balenaOS releases from early
|
|
|
|
2022. Older releases have separate development and production balenaOS images
|
|
|
|
that cannot be reconfigured through 'config.json' or the '--dev' option. Do not
|
|
|
|
confuse the balenaOS "development mode" with a device's "local mode", the latter
|
|
|
|
being a supervisor feature that allows the "balena push" command to push a user's
|
|
|
|
application directly to a device in the local network.
|
|
|
|
|
2023-05-12 14:02:32 +00:00
|
|
|
The '--secureBoot' option is used to configure a balenaOS installer image to opt-in
|
|
|
|
secure boot and disk encryption.
|
|
|
|
|
2021-12-24 15:10:59 +00:00
|
|
|
The --system-connection (-c) option is used to inject NetworkManager connection
|
2020-01-21 16:51:06 +00:00
|
|
|
profiles for additional network interfaces, such as cellular/GSM or additional
|
|
|
|
WiFi or ethernet connections. This option may be passed multiple times in case there
|
|
|
|
are multiple files to inject. See connection profile examples and reference at:
|
|
|
|
https://www.balena.io/docs/reference/OS/network/2.x/
|
2021-03-30 09:06:30 +00:00
|
|
|
https://developer.gnome.org/NetworkManager/stable/ref-settings.html
|
2020-01-21 16:51:06 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2015-09-29 17:36:29 +00:00
|
|
|
Examples:
|
|
|
|
|
2018-12-07 15:44:18 +00:00
|
|
|
$ balena os configure ../path/rpi3.img --device 7cf02a6
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena os configure ../path/rpi3.img --fleet myorg/myfleet
|
|
|
|
$ balena os configure ../path/rpi3.img --fleet MyFleet --version 2.12.7
|
|
|
|
$ balena os configure ../path/rpi3.img -f MyFinFleet --device-type raspberrypi3
|
|
|
|
$ balena os configure ../path/rpi3.img -f MyFinFleet --device-type raspberrypi3 --config myWifiConfig.json
|
2019-10-31 01:46:14 +00:00
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### IMAGE
|
|
|
|
|
|
|
|
path to a balenaOS image file, e.g. "rpi3.img"
|
2015-09-29 17:36:29 +00:00
|
|
|
|
2015-10-19 17:38:09 +00:00
|
|
|
### Options
|
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
#### -v, --advanced
|
2015-10-19 17:38:09 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
ask advanced configuration questions (when in interactive mode)
|
2015-10-19 17:38:09 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2017-11-16 18:13:20 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
#### --config CONFIG
|
2017-11-16 18:13:20 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
path to a pre-generated config.json file to be injected in the OS image
|
2017-11-16 18:13:20 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
#### --config-app-update-poll-interval CONFIG-APP-UPDATE-POLL-INTERVAL
|
2017-11-16 18:13:20 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
supervisor cloud polling interval in minutes (e.g. for variable updates)
|
2017-11-16 18:13:20 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
#### --config-network CONFIG-NETWORK
|
2018-12-07 15:44:18 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
device network type (non-interactive configuration)
|
2018-12-07 15:44:18 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
#### --config-wifi-key CONFIG-WIFI-KEY
|
2018-07-11 18:56:13 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
WiFi key (password) (non-interactive configuration)
|
2018-07-11 18:56:13 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
#### --config-wifi-ssid CONFIG-WIFI-SSID
|
2017-06-12 10:21:12 +00:00
|
|
|
|
2019-10-31 01:46:14 +00:00
|
|
|
WiFi SSID (network name) (non-interactive configuration)
|
|
|
|
|
2021-12-24 15:10:59 +00:00
|
|
|
#### --dev
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Configure balenaOS to operate in development mode
|
2016-02-27 02:37:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --secureBoot
|
2016-02-27 02:37:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Configure balenaOS installer to opt-in secure boot and disk encryption
|
2021-11-24 22:59:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --device DEVICE
|
2021-11-24 22:59:31 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device UUID
|
2016-02-27 02:37:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --device-type DEVICE-TYPE
|
2021-11-24 23:00:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device type slug (e.g. "raspberrypi3") to override the fleet device type
|
2021-11-24 23:00:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --initial-device-name INITIAL-DEVICE-NAME
|
2018-07-11 18:56:13 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
This option will set the device name when the device provisions
|
2018-07-11 18:56:13 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --version VERSION
|
2016-03-28 13:25:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
balenaOS version, for example "2.32.0" or "2.44.0+rev1"
|
2016-03-28 13:25:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -c, --system-connection SYSTEM-CONNECTION
|
2017-04-19 03:21:59 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
paths to local files to place into the 'system-connections' directory
|
2017-04-19 03:21:59 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --provisioning-key-name PROVISIONING-KEY-NAME
|
2018-12-07 15:44:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
custom key name assigned to generated provisioning api key
|
2018-12-07 15:44:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### --provisioning-key-expiry-date PROVISIONING-KEY-EXPIRY-DATE
|
2021-11-24 23:00:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)
|
2021-11-24 23:00:38 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## os download
|
2024-09-30 15:25:43 +00:00
|
|
|
|
|
|
|
Download an unconfigured OS image for the specified device type.
|
|
|
|
Check available device types with 'balena devices supported'.
|
|
|
|
|
|
|
|
Note: Currently this command only works with balenaCloud, not openBalena.
|
|
|
|
If using openBalena, please download the OS from: https://www.balena.io/os/
|
|
|
|
|
|
|
|
The '--version' option is used to select the balenaOS version. If omitted,
|
|
|
|
the latest released version is downloaded (and if only pre-release versions
|
|
|
|
exist, the latest pre-release version is downloaded).
|
|
|
|
|
|
|
|
Use '--version menu' or '--version menu-esr' to interactively select the
|
|
|
|
OS version. The latter lists ESR versions which are only available for
|
|
|
|
download on Production and Enterprise plans. See also:
|
|
|
|
https://www.balena.io/docs/reference/OS/extended-support-release/
|
|
|
|
|
|
|
|
Development images can be selected by appending `.dev` to the version.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version 2.101.7
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version 2022.7.0
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version ^2.90.0
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version 2.60.1+rev1
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version 2.60.1+rev1.dev
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version 2021.10.2.prod
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version latest
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version default
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version menu
|
|
|
|
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version menu-esr
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### TYPE
|
|
|
|
|
|
|
|
the device type
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -o, --output OUTPUT
|
|
|
|
|
|
|
|
output path
|
|
|
|
|
|
|
|
#### --version VERSION
|
|
|
|
|
|
|
|
version number (ESR or non-ESR versions),
|
|
|
|
or semver range (non-ESR versions only),
|
|
|
|
or 'latest' (includes pre-releases),
|
|
|
|
or 'default' (excludes pre-releases if at least one released version is available),
|
|
|
|
or 'recommended' (excludes pre-releases, will fail if only pre-release versions are available),
|
|
|
|
or 'menu' (interactive menu, non-ESR versions),
|
|
|
|
or 'menu-esr' (interactive menu, ESR versions)
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## os initialize
|
2018-07-10 17:45:48 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Initialize an os image for a device with a previously
|
|
|
|
configured operating system image and flash the
|
|
|
|
an external storage drive or the device's storage
|
|
|
|
medium depending on the device type.
|
|
|
|
|
2021-11-24 23:00:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Note: Initializing the device may ask for administrative permissions
|
|
|
|
because we need to access the raw devices directly.
|
2018-07-10 17:45:48 +00:00
|
|
|
|
2020-07-28 12:40:47 +00:00
|
|
|
Examples:
|
2016-02-27 02:37:15 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena os initialize ../path/rpi.img --type raspberry-pi
|
2016-02-27 02:37:15 +00:00
|
|
|
|
2020-07-28 12:40:47 +00:00
|
|
|
### Arguments
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### IMAGE
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
path to OS image
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -t, --type TYPE
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device type (Check available types with `balena devices supported`)
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2020-07-28 12:40:47 +00:00
|
|
|
#### -d, --drive DRIVE
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the drive to write the image to, eg. `/dev/sdb` or `/dev/mmcblk0`.
|
|
|
|
Careful with this as you can erase your hard drive.
|
|
|
|
Check `balena util available-drives` for available options.
|
|
|
|
|
|
|
|
#### -y, --yes
|
|
|
|
|
|
|
|
answer "yes" to all questions (non interactive use)
|
2017-11-14 13:14:53 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## os versions
|
2024-09-30 15:25:43 +00:00
|
|
|
|
|
|
|
Show the available balenaOS versions for the given device type.
|
|
|
|
Check available types with `balena devices supported`.
|
|
|
|
|
|
|
|
balenaOS ESR versions can be listed with the '--esr' option. See also:
|
|
|
|
https://www.balena.io/docs/reference/OS/extended-support-release/
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena os versions raspberrypi3
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### TYPE
|
|
|
|
|
|
|
|
device type
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### --esr
|
|
|
|
|
|
|
|
select balenaOS ESR versions
|
|
|
|
|
|
|
|
#### --include-draft
|
|
|
|
|
|
|
|
include pre-release balenaOS versions
|
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
# Platform
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## join
|
2023-11-07 22:33:48 +00:00
|
|
|
|
|
|
|
Move a local device to a fleet on another balena server, causing
|
|
|
|
the device to "join" the new server. The device must be running balenaOS.
|
|
|
|
|
|
|
|
For example, you could provision a device against an openBalena installation
|
|
|
|
where you perform end-to-end tests and then move it to balenaCloud when it's
|
|
|
|
ready for production.
|
|
|
|
|
|
|
|
To move a device between fleets on the same server, use the
|
|
|
|
`balena device move` command instead of `balena join`.
|
|
|
|
|
|
|
|
If you don't specify a device hostname or IP, this command will automatically
|
|
|
|
scan the local network for balenaOS devices and prompt you to select one
|
|
|
|
from an interactive picker. This may require administrator/root privileges.
|
|
|
|
Likewise, if the fleet option is not provided then a picker will be shown.
|
|
|
|
|
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena join
|
|
|
|
$ balena join balena.local
|
|
|
|
$ balena join balena.local --fleet MyFleet
|
|
|
|
$ balena join balena.local -f myorg/myfleet
|
|
|
|
$ balena join 192.168.1.25
|
|
|
|
$ balena join 192.168.1.25 --fleet MyFleet
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### DEVICEIPORHOSTNAME
|
|
|
|
|
|
|
|
the IP or hostname of device
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
fleet name or slug (preferred)
|
|
|
|
|
|
|
|
#### -i, --pollInterval POLLINTERVAL
|
|
|
|
|
|
|
|
the interval in minutes to check for updates
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## leave
|
2023-11-07 22:33:48 +00:00
|
|
|
|
|
|
|
Remove a local device from its balena fleet, causing the device to
|
|
|
|
"leave" the server it is provisioned on. This effectively makes the device
|
|
|
|
"unmanaged". The device must be running balenaOS.
|
|
|
|
|
|
|
|
The device entry on the server is preserved after running this command,
|
|
|
|
so the device can subsequently re-join the server if needed.
|
|
|
|
|
|
|
|
If you don't specify a device hostname or IP, this command will automatically
|
|
|
|
scan the local network for balenaOS devices and prompt you to select one
|
|
|
|
from an interactive picker. This may require administrator/root privileges.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena leave
|
|
|
|
$ balena leave balena.local
|
|
|
|
$ balena leave 192.168.1.25
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### DEVICEIPORHOSTNAME
|
|
|
|
|
|
|
|
the device IP or hostname
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2017-10-25 11:17:07 +00:00
|
|
|
# Preload
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## preload
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Preload a release (service images/containers) from a balena fleet, and optionally
|
2020-05-15 20:39:45 +00:00
|
|
|
a balenaOS splash screen, in a previously downloaded '.img' balenaOS image file
|
|
|
|
in the local disk (a zip file is only accepted for the Intel Edison device type).
|
|
|
|
After preloading, the balenaOS image file can be flashed to a device's SD card.
|
2021-07-15 13:41:38 +00:00
|
|
|
When the device boots, it will not need to download the release, as it was
|
2021-04-04 21:47:27 +00:00
|
|
|
preloaded. This is usually combined with release pinning
|
|
|
|
(https://www.balena.io/docs/learn/deploy/release-strategy/release-policy/)
|
2021-07-15 13:41:38 +00:00
|
|
|
to avoid the device downloading a newer release straight away, if available.
|
2021-04-04 21:47:27 +00:00
|
|
|
Check also the Preloading and Preregistering section of the balena CLI's advanced
|
|
|
|
masterclass document:
|
|
|
|
https://www.balena.io/docs/learn/more/masterclasses/advanced-cli/#5-preloading-and-preregistering
|
2019-11-08 14:32:21 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2021-04-04 21:47:27 +00:00
|
|
|
Note that the this command requires Docker to be installed, as further detailed
|
|
|
|
in the balena CLI's installation instructions:
|
|
|
|
https://github.com/balena-io/balena-cli/blob/master/INSTALL.md
|
|
|
|
The `--dockerHost` and `--dockerPort` flags allow a remote Docker engine to
|
|
|
|
be used, however the image file must be accessible to the remote Docker engine
|
|
|
|
on the same path given on the command line. This is because Docker's bind mount
|
|
|
|
feature is used to "share" the image with a container that performs the preload.
|
2017-10-25 11:17:07 +00:00
|
|
|
|
|
|
|
Examples:
|
2018-10-03 13:27:53 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena preload balena.img --fleet MyFleet --commit e1f2592fc6ee949e68756d4f4a48e49bff8d72a0
|
|
|
|
$ balena preload balena.img --fleet myorg/myfleet --splash-image image.png
|
2018-10-19 14:38:50 +00:00
|
|
|
$ balena preload balena.img
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### IMAGE
|
|
|
|
|
|
|
|
the image file path
|
|
|
|
|
2017-10-25 11:17:07 +00:00
|
|
|
### Options
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### -c, --commit COMMIT
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
The commit hash of the release to preload. Use "current" to specify the current
|
|
|
|
release (ignored if no appId is given). The current release is usually also the
|
|
|
|
latest, but can be pinned to a specific release. See:
|
|
|
|
https://www.balena.io/docs/learn/deploy/release-strategy/release-policy/
|
|
|
|
https://www.balena.io/docs/learn/more/masterclasses/fleet-management/#63-pin-using-the-api
|
|
|
|
https://github.com/balena-io-examples/staged-releases
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### -s, --splash-image SPLASH-IMAGE
|
2017-10-25 11:17:07 +00:00
|
|
|
|
|
|
|
path to a png image to replace the splash screen
|
|
|
|
|
2018-08-20 16:19:10 +00:00
|
|
|
#### --dont-check-arch
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
disable architecture compatibility check between image and fleet
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### -p, --pin-device-to-release
|
2018-05-30 13:33:05 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
pin the preloaded device to the preloaded release on provision
|
2018-05-30 13:33:05 +00:00
|
|
|
|
2020-12-28 16:08:20 +00:00
|
|
|
#### --additional-space ADDITIONAL-SPACE
|
|
|
|
|
|
|
|
expand the image by this amount of bytes instead of automatically estimating the required amount
|
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### --add-certificate ADD-CERTIFICATE
|
2019-05-30 11:57:03 +00:00
|
|
|
|
|
|
|
Add the given certificate (in PEM format) to /etc/ssl/certs in the preloading container.
|
|
|
|
The file name must end with '.crt' and must not be already contained in the preloader's
|
|
|
|
/etc/ssl/certs folder.
|
|
|
|
Can be repeated to add multiple certificates.
|
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### -P, --docker DOCKER
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2019-02-26 13:32:27 +00:00
|
|
|
Path to a local docker socket (e.g. /var/run/docker.sock)
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### -h, --dockerHost DOCKERHOST
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2019-02-26 13:32:27 +00:00
|
|
|
Docker daemon hostname or IP address (dev machine or balena device)
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### --dockerPort DOCKERPORT
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2019-02-26 13:32:27 +00:00
|
|
|
Docker daemon TCP port number (hint: 2375 for balena devices)
|
2017-10-25 11:17:07 +00:00
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### --ca CA
|
2017-10-25 11:17:07 +00:00
|
|
|
|
|
|
|
Docker host TLS certificate authority file
|
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### --cert CERT
|
2017-10-25 11:17:07 +00:00
|
|
|
|
|
|
|
Docker host TLS certificate file
|
|
|
|
|
2020-08-26 08:39:47 +00:00
|
|
|
#### --key KEY
|
2017-10-25 11:17:07 +00:00
|
|
|
|
|
|
|
Docker host TLS key file
|
|
|
|
|
2018-06-26 16:59:44 +00:00
|
|
|
# Push
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## push
|
2018-06-26 16:59:44 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Build release images on balenaCloud servers or on a local mode device.
|
2018-10-16 10:25:37 +00:00
|
|
|
|
2019-02-27 18:01:47 +00:00
|
|
|
When building on the balenaCloud servers, the given source directory will be
|
|
|
|
sent to the remote server. This can be used as a drop-in replacement for the
|
|
|
|
"git push" deployment method.
|
2018-06-26 16:59:44 +00:00
|
|
|
|
2019-04-23 10:38:13 +00:00
|
|
|
When building on a local mode device, the given source directory will be
|
2019-02-27 18:01:47 +00:00
|
|
|
built on the device, and the resulting containers will be run on the device.
|
|
|
|
Logs will be streamed back from the device as part of the same invocation.
|
|
|
|
The web dashboard can be used to switch a device to local mode:
|
|
|
|
https://www.balena.io/docs/learn/develop/local-mode/
|
2019-04-23 10:38:13 +00:00
|
|
|
Note that local mode requires a supervisor version of at least v7.21.0.
|
2019-04-24 16:30:18 +00:00
|
|
|
The logs from only a single service can be shown with the --service flag, and
|
|
|
|
showing only the system logs can be achieved with --system. Note that these
|
|
|
|
flags can be used together.
|
2019-04-23 10:38:13 +00:00
|
|
|
|
2019-05-29 14:09:05 +00:00
|
|
|
When pushing to a local device a live session will be started.
|
|
|
|
The project source folder is watched for filesystem events, and changes
|
|
|
|
to files and folders are automatically synchronized to the running
|
2020-01-03 18:37:55 +00:00
|
|
|
containers. The synchronization is only in one direction, from this machine to
|
2019-05-29 14:09:05 +00:00
|
|
|
the device, and changes made on the device itself may be overwritten.
|
|
|
|
This feature requires a device running supervisor version v9.7.0 or greater.
|
2018-11-07 18:15:05 +00:00
|
|
|
|
2020-06-24 23:01:53 +00:00
|
|
|
REGISTRY SECRETS
|
2018-11-07 18:15:05 +00:00
|
|
|
The --registry-secrets option specifies a JSON or YAML file containing private
|
|
|
|
Docker registry usernames and passwords to be used when pulling base images.
|
|
|
|
Sample registry-secrets YAML file:
|
2020-06-24 23:01:53 +00:00
|
|
|
```
|
2019-02-27 18:01:47 +00:00
|
|
|
'my-registry-server.com:25000':
|
2018-11-07 18:15:05 +00:00
|
|
|
username: ann
|
|
|
|
password: hunter2
|
2019-02-27 18:01:47 +00:00
|
|
|
'': # Use the empty string to refer to the Docker Hub
|
|
|
|
username: mike
|
|
|
|
password: cze14
|
|
|
|
'eu.gcr.io': # Google Container Registry
|
|
|
|
username: '_json_key'
|
|
|
|
password: '{escaped contents of the GCR keyfile.json file}'
|
2020-06-24 23:01:53 +00:00
|
|
|
```
|
2019-08-15 14:38:50 +00:00
|
|
|
For a sample project using registry secrets with the Google Container Registry,
|
2020-09-10 14:02:04 +00:00
|
|
|
check: https://github.com/balena-io-examples/sample-gcr-registry-secrets
|
2019-08-15 14:38:50 +00:00
|
|
|
|
|
|
|
If the --registry-secrets option is not specified, and a secrets.yml or
|
|
|
|
secrets.json file exists in the balena directory (usually $HOME/.balena),
|
|
|
|
this file will be used instead.
|
2019-06-18 10:13:09 +00:00
|
|
|
|
2020-06-24 23:01:53 +00:00
|
|
|
DOCKERIGNORE AND GITIGNORE FILES
|
2020-10-20 21:11:17 +00:00
|
|
|
By default, the balena CLI will use a single ".dockerignore" file (if any) at
|
2020-06-24 23:01:53 +00:00
|
|
|
the project root (--source directory) in order to decide which source files to
|
2020-09-08 14:30:41 +00:00
|
|
|
exclude from the "build context" (tar stream) sent to balenaCloud, Docker
|
2021-07-15 13:41:38 +00:00
|
|
|
daemon or balenaEngine. In a microservices (multicontainer) fleet, the
|
2020-09-08 14:30:41 +00:00
|
|
|
source directory is the directory that contains the "docker-compose.yml" file.
|
|
|
|
|
|
|
|
The --multi-dockerignore (-m) option may be used with microservices
|
2021-07-15 13:41:38 +00:00
|
|
|
(multicontainer) fleets that define a docker-compose.yml file. When this
|
|
|
|
option is used, each service subdirectory (defined by the `build` or
|
2020-09-08 14:30:41 +00:00
|
|
|
`build.context` service properties in the docker-compose.yml file) is
|
|
|
|
filtered separately according to a .dockerignore file defined in the service
|
|
|
|
subdirectory. If no .dockerignore file exists in a service subdirectory, then
|
|
|
|
only the default .dockerignore patterns (see below) apply for that service
|
|
|
|
subdirectory.
|
2020-06-24 23:01:53 +00:00
|
|
|
|
|
|
|
When the --multi-dockerignore (-m) option is used, the .dockerignore file (if
|
|
|
|
any) defined at the overall project root will be used to filter files and
|
|
|
|
subdirectories other than service subdirectories. It will not have any effect
|
|
|
|
on service subdirectories, whether or not a service subdirectory defines its
|
|
|
|
own .dockerignore file. Multiple .dockerignore files are not merged or added
|
2021-01-12 19:32:33 +00:00
|
|
|
together, and cannot override or extend other files. This behavior maximizes
|
2020-06-24 23:01:53 +00:00
|
|
|
compatibility with the standard docker-compose tool, while still allowing a
|
|
|
|
root .dockerignore file (at the overall project root) to filter files and
|
|
|
|
folders that are outside service subdirectories.
|
|
|
|
|
2021-12-17 12:26:05 +00:00
|
|
|
balena CLI v11 also took .gitignore files into account. This behavior was
|
|
|
|
deprecated in CLI v12 and removed in CLI v13. Please use .dockerignore files
|
|
|
|
instead.
|
2020-06-24 23:01:53 +00:00
|
|
|
|
|
|
|
Default .dockerignore patterns
|
2021-12-17 12:26:05 +00:00
|
|
|
A few default/hardcoded dockerignore patterns are "merged" (in memory) with the
|
2020-06-24 23:01:53 +00:00
|
|
|
patterns found in the applicable .dockerignore files, in the following order:
|
|
|
|
```
|
2020-05-01 11:18:11 +00:00
|
|
|
**/.git
|
2020-06-24 23:01:53 +00:00
|
|
|
< user's patterns from the applicable '.dockerignore' file, if any >
|
2020-05-01 11:18:11 +00:00
|
|
|
!**/.balena
|
|
|
|
!**/.resin
|
|
|
|
!**/Dockerfile
|
|
|
|
!**/Dockerfile.*
|
|
|
|
!**/docker-compose.yml
|
2020-06-24 23:01:53 +00:00
|
|
|
```
|
|
|
|
These patterns always apply, whether or not .dockerignore files exist in the
|
|
|
|
project. If necessary, the effect of the `**/.git` pattern may be modified by
|
2021-12-17 12:26:05 +00:00
|
|
|
adding exception patterns to the applicable .dockerignore file(s), for example
|
2020-06-24 23:01:53 +00:00
|
|
|
`!mysubmodule/.git`. For documentation on pattern format, see:
|
2020-05-01 11:18:11 +00:00
|
|
|
- https://docs.docker.com/engine/reference/builder/#dockerignore-file
|
|
|
|
- https://www.npmjs.com/package/@balena/dockerignore
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Note: the --service and --env flags must come after the fleetOrDevice
|
2020-09-08 14:30:41 +00:00
|
|
|
parameter, as per examples.
|
2020-07-24 12:25:46 +00:00
|
|
|
|
2018-06-26 16:59:44 +00:00
|
|
|
Examples:
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena push myFleet
|
|
|
|
$ balena push myFleet --source <source directory>
|
|
|
|
$ balena push myFleet -s <source directory>
|
2022-07-14 19:40:59 +00:00
|
|
|
$ balena push myFleet --source <source directory> --note "this is the note for this release"
|
2021-07-15 13:41:38 +00:00
|
|
|
$ balena push myFleet --release-tag key1 "" key2 "value2 with spaces"
|
|
|
|
$ balena push myorg/myfleet
|
2020-07-24 12:25:46 +00:00
|
|
|
|
2018-10-19 14:38:50 +00:00
|
|
|
$ balena push 10.0.0.1
|
|
|
|
$ balena push 10.0.0.1 --source <source directory>
|
2019-04-24 13:59:07 +00:00
|
|
|
$ balena push 10.0.0.1 --service my-service
|
2019-05-27 10:32:47 +00:00
|
|
|
$ balena push 10.0.0.1 --env MY_ENV_VAR=value --env my-service:SERVICE_VAR=value
|
2019-05-29 14:09:05 +00:00
|
|
|
$ balena push 10.0.0.1 --nolive
|
2020-07-24 12:25:46 +00:00
|
|
|
|
2019-04-24 16:47:08 +00:00
|
|
|
$ balena push 23c73a1.local --system
|
|
|
|
$ balena push 23c73a1.local --system --service my-service
|
2018-10-16 10:25:37 +00:00
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
### Arguments
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### FLEETORDEVICE
|
2020-07-24 12:25:46 +00:00
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
fleet name or slug, or local device IP address or ".local" hostname
|
2020-07-24 12:25:46 +00:00
|
|
|
|
2018-06-26 16:59:44 +00:00
|
|
|
### Options
|
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### -s, --source SOURCE
|
2018-06-26 16:59:44 +00:00
|
|
|
|
2020-09-08 14:30:41 +00:00
|
|
|
Source directory to be sent to balenaCloud or balenaOS device
|
|
|
|
(default: current working dir)
|
2018-06-26 16:59:44 +00:00
|
|
|
|
2020-10-01 23:10:40 +00:00
|
|
|
#### -e, --emulated
|
2018-06-21 13:29:25 +00:00
|
|
|
|
2021-02-23 12:56:59 +00:00
|
|
|
Don't use the faster, native balenaCloud ARM builders; force slower QEMU ARM
|
|
|
|
emulation on Intel x86-64 builders. This flag is sometimes used to investigate
|
|
|
|
suspected issues with the balenaCloud backend.
|
2018-06-21 13:29:25 +00:00
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### --dockerfile DOCKERFILE
|
2019-04-11 11:49:19 +00:00
|
|
|
|
|
|
|
Alternative Dockerfile name/path, relative to the source folder
|
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### -c, --nocache
|
2018-06-21 13:29:25 +00:00
|
|
|
|
2020-09-08 14:30:41 +00:00
|
|
|
Don't use cached layers of previously built images for this project. This
|
|
|
|
ensures that the latest base image and packages are pulled. Note that build
|
|
|
|
logs may still display the message _"Pulling previous images for caching
|
|
|
|
purposes" (as the cloud builder needs previous images to compute delta
|
|
|
|
updates), but the logs will not display the "Using cache" lines for each
|
|
|
|
build step of a Dockerfile.
|
2018-06-21 13:29:25 +00:00
|
|
|
|
2020-09-08 13:55:56 +00:00
|
|
|
#### --pull
|
|
|
|
|
|
|
|
When pushing to a local device, force the base images to be pulled again.
|
|
|
|
Currently this option is ignored when pushing to the balenaCloud builders.
|
|
|
|
|
2020-02-15 20:20:56 +00:00
|
|
|
#### --noparent-check
|
|
|
|
|
|
|
|
Disable project validation check of 'docker-compose.yml' file in parent folder
|
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### -R, --registry-secrets REGISTRY-SECRETS
|
2018-11-07 18:15:05 +00:00
|
|
|
|
2020-09-08 14:30:41 +00:00
|
|
|
Path to a local YAML or JSON file containing Docker registry passwords used
|
|
|
|
to pull base images. Note that if registry-secrets are not provided on the
|
|
|
|
command line, a secrets configuration file from the balena directory will be
|
|
|
|
used (usually $HOME/.balena/secrets.yml|.json)
|
2018-11-07 18:15:05 +00:00
|
|
|
|
2019-05-29 14:09:05 +00:00
|
|
|
#### --nolive
|
2019-04-23 10:38:13 +00:00
|
|
|
|
2020-09-08 14:30:41 +00:00
|
|
|
Don't run a live session on this push. The filesystem will not be monitored,
|
|
|
|
and changes will not be synchronized to any running containers. Note that both
|
2023-01-13 04:36:38 +00:00
|
|
|
this flag and --detached are required to cause the process to end once the
|
2020-09-08 14:30:41 +00:00
|
|
|
initial build has completed.
|
2019-01-14 16:51:57 +00:00
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### -d, --detached
|
2019-04-24 13:31:30 +00:00
|
|
|
|
2020-09-08 14:30:41 +00:00
|
|
|
When pushing to the cloud, this option will cause the build to start, then
|
|
|
|
return execution back to the shell, with the status and release ID (if
|
|
|
|
applicable). When pushing to a local mode device, this option will cause
|
2021-07-15 13:41:38 +00:00
|
|
|
the command to not tail logs when the build has completed.
|
2019-04-24 13:31:30 +00:00
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### --service SERVICE
|
2019-04-24 13:59:07 +00:00
|
|
|
|
2019-05-28 15:56:39 +00:00
|
|
|
Reject logs not originating from this service.
|
|
|
|
This can be used in combination with --system and other --service flags.
|
2019-04-24 16:30:18 +00:00
|
|
|
Only valid when pushing to a local mode device.
|
|
|
|
|
|
|
|
#### --system
|
|
|
|
|
|
|
|
Only show system logs. This can be used in combination with --service.
|
2019-04-24 13:59:07 +00:00
|
|
|
Only valid when pushing to a local mode device.
|
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### --env ENV
|
2019-05-27 10:32:47 +00:00
|
|
|
|
|
|
|
When performing a push to device, run the built containers with environment
|
|
|
|
variables provided with this argument. Environment variables can be applied
|
|
|
|
to individual services by adding their service name before the argument,
|
|
|
|
separated by a colon, e.g:
|
|
|
|
--env main:MY_ENV=value
|
|
|
|
Note that if the service name cannot be found in the composition, the entire
|
|
|
|
left hand side of the = character will be treated as the variable name.
|
|
|
|
|
2020-06-15 22:52:58 +00:00
|
|
|
#### --noconvert-eol
|
|
|
|
|
|
|
|
Don't convert line endings from CRLF (Windows format) to LF (Unix format).
|
2020-01-29 11:10:59 +00:00
|
|
|
|
2020-07-24 12:25:46 +00:00
|
|
|
#### -m, --multi-dockerignore
|
2020-06-24 23:01:53 +00:00
|
|
|
|
|
|
|
Have each service use its own .dockerignore file. See "balena help push".
|
|
|
|
|
2020-12-16 14:42:25 +00:00
|
|
|
#### --release-tag RELEASE-TAG
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
Set release tags if the image build is successful (balenaCloud only). Multiple
|
2020-12-16 14:42:25 +00:00
|
|
|
arguments may be provided, alternating tag keys and values (see examples).
|
|
|
|
Hint: Empty values may be specified with "" (bash, cmd.exe) or '""' (PowerShell).
|
|
|
|
|
2021-05-19 15:06:45 +00:00
|
|
|
#### --draft
|
|
|
|
|
|
|
|
Instruct the builder to create the release as a draft. Draft releases are ignored
|
|
|
|
by the 'track latest' release policy but can be used through release pinning.
|
|
|
|
Draft releases can be marked as final through the API. Releases are created
|
|
|
|
as final by default unless this option is given.
|
|
|
|
|
2022-07-14 19:40:59 +00:00
|
|
|
#### --note NOTE
|
|
|
|
|
|
|
|
The notes for this release
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Releases
|
2020-02-15 20:20:56 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## release finalize
|
2020-02-15 20:20:56 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Finalize a release. Releases can be "draft" or "final", and this command
|
|
|
|
changes a draft release into a final release. Draft releases can be created
|
|
|
|
with the `--draft` option of the `balena build` or `balena deploy`
|
|
|
|
commands.
|
2019-02-26 13:32:27 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Draft releases are not automatically deployed to devices tracking the latest
|
|
|
|
release. For a draft release to be deployed to a device, the device should be
|
|
|
|
explicity pinned to that release. Conversely, final releases may trigger immediate
|
|
|
|
deployment to unpinned devices (subject to a device's polling period) and, for
|
|
|
|
this reason, final releases cannot be changed back to draft status.
|
2019-02-26 13:32:27 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2020-06-15 22:52:58 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena release finalize a777f7345fe3d655c1c981aa642e5555
|
|
|
|
$ balena release finalize 1234567
|
2020-01-29 11:10:59 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### COMMITORID
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the commit or ID of the release to finalize
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## release
|
2017-05-12 10:01:37 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because field names are less likely to change in JSON format and because it
|
|
|
|
better represents data types like arrays, empty strings and null values.
|
|
|
|
The 'jq' utility may be helpful for querying JSON fields in shell scripts
|
|
|
|
(https://stedolan.github.io/jq/manual/).
|
2017-05-12 10:01:37 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2020-02-12 11:35:03 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena release a777f7345fe3d655c1c981aa642e5555
|
|
|
|
$ balena release 1234567
|
|
|
|
$ balena release d3f3151f5ad25ca6b070aa4d08296aca --json
|
2020-02-12 11:35:03 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### COMMITORID
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the commit or ID of the release to get information
|
2020-09-03 17:39:29 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-09-03 17:39:29 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -j, --json
|
2017-06-23 15:20:16 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
produce JSON output instead of tabular output
|
2017-06-23 15:20:16 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -c, --composition
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Return the release composition
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## release invalidate
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Invalidate a release.
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Invalid releases are not automatically deployed to devices tracking the latest
|
|
|
|
release. For an invalid release to be deployed to a device, the device should be
|
|
|
|
explicity pinned to that release.
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena release invalidate a777f7345fe3d655c1c981aa642e5555
|
|
|
|
$ balena release invalidate 1234567
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### COMMITORID
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the commit or ID of the release to invalidate
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## release validate
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Validate a release.
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Valid releases are automatically deployed to devices tracking the latest
|
|
|
|
release if they are finalized.
|
2017-10-09 17:10:50 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2019-02-26 13:32:27 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena release validate a777f7345fe3d655c1c981aa642e5555
|
|
|
|
$ balena release validate 1234567
|
2021-05-20 12:12:06 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2017-12-11 22:37:56 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### COMMITORID
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the commit or ID of the release to validate
|
2019-08-15 14:38:50 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2019-06-18 10:13:09 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## releases
|
2020-06-24 23:01:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
List all releases of the given fleet.
|
2020-06-24 23:01:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Slugs are recommended because
|
|
|
|
they are unique and unambiguous. Slugs can be listed with the `balena fleets`
|
|
|
|
command. Note that slugs may change if the fleet is renamed. Fleet names are
|
|
|
|
not unique and may result in "Fleet is ambiguous" errors at any time (even if
|
|
|
|
"it used to work in the past"), for example if the name clashes with a newly
|
|
|
|
created public/open fleet, or with fleets from other balena accounts that you
|
|
|
|
may be invited to join under any role. For this reason, fleet names are
|
|
|
|
especially discouraged in scripts (e.g. CI environments).
|
2020-06-24 23:01:53 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because field names are less likely to change in JSON format and because it
|
|
|
|
better represents data types like arrays, empty strings and null values.
|
|
|
|
The 'jq' utility may be helpful for querying JSON fields in shell scripts
|
|
|
|
(https://stedolan.github.io/jq/manual/).
|
2020-05-01 11:18:11 +00:00
|
|
|
|
2017-04-26 12:34:40 +00:00
|
|
|
Examples:
|
2017-12-11 22:37:56 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena releases myorg/myfleet
|
|
|
|
$ balena releases myorg/myfleet --json
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2020-08-21 08:57:14 +00:00
|
|
|
### Arguments
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### FLEET
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
produce JSON output instead of tabular output
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## settings
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
Use this command to display the current balena CLI settings.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena settings
|
2020-08-21 08:57:14 +00:00
|
|
|
|
2017-04-26 12:34:40 +00:00
|
|
|
### Options
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# SSH Keys
|
2020-06-15 22:52:58 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## key add
|
2017-12-11 22:37:56 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Add an SSH key to the balenaCloud account of the logged in user.
|
2021-09-08 17:10:22 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
If `path` is omitted, the command will attempt to read the SSH key from stdin.
|
2021-09-08 17:10:22 +00:00
|
|
|
|
2024-09-30 15:25:43 +00:00
|
|
|
About SSH keys
|
2023-11-03 14:55:29 +00:00
|
|
|
An "SSH key" actually consists of a public/private key pair. A typical name
|
|
|
|
for the private key file is "id_rsa", and a typical name for the public key
|
|
|
|
file is "id_rsa.pub". Both key files are saved to your computer (with the
|
|
|
|
private key optionally protected by a password), but only the public key is
|
|
|
|
saved to your balena account. This means that if you change computers or
|
|
|
|
otherwise lose the private key, you cannot recover the private key through
|
|
|
|
your balena account. You can however add new keys, and delete the old ones.
|
2020-02-15 20:20:56 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
To generate a new SSH key pair, a nice guide can be found in GitHub's docs:
|
|
|
|
https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
|
|
|
|
Skip the step about adding the key to a GitHub account, and instead add it to
|
|
|
|
your balena account.
|
2020-02-15 20:20:56 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2019-02-26 13:32:27 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena key add Main ~/.ssh/id_rsa.pub
|
|
|
|
$ cat ~/.ssh/id_rsa.pub | balena key add Main
|
|
|
|
# Windows 10 (cmd.exe prompt) example
|
|
|
|
$ balena key add Main %userprofile%.sshid_rsa.pub
|
2019-02-26 13:32:27 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2020-06-15 22:52:58 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### NAME
|
2020-01-29 11:10:59 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the SSH key name
|
2020-07-30 08:39:05 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### PATH
|
2020-07-30 08:39:05 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the path to the public key file
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## key
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Display a single SSH key registered in balenaCloud for the logged in user.
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena key 17
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### ID
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
balenaCloud ID for the SSH key
|
2020-09-03 17:39:29 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-09-03 17:39:29 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## key rm
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Remove a single SSH key registered in balenaCloud for the logged in user.
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
The --yes option may be used to avoid interactive confirmation.
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena key rm 17
|
|
|
|
$ balena key rm 17 --yes
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Arguments
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### ID
|
2017-05-12 10:01:37 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
balenaCloud ID for the SSH key
|
2017-05-12 10:01:37 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-02-12 11:35:03 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -y, --yes
|
2020-02-12 11:35:03 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
answer "yes" to all questions (non interactive use)
|
2017-04-26 12:34:40 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## keys
|
2017-06-23 15:20:16 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
List all SSH keys registered in balenaCloud for the logged in user.
|
2017-06-23 15:20:16 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Examples:
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena keys
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-07 22:33:48 +00:00
|
|
|
# Support
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## support
|
2023-11-07 22:33:48 +00:00
|
|
|
|
|
|
|
Grant or revoke balena support agent access to devices or fleets
|
|
|
|
on balenaCloud. (This command does not apply to openBalena.)
|
|
|
|
Access will be automatically revoked once the specified duration has elapsed.
|
|
|
|
|
|
|
|
Duration defaults to 24h, but can be specified using --duration flag in days
|
|
|
|
or hours, e.g. '12h', '2d'.
|
|
|
|
|
|
|
|
Both --device and --fleet flags accept multiple values, specified as
|
|
|
|
a comma-separated list (with no spaces).
|
|
|
|
|
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
balena support enable --device ab346f,cd457a --duration 3d
|
|
|
|
balena support enable --fleet myFleet --duration 12h
|
|
|
|
balena support disable -f myorg/myfleet
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
#### ACTION
|
|
|
|
|
|
|
|
enable|disable support access
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -d, --device DEVICE
|
|
|
|
|
|
|
|
comma-separated list (no spaces) of device UUIDs
|
|
|
|
|
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
|
|
|
comma-separated list (no spaces) of fleet names or slugs (preferred)
|
|
|
|
|
|
|
|
#### -t, --duration DURATION
|
|
|
|
|
|
|
|
length of time to enable support for, in (h)ours or (d)ays, e.g. 12h, 2d
|
|
|
|
|
2024-05-14 14:23:16 +00:00
|
|
|
# Tags
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## tag rm
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Remove a tag from a fleet, device or release.
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2018-11-14 22:26:14 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena tag rm myTagKey --fleet MyFleet
|
|
|
|
$ balena tag rm myTagKey -f myorg/myfleet
|
|
|
|
$ balena tag rm myTagKey --device 7cf02a6
|
|
|
|
$ balena tag rm myTagKey --release 1234
|
|
|
|
$ balena tag rm myTagKey --release b376b0e544e9429483b656490e5b9443b4349bd6
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2020-04-09 14:34:24 +00:00
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### TAGKEY
|
2020-04-09 14:34:24 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the key string of the tag
|
2020-04-09 14:34:24 +00:00
|
|
|
|
2018-11-14 22:26:14 +00:00
|
|
|
### Options
|
|
|
|
|
2021-07-15 13:41:38 +00:00
|
|
|
#### -f, --fleet FLEET
|
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
fleet name or slug (preferred)
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --device DEVICE
|
2020-09-09 12:20:57 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device UUID
|
2020-09-09 12:20:57 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -r, --release RELEASE
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
release id
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## tag set
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
Set a tag on a fleet, device or release.
|
|
|
|
|
|
|
|
You can optionally provide a value to be associated with the created
|
|
|
|
tag, as an extra argument after the tag key. If a value isn't
|
|
|
|
provided, a tag with an empty value is created.
|
|
|
|
|
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
|
|
|
environments).
|
2018-11-14 22:26:14 +00:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena tag set mySimpleTag --fleet MyFleet
|
|
|
|
$ balena tag set mySimpleTag -f myorg/myfleet
|
|
|
|
$ balena tag set myCompositeTag myTagValue --fleet MyFleet
|
|
|
|
$ balena tag set myCompositeTag myTagValue --device 7cf02a6
|
|
|
|
$ balena tag set myCompositeTag "my tag value with whitespaces" --device 7cf02a6
|
|
|
|
$ balena tag set myCompositeTag myTagValue --release 1234
|
|
|
|
$ balena tag set myCompositeTag --release 1234
|
|
|
|
$ balena tag set myCompositeTag --release b376b0e544e9429483b656490e5b9443b4349bd6
|
2018-11-14 22:26:14 +00:00
|
|
|
|
2020-04-09 14:34:24 +00:00
|
|
|
### Arguments
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### TAGKEY
|
2020-04-09 14:34:24 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
the key string of the tag
|
|
|
|
|
|
|
|
#### VALUE
|
|
|
|
|
|
|
|
the optional value associated with the tag
|
2020-04-09 14:34:24 +00:00
|
|
|
|
|
|
|
### Options
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -f, --fleet FLEET
|
2017-06-14 21:23:39 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet name or slug (preferred)
|
2017-06-14 21:23:39 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -d, --device DEVICE
|
2020-07-09 11:58:59 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device UUID
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -r, --release RELEASE
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
release id
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## tags
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
List all tags and their values for the specified fleet, device or release.
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2022-07-15 15:01:37 +00:00
|
|
|
Fleets may be specified by fleet name or slug. Fleet slugs are
|
2021-07-15 13:41:38 +00:00
|
|
|
the recommended option, as they are unique and unambiguous. Slugs can be
|
|
|
|
listed with the `balena fleets` command. Note that slugs may change if the
|
|
|
|
fleet is renamed. Fleet names are not unique and may result in "Fleet is
|
|
|
|
ambiguous" errors at any time (even if it "used to work in the past"), for
|
|
|
|
example if the name clashes with a newly created public fleet, or with fleets
|
|
|
|
from other balena accounts that you may be invited to join under any role.
|
|
|
|
For this reason, fleet names are especially discouraged in scripts (e.g. CI
|
2022-07-15 15:01:37 +00:00
|
|
|
environments).
|
2020-12-10 12:30:17 +00:00
|
|
|
|
2020-09-25 09:00:18 +00:00
|
|
|
Examples:
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
$ balena tags --fleet MyFleet
|
|
|
|
$ balena tags -f myorg/myfleet
|
|
|
|
$ balena tags --device 7cf02a6
|
|
|
|
$ balena tags --release 1234
|
|
|
|
$ balena tags --release b376b0e544e9429483b656490e5b9443b4349bd6
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
### Options
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -f, --fleet FLEET
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
fleet name or slug (preferred)
|
2020-09-25 09:00:18 +00:00
|
|
|
|
|
|
|
#### -d, --device DEVICE
|
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
device UUID
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
#### -r, --release RELEASE
|
2021-07-15 13:41:38 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
release id
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2023-11-03 14:55:29 +00:00
|
|
|
# Utilities
|
2020-09-25 09:00:18 +00:00
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## util available-drives
|
2023-11-03 14:55:29 +00:00
|
|
|
|
|
|
|
List available drives which are usable for writing an OS image to.
|
|
|
|
Does not list system drives.
|
|
|
|
|
|
|
|
### Options
|
2023-11-08 14:44:32 +00:00
|
|
|
|
|
|
|
# Version
|
|
|
|
|
2024-09-30 17:56:48 +00:00
|
|
|
## version
|
2023-11-08 14:44:32 +00:00
|
|
|
|
|
|
|
Display version information for the balena CLI and/or Node.js. Note that the
|
|
|
|
balena CLI executable installers for Windows and macOS, and the standalone
|
|
|
|
zip packages, ship with a built-in copy of Node.js. In this case, the
|
|
|
|
reported version of Node.js regards this built-in copy, rather than any
|
|
|
|
other `node` engine that may also be available on the command prompt.
|
|
|
|
|
|
|
|
The --json option is recommended when scripting the output of this command,
|
|
|
|
because the JSON format is less likely to change and it better represents
|
|
|
|
data types like lists and empty strings. The 'jq' utility may be helpful
|
|
|
|
in shell scripts (https://stedolan.github.io/jq/manual/).
|
|
|
|
|
|
|
|
This command can also be invoked with 'balena --version' or 'balena -v'.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ balena version
|
|
|
|
$ balena version -a
|
|
|
|
$ balena version -j
|
|
|
|
$ balena --version
|
|
|
|
$ balena -v
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
#### -a, --all
|
|
|
|
|
|
|
|
include version information for additional components (Node.js)
|
|
|
|
|
|
|
|
#### -j, --json
|
|
|
|
|
|
|
|
output version information in JSON format for programmatic use
|