2018-10-19 14:38:50 +00:00
# Balena CLI Documentation
2015-04-16 13:34:40 +00:00
2019-04-18 15:49:17 +00:00
The balena CLI (Command-Line Interface) allows you to interact with the balenaCloud and the
[balena API ](https://www.balena.io/docs/reference/api/overview/ ) through a terminal window
2019-04-29 15:33:09 +00:00
on Linux, macOS or Windows. You can also write shell scripts around it, or import its Node.js
2019-04-18 15:49:17 +00:00
modules to use it programmatically.
As an [open-source project on GitHub ](https://github.com/balena-io/balena-cli/ ), 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
2019-04-18 15:49:17 +00:00
Check the [balena CLI installation instructions on GitHub ](https://github.com/balena-io/balena-cli/blob/master/INSTALL.md ).
2015-04-16 13:34:40 +00:00
2019-04-18 15:49:17 +00:00
## Getting Started
2018-12-27 20:33:12 +00:00
2019-04-18 15:49:17 +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 )
are supported. We are aware of users also having a good experience with alternative shells,
including:
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:
`pacman -S git openssh rsync`
* [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).
* [MSYS ](http://www.mingw.org/wiki/MSYS ): select the `msys-rsync` and `msys-openssh` packages too
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 ).
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
balena CLI release **for Linux** is recommended. See
[FAQ ](https://github.com/balena-io/balena-cli/blob/master/TROUBLESHOOTING.md ) for using balena
CLI with WSL and Docker Desktop for Windows.
2018-03-12 19:06:21 +00:00
2019-04-29 15:33:09 +00:00
On **macOS** and **Linux,** the standard terminal window is supported. _Optionally,_ `bash` command
auto completion may be enabled by copying the
[balena-completion.bash ](https://github.com/balena-io/balena-cli/blob/master/balena-completion.bash )
file to your system's `bash_completion` directory: check [Docker's command completion
guide](https://docs.docker.com/compose/completion/) for system setup instructions.
2019-04-18 15:49:17 +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
new release to your application. 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
2019-04-18 15:49:17 +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-03-29 22:59:44 +00:00
> Note: The `balena ssh` command has additional setup requirements to work behind a proxy.
> Check the [installation instructions](https://github.com/balena-io/balena-cli/blob/master/INSTALL.md),
> and 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`
#### Proxy exclusion
The `BALENARC_NO_PROXY` variable may be used to exclude specified destinations from proxying.
> * This feature requires balena CLI version 11.30.8 or later. In the case of the npm [installation
> 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
2019-04-18 15:49:17 +00:00
If you come across any problems or would like to get in touch:
2017-04-26 13:16:06 +00:00
2019-04-18 15:49:17 +00:00
* Check our [FAQ / troubleshooting document ](https://github.com/balena-io/balena-cli/blob/master/TROUBLESHOOTING.md ).
* Ask us a question through the [balenaCloud forum ](https://forums.balena.io/c/balena-cloud ).
* For bug reports or feature requests,
[have a look at the GitHub issues or create a new one ](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
The balena CLI uses [semver versioning ](https://semver.org/ ), with the concepts
of major, minor and patch version releases.
The latest release of the previous major version of the balena CLI will remain
compatible with the balenaCloud backend services for one year from the date when
the next major version is released. For example, balena CLI v10.17.5, as the
latest v10 release, would remain compatible with the balenaCloud backend for one
year from the date when v11.0.0 is released.
At the end of this period, the older major version is considered deprecated and
some of the functionality that depends on balenaCloud services may stop working
at any time.
Users are encouraged to regularly update the balena CLI to the latest version.
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
2019-04-18 15:49:17 +00:00
- API keys
2018-04-04 12:42:57 +00:00
2019-02-22 16:37:57 +00:00
- [api-key generate <name> ](#api-key-generate-name )
2018-04-04 12:42:57 +00:00
2015-04-16 13:34:40 +00:00
- Application
2015-07-07 22:01:25 +00:00
- [apps ](#apps )
2019-02-22 16:37:57 +00:00
- [app <name> ](#app-name )
2020-04-22 16:08:11 +00:00
- [app create <name> ](#app-create-name )
2019-02-22 16:37:57 +00:00
- [app rm <name> ](#app-rm-name )
2020-04-22 16:08:11 +00:00
- [app restart <name> ](#app-restart-name )
2015-04-16 13:34:40 +00:00
- Authentication
2015-11-11 12:45:38 +00:00
- [login ](#login )
2015-07-07 22:01:25 +00:00
- [logout ](#logout )
- [whoami ](#whoami )
2015-04-16 13:34:40 +00:00
- Device
2015-07-07 22:01:25 +00:00
- [devices ](#devices )
2019-02-22 16:37:57 +00:00
- [device <uuid> ](#device-uuid )
- [device register <application> ](#device-register-application )
- [device rm <uuid> ](#device-rm-uuid )
- [device identify <uuid> ](#device-identify-uuid )
- [device reboot <uuid> ](#device-reboot-uuid )
- [device shutdown <uuid> ](#device-shutdown-uuid )
- [device public-url enable <uuid> ](#device-public-url-enable-uuid )
- [device public-url disable <uuid> ](#device-public-url-disable-uuid )
- [device public-url <uuid> ](#device-public-url-uuid )
- [device public-url status <uuid> ](#device-public-url-status-uuid )
- [device rename < uuid> [newName]](#device-rename-uuid-newname)
- [device move <uuid> ](#device-move-uuid )
2015-09-29 15:10:33 +00:00
- [device init ](#device-init )
2019-06-11 12:08:15 +00:00
- [device os-update <uuid> ](#device-os-update-uuid )
2019-11-07 10:02:44 +00:00
- [devices supported ](#devices-supported )
2015-04-16 13:34:40 +00:00
- Environment Variables
2015-07-07 22:01:25 +00:00
- [envs ](#envs )
2019-02-22 16:37:57 +00:00
- [env rm <id> ](#env-rm-id )
2019-04-02 11:26:21 +00:00
- [env add < name> [value]](#env-add-name-value)
2019-02-22 16:37:57 +00:00
- [env rename <id> <value> ](#env-rename-id-value )
2015-04-16 13:34:40 +00:00
2018-12-10 21:05:35 +00:00
- Tags
- [tags ](#tags )
2020-05-26 09:17:30 +00:00
- [tag rm <tagkey> ](#tag-rm-tagkey )
- [tag set < tagkey> [value]](#tag-set-tagkey-value)
2018-12-10 21:05:35 +00:00
2019-06-24 15:51:07 +00:00
- Help and Version
2015-04-16 13:34:40 +00:00
2019-02-22 16:37:57 +00:00
- [help [command...]](#help-command)
2015-07-07 22:01:25 +00:00
- [version ](#version )
2015-04-16 13:34:40 +00:00
- Keys
2015-07-07 22:01:25 +00:00
- [keys ](#keys )
2019-02-22 16:37:57 +00:00
- [key <id> ](#key-id )
- [key add < name> [path]](#key-add-name-path)
2020-04-17 13:19:33 +00:00
- [key rm <id> ](#key-rm-id )
2015-04-16 13:34:40 +00:00
- Logs
2019-04-24 11:08:26 +00:00
- [logs <uuidOrDevice> ](#logs-uuidordevice )
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
2019-06-05 22:17:59 +00:00
- [scan ](#scan )
2019-04-24 17:45:19 +00:00
- [ssh < applicationOrDevice> [serviceName]](#ssh-applicationordevice-servicename)
2019-06-06 16:56:20 +00:00
- [tunnel <deviceOrApplication> ](#tunnel-deviceorapplication )
2016-04-24 19:52:41 +00:00
2015-04-16 13:34:40 +00:00
- Notes
2019-02-22 16:37:57 +00:00
- [note <|note> ](#note-note )
2015-04-16 13:34:40 +00:00
2015-09-29 17:03:14 +00:00
- OS
2019-02-22 16:37:57 +00:00
- [os versions <type> ](#os-versions-type )
- [os download <type> ](#os-download-type )
- [os build-config <image> <device-type> ](#os-build-config-image-device-type )
- [os configure <image> ](#os-configure-image )
- [os initialize <image> ](#os-initialize-image )
2015-09-29 17:03:14 +00:00
2015-11-10 16:53:34 +00:00
- Config
- [config read ](#config-read )
2019-02-22 16:37:57 +00:00
- [config write <key> <value> ](#config-write-key-value )
- [config inject <file> ](#config-inject-file )
2015-11-11 14:38:45 +00:00
- [config reconfigure ](#config-reconfigure )
2016-03-28 13:25:40 +00:00
- [config generate ](#config-generate )
2015-11-10 16:53:34 +00:00
2017-10-25 11:17:07 +00:00
- Preload
2019-02-22 16:37:57 +00:00
- [preload <image> ](#preload-image )
2017-10-25 11:17:07 +00:00
2018-06-26 16:59:44 +00:00
- Push
2019-02-22 16:37:57 +00:00
- [push <applicationOrDevice> ](#push-applicationordevice )
2018-06-26 16:59:44 +00:00
2020-03-25 17:07:17 +00:00
- Settings
- [settings ](#settings )
2017-04-11 13:25:54 +00:00
- Local
2019-02-22 16:37:57 +00:00
- [local configure <target> ](#local-configure-target )
2019-05-30 14:18:58 +00:00
- [local flash <image> ](#local-flash-image )
2017-04-11 13:25:54 +00:00
2017-04-26 12:34:40 +00:00
- Deploy
2019-02-22 16:37:57 +00:00
- [build [source]](#build-source)
- [deploy < appName> [image]](#deploy-appname-image)
2017-04-26 12:34:40 +00:00
2018-11-14 22:26:14 +00:00
- Platform
2020-04-09 14:34:24 +00:00
- [join [deviceiporhostname]](#join-deviceiporhostname)
- [leave [deviceiporhostname]](#leave-deviceiporhostname)
2018-11-14 22:26:14 +00:00
2017-06-14 21:23:39 +00:00
- Utilities
- [util available-drives ](#util-available-drives )
2019-04-18 15:49:17 +00:00
# API keys
2018-04-04 12:42:57 +00:00
## api-key generate <name>
2020-04-22 11:47:12 +00:00
Generate a new balenaCloud API key for the current user, with the given
2018-04-04 12:42:57 +00:00
name. The key will be logged to the console.
2018-10-19 14:38:50 +00:00
This key can be used to log into the CLI using 'balena login --token < key > ',
2018-04-04 12:42:57 +00:00
or to authenticate requests to the API with an 'Authorization: Bearer < key > ' header.
Examples:
2018-10-19 14:38:50 +00:00
$ balena api-key generate "Jenkins Key"
2018-04-04 12:42:57 +00:00
2020-04-22 11:47:12 +00:00
### Arguments
#### NAME
the API key name
### Options
2015-04-16 13:34:40 +00:00
# Application
2015-04-16 14:42:09 +00:00
2020-04-22 16:08:11 +00:00
## apps
list all your balena applications.
For detailed information on a particular application,
use `balena app <name> instead` .
Examples:
$ balena apps
### Options
2020-05-13 14:45:22 +00:00
#### -v, --verbose
add extra columns in the tabular output (SLUG)
2020-04-22 16:08:11 +00:00
## app <name>
Display detailed information about a single balena application.
Examples:
$ balena app MyApp
### Arguments
#### NAME
2020-05-11 15:40:50 +00:00
application name or numeric ID
2020-04-22 16:08:11 +00:00
### Options
2018-03-20 17:43:26 +00:00
## app create <name>
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
Create a new balena application.
2015-04-16 13:34:40 +00:00
2017-05-12 10:01:37 +00:00
You can specify the application device type with the `--type` option.
2015-04-16 13:34:40 +00:00
Otherwise, an interactive dropdown will be shown for you to select from.
2020-04-22 16:08:11 +00:00
You can see a list of supported device types with:
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
$ balena devices supported
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena app create MyApp
$ balena app create MyApp --type raspberry-pi
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
### Arguments
#### NAME
application name
2015-04-16 13:34:40 +00:00
### Options
2020-04-22 16:08:11 +00:00
#### -t, --type TYPE
2015-04-16 13:34:40 +00:00
2018-10-19 14:38:50 +00:00
application device type (Check available types with `balena devices supported` )
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
## app rm <name>
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
Permanently remove a balena application.
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
The --yes option may be used to avoid interactive confirmation.
2015-04-16 13:34:40 +00:00
Examples:
2020-04-22 16:08:11 +00:00
$ balena app rm MyApp
$ balena app rm MyApp --yes
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
2020-04-22 16:08:11 +00:00
#### NAME
2015-04-16 13:34:40 +00:00
2020-05-11 15:40:50 +00:00
application name or numeric ID
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
### Options
#### -y, --yes
answer "yes" to all questions (non interactive use)
2015-04-16 13:34:40 +00:00
2018-03-20 17:43:26 +00:00
## app restart <name>
2015-04-16 13:34:40 +00:00
2020-04-22 16:08:11 +00:00
Restart all devices that belongs to a certain application.
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena app restart MyApp
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
2020-04-22 16:08:11 +00:00
#### NAME
2015-04-16 13:34:40 +00:00
2020-05-11 15:40:50 +00:00
application name or numeric ID
2015-04-16 13:34:40 +00:00
### Options
2015-11-11 12:45:38 +00:00
# Authentication
2015-04-16 13:34:40 +00:00
2018-03-20 17:43:26 +00:00
## login
2015-04-16 13:34:40 +00:00
2018-10-19 14:38:50 +00:00
Use this command to login to your balena account.
2015-06-02 16:32:35 +00:00
2016-01-12 13:07:15 +00:00
This command will prompt you to login using the following login types:
- Web authorization: open your web browser and prompt you to authorize the CLI
2015-12-03 14:22:22 +00:00
from the dashboard.
2016-01-12 13:07:15 +00:00
- Credentials: using email/password and 2FA.
2015-12-03 14:22:22 +00:00
2018-11-07 15:16:13 +00:00
- Token: using a session token or API key from the preferences page.
2015-12-12 04:09:31 +00:00
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena login
$ balena login --web
$ balena login --token "..."
$ balena login --credentials
$ balena login --credentials --email johndoe@gmail.com --password secret
2015-12-03 14:22:22 +00:00
### Options
#### --token, -t <token>
2018-11-07 15:16:13 +00:00
session token or API key
2015-04-16 13:34:40 +00:00
2016-01-12 13:07:15 +00:00
#### --web, -w
web-based login
2015-12-12 04:09:31 +00:00
#### --credentials, -c
credential-based login
2017-12-21 17:40:13 +00:00
#### --email, -e, -u <email>
2015-12-12 04:09:31 +00:00
email
#### --password, -p <password>
password
2018-03-20 17:43:26 +00:00
## logout
2015-04-16 13:34:40 +00:00
2018-12-28 13:40:18 +00:00
Use this command to logout from your balena account.
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena logout
2015-04-16 13:34:40 +00:00
2018-03-20 17:43:26 +00:00
## whoami
2015-04-27 14:51:26 +00:00
2015-09-01 17:01:47 +00:00
Use this command to find out the current logged in username and email address.
2015-04-27 14:51:26 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena whoami
2015-04-27 14:51:26 +00:00
2015-04-16 13:34:40 +00:00
# Device
2015-04-16 14:42:09 +00:00
2018-03-20 17:43:26 +00:00
## devices
2015-04-16 13:34:40 +00:00
2015-04-27 15:20:53 +00:00
Use this command to list all devices that belong to you.
You can filter the devices by application by using the `--application` option.
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena devices
$ balena devices --application MyApp
$ balena devices --app MyApp
$ balena devices -a MyApp
2015-04-16 13:34:40 +00:00
### Options
2017-12-21 17:40:13 +00:00
#### --application, -a, --app <application>
2015-04-16 13:34:40 +00:00
application name
2018-03-20 17:43:26 +00:00
## device <uuid>
2015-04-16 13:34:40 +00:00
Use this command to show information about a single device.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device 7cf02a6
2015-04-16 13:34:40 +00:00
2018-03-20 17:43:26 +00:00
## device register <application>
2015-09-29 18:33:31 +00:00
Use this command to register a device to an application.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device register MyApp
$ balena device register MyApp --uuid < uuid >
2015-09-29 18:33:31 +00:00
2015-10-19 18:16:47 +00:00
### Options
#### --uuid, -u <uuid>
custom uuid
2018-03-20 17:43:26 +00:00
## device rm <uuid>
2015-04-16 13:34:40 +00:00
2018-10-19 14:38:50 +00:00
Use this command to remove a device from balena.
2015-04-16 13:34:40 +00:00
Notice this command asks for confirmation interactively.
You can avoid this by passing the `--yes` boolean option.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device rm 7cf02a6
$ balena device rm 7cf02a6 --yes
2015-04-16 13:34:40 +00:00
### Options
#### --yes, -y
confirm non interactively
2018-03-20 17:43:26 +00:00
## device identify <uuid>
2015-04-16 13:34:40 +00:00
Use this command to identify a device.
In the Raspberry Pi, the ACT led is blinked several times.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device identify 23c73a1
2015-04-16 13:34:40 +00:00
2018-03-20 17:43:26 +00:00
## device reboot <uuid>
2016-03-04 13:38:11 +00:00
Use this command to remotely reboot a device
Examples:
2018-10-19 14:38:50 +00:00
$ balena device reboot 23c73a1
2016-03-04 13:38:11 +00:00
2016-10-26 14:46:20 +00:00
### Options
2017-01-18 15:57:52 +00:00
#### --force, -f
2016-10-26 14:46:20 +00:00
force action if the update lock is set
2018-03-20 17:43:26 +00:00
## device shutdown <uuid>
2016-10-26 14:46:20 +00:00
Use this command to remotely shutdown a device
Examples:
2018-10-19 14:38:50 +00:00
$ balena device shutdown 23c73a1
2016-10-26 14:46:20 +00:00
### Options
2017-01-18 15:57:52 +00:00
#### --force, -f
2016-10-26 14:46:20 +00:00
force action if the update lock is set
2018-03-20 17:43:26 +00:00
## device public-url enable <uuid>
2016-09-25 23:51:32 +00:00
Use this command to enable public URL for a device
Examples:
2018-10-19 14:38:50 +00:00
$ balena device public-url enable 23c73a1
2016-09-25 23:51:32 +00:00
2018-03-20 17:43:26 +00:00
## device public-url disable <uuid>
2016-09-25 23:51:32 +00:00
Use this command to disable public URL for a device
Examples:
2018-10-19 14:38:50 +00:00
$ balena device public-url disable 23c73a1
2016-09-25 23:51:32 +00:00
2018-03-20 17:43:26 +00:00
## device public-url <uuid>
2016-09-25 23:51:32 +00:00
Use this command to get the public URL of a device
Examples:
2018-10-19 14:38:50 +00:00
$ balena device public-url 23c73a1
2016-09-25 23:51:32 +00:00
2018-03-20 17:43:26 +00:00
## device public-url status <uuid>
2016-09-25 23:51:32 +00:00
Use this command to determine if public URL is enabled for a device
Examples:
2018-10-19 14:38:50 +00:00
$ balena device public-url status 23c73a1
2016-09-25 23:51:32 +00:00
2018-03-20 17:43:26 +00:00
## device rename <uuid> [newName]
2015-04-16 13:34:40 +00:00
Use this command to rename a device.
If you omit the name, you'll get asked for it interactively.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device rename 7cf02a6
$ balena device rename 7cf02a6 MyPi
2015-04-16 13:34:40 +00:00
2018-03-20 17:43:26 +00:00
## device move <uuid>
2015-11-11 19:00:02 +00:00
Use this command to move a device to another application you own.
If you omit the application, you'll get asked for it interactively.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device move 7cf02a6
$ balena device move 7cf02a6 --application MyNewApp
2015-11-11 19:00:02 +00:00
### Options
2017-12-21 17:40:13 +00:00
#### --application, -a, --app <application>
2015-11-11 19:00:02 +00:00
application name
2018-03-20 17:43:26 +00:00
## device init
2015-04-16 13:34:40 +00:00
Use this command to download the OS image of a certain application and write it to an SD Card.
2015-09-29 15:10:33 +00:00
Notice this command may ask for confirmation interactively.
2015-04-16 13:34:40 +00:00
You can avoid this by passing the `--yes` boolean option.
Examples:
2018-10-19 14:38:50 +00:00
$ balena device init
$ balena device init --application MyApp
2015-04-16 13:34:40 +00:00
### Options
2017-12-21 17:40:13 +00:00
#### --application, -a, --app <application>
2015-04-16 13:34:40 +00:00
application name
2015-09-29 15:10:33 +00:00
#### --yes, -y
2015-04-16 13:34:40 +00:00
2015-09-29 15:10:33 +00:00
confirm non interactively
2015-04-16 13:34:40 +00:00
2015-10-20 13:16:56 +00:00
#### --advanced, -v
2017-06-14 21:51:56 +00:00
show advanced configuration options
2015-10-20 13:16:56 +00:00
2017-06-12 10:21:12 +00:00
#### --os-version <os-version>
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)
#### --drive, -d <drive>
2018-10-19 14:38:50 +00:00
the drive to write the image to, like `/dev/sdb` or `/dev/mmcblk0` . Careful with this as you can erase your hard drive. Check `balena util available-drives` for available options.
2017-06-12 10:21:12 +00:00
#### --config <config>
2018-10-19 14:38:50 +00:00
path to the config JSON file, see `balena os build-config`
2017-06-12 10:21:12 +00:00
2019-06-11 12:08:15 +00:00
## device os-update <uuid>
Use this command to trigger a Host OS update for a device.
Notice this command will ask for confirmation interactively.
You can avoid this by passing the `--yes` boolean option.
2020-03-26 12:19:35 +00:00
Requires balenaCloud; will not work with openBalena or standalone balenaOS.
2019-06-11 12:08:15 +00:00
Examples:
$ balena device os-update 23c73a1
$ balena device os-update 23c73a1 --version 2.31.0+rev1.prod
### Options
#### --version <version>
a balenaOS version
#### --yes, -y
confirm non interactively
2019-11-07 10:02:44 +00:00
## devices supported
2019-12-26 22:59:44 +00:00
List the supported device types (like 'raspberrypi3' or 'intel-nuc').
The --verbose option adds extra columns/fields to the output, including the
2020-01-03 23:13:20 +00:00
"STATE" column whose values are one of 'beta', 'released' or 'discontinued'.
2019-12-26 22:59:44 +00:00
However, 'discontinued' device types are only listed if the '--discontinued'
option is used.
2020-01-03 23:13:20 +00:00
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/).
2019-11-07 10:02:44 +00:00
Examples:
$ balena devices supported
2019-12-26 22:59:44 +00:00
$ balena devices supported --verbose
$ balena devices supported -vj
### Options
#### --discontinued
include "discontinued" device types
#### -j, --json
produce JSON output instead of tabular output
#### -v, --verbose
add extra columns in the tabular output (ALIASES, ARCH, STATE)
2019-11-07 10:02:44 +00:00
2015-04-16 13:34:40 +00:00
# Environment Variables
2015-04-16 14:42:09 +00:00
2018-03-20 17:43:26 +00:00
## envs
2015-04-16 13:34:40 +00:00
2019-12-04 18:04:57 +00:00
List the environment or configuration variables of an application, device or
service, as selected by the respective command-line options. (A service is
an application container in a "microservices" application.)
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 --all option is used to include application-wide (fleet), device-wide
(multiple services on a device) and service-specific variables that apply to
the selected application, device or service. It can be thought of as including
"inherited" variables: for example, a service inherits device-wide variables,
and a device inherits application-wide variables. Variables are still filtered
out by type with the --config option, such that configuration and non-
configuration variables are never listed together.
When the --all option is used, the printed output may include DEVICE and/or
SERVICE columns to distinguish between application-wide, device-specific and
2020-05-29 07:27:11 +00:00
service-specific variables. An asterisk in these columns indicates that the
2019-12-04 18:04:57 +00:00
variable applies to "all devices" or "all services".
2020-01-03 23:13:20 +00:00
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
application name may be null in JSON output (or 'N/A' in tabular output) if the
application linked to the device is no longer accessible by the current user
(for example, in case the current user has been removed from the application
by its owner).
2018-05-31 10:43:11 +00:00
2019-09-06 13:43:53 +00:00
Examples:
2015-04-16 13:34:40 +00:00
2018-10-19 14:38:50 +00:00
$ balena envs --application MyApp
2019-12-04 18:04:57 +00:00
$ balena envs --application MyApp --all --json
$ balena envs --application MyApp --service MyService
$ balena envs --application MyApp --all --service MyService
2018-10-25 18:03:12 +00:00
$ balena envs --application MyApp --config
2018-10-19 14:38:50 +00:00
$ balena envs --device 7cf02a6
2019-12-04 18:04:57 +00:00
$ balena envs --device 7cf02a6 --all --json
$ balena envs --device 7cf02a6 --config --all --json
$ balena envs --device 7cf02a6 --all --service MyService
2015-04-16 13:34:40 +00:00
### Options
2019-12-04 18:04:57 +00:00
#### --all
include app-wide, device-wide variables that apply to the selected device or service.
Variables are still filtered out by type with the --config option.
2019-09-06 13:43:53 +00:00
#### -a, --application APPLICATION
2015-04-16 13:34:40 +00:00
application name
2019-09-06 13:43:53 +00:00
#### -c, --config
2015-07-07 22:01:25 +00:00
2019-12-04 18:04:57 +00:00
show configuration variables only
2015-07-07 22:01:25 +00:00
2019-09-06 13:43:53 +00:00
#### -d, --device DEVICE
2015-04-16 13:34:40 +00:00
2019-09-06 13:43:53 +00:00
device UUID
2019-12-05 17:09:02 +00:00
#### -j, --json
produce JSON output instead of tabular output
2019-09-06 13:43:53 +00:00
#### -v, --verbose
produce verbose output
2015-04-16 13:34:40 +00:00
2019-12-04 18:04:57 +00:00
#### -s, --service SERVICE
service name
2019-08-07 09:28:15 +00:00
## env rm ID
2015-04-16 13:34:40 +00:00
2019-12-11 00:43:55 +00:00
Remove a configuration or environment variable from an application, device
or service, as selected by command-line options.
2015-04-16 13:34:40 +00:00
2019-12-11 00:43:55 +00:00
Variables are selected by their database ID (as reported by the 'balena envs'
command) and one of six database "resource types":
- application (fleet) environment variable
- application (fleet) configuration variable (--config)
- application (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 an application
(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 (application container) in a microservices
(multicontainer) application.
2015-04-16 13:34:40 +00:00
2019-12-11 00:43:55 +00:00
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.
2019-03-04 15:02:09 +00:00
2019-12-11 00:43:55 +00:00
Interactive confirmation is normally asked before the variable is deleted.
2020-01-03 18:37:55 +00:00
The --yes option disables this behavior.
2015-07-07 22:01:25 +00:00
2015-04-16 13:34:40 +00:00
Examples:
2019-12-11 00:43:55 +00:00
$ 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
2015-04-16 13:34:40 +00:00
2019-08-07 09:28:15 +00:00
### Arguments
#### ID
2019-12-11 00:43:55 +00:00
variable's numeric database ID
2019-08-07 09:28:15 +00:00
2015-04-16 13:34:40 +00:00
### Options
2019-12-11 00:43:55 +00:00
#### -c, --config
select a configuration variable (may be used together with the --device option)
2019-08-07 09:28:15 +00:00
#### -d, --device
2015-04-16 13:34:40 +00:00
2019-12-11 00:43:55 +00:00
select a device-specific variable instead of an application (fleet) variable
2015-04-16 13:34:40 +00:00
2019-12-11 00:43:55 +00:00
#### -s, --service
2019-10-02 18:23:50 +00:00
2019-12-11 00:43:55 +00:00
select a service variable (may be used together with the --device option)
2019-10-02 18:23:50 +00:00
2019-08-07 09:28:15 +00:00
#### -y, --yes
2015-07-07 22:01:25 +00:00
2019-12-11 00:43:55 +00:00
do not prompt for confirmation before deleting the variable
2015-07-07 22:01:25 +00:00
2019-04-02 11:26:21 +00:00
## env add NAME [VALUE]
2015-04-16 13:34:40 +00:00
2019-12-10 00:07:16 +00:00
Add an environment or config variable to an application, device or service,
as selected by the respective command-line options. Either the --application
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 is an
application container in a "microservices" application.) 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 application (i.e., the application's fleet). If the --service
option is omitted, the variable applies to all services.
2015-04-16 13:34:40 +00:00
2019-04-02 11:26:21 +00:00
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.
2015-07-07 22:01:25 +00:00
2019-12-10 00:07:16 +00:00
'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 application variables, please
avoid the reserved prefixes.
2019-03-04 15:02:09 +00:00
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena env add TERM --application MyApp
2019-04-02 11:26:21 +00:00
$ balena env add EDITOR vim --application MyApp
2019-12-10 00:07:16 +00:00
$ balena env add EDITOR vim --application MyApp --service MyService
2018-10-19 14:38:50 +00:00
$ balena env add EDITOR vim --device 7cf02a6
2019-12-10 00:07:16 +00:00
$ balena env add EDITOR vim --device 7cf02a6 --service MyService
2015-04-16 13:34:40 +00:00
2019-04-02 11:26:21 +00:00
### Arguments
#### NAME
environment or config variable name
#### VALUE
2019-12-10 00:07:16 +00:00
variable value; if omitted, use value from this process' environment
2019-04-02 11:26:21 +00:00
2015-04-16 13:34:40 +00:00
### Options
2019-04-02 11:26:21 +00:00
#### -a, --application APPLICATION
2015-04-16 13:34:40 +00:00
application name
2019-04-02 11:26:21 +00:00
#### -d, --device DEVICE
2015-07-07 22:01:25 +00:00
2019-04-02 11:26:21 +00:00
device UUID
#### -q, --quiet
suppress warning messages
2015-07-07 22:01:25 +00:00
2019-12-10 00:07:16 +00:00
#### -s, --service SERVICE
service name
2019-09-06 13:43:53 +00:00
## env rename ID VALUE
2019-03-04 15:02:09 +00:00
2019-12-11 17:47:54 +00:00
Change the value of a configuration or environment variable for an application,
device or service, as selected by command-line options.
2015-04-16 13:34:40 +00:00
2019-12-11 17:47:54 +00:00
Variables are selected by their database ID (as reported by the 'balena envs'
command) and one of six database "resource types":
- application (fleet) environment variable
- application (fleet) configuration variable (--config)
- application (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 an application
(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 (application container) in a microservices
(multicontainer) application.
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.
2015-07-07 22:01:25 +00:00
2015-04-16 13:34:40 +00:00
Examples:
2019-12-11 17:47:54 +00:00
$ 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
2015-07-07 22:01:25 +00:00
2019-09-06 13:43:53 +00:00
### Arguments
#### ID
2019-12-11 17:47:54 +00:00
variable's numeric database ID
2019-09-06 13:43:53 +00:00
#### VALUE
2019-12-11 17:47:54 +00:00
variable value; if omitted, use value from this process' environment
2019-09-06 13:43:53 +00:00
2015-07-07 22:01:25 +00:00
### Options
2019-12-11 17:47:54 +00:00
#### -c, --config
select a configuration variable (may be used together with the --device option)
2019-09-06 13:43:53 +00:00
#### -d, --device
2015-07-07 22:01:25 +00:00
2019-12-11 17:47:54 +00:00
select a device-specific variable instead of an application (fleet) variable
#### -s, --service
select a service variable (may be used together with the --device option)
2015-04-16 13:34:40 +00:00
2018-12-10 21:05:35 +00:00
# Tags
## tags
2020-05-26 09:17:30 +00:00
List all tags and their values for a particular application,
device or release.
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
Examples:
2018-12-10 21:05:35 +00:00
$ balena tags --application MyApp
$ balena tags --device 7cf02a6
$ balena tags --release 1234
2019-10-15 21:57:34 +00:00
$ balena tags --release b376b0e544e9429483b656490e5b9443b4349bd6
2018-12-10 21:05:35 +00:00
### Options
2020-05-26 09:17:30 +00:00
#### -a, --application APPLICATION
2018-12-10 21:05:35 +00:00
application name
2020-05-26 09:17:30 +00:00
#### -d, --device DEVICE
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
device UUID
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
#### -r, --release RELEASE
2018-12-10 21:05:35 +00:00
release id
2020-05-26 09:17:30 +00:00
#### --app APP
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
same as '--application'
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
## tag rm <tagKey>
Remove a tag from an application, device or release.
2018-12-10 21:05:35 +00:00
Examples:
2020-05-26 09:17:30 +00:00
$ balena tag rm myTagKey --application MyApp
$ balena tag rm myTagKey --device 7cf02a6
$ balena tag rm myTagKey --release 1234
$ balena tag rm myTagKey --release b376b0e544e9429483b656490e5b9443b4349bd6
### Arguments
#### TAGKEY
the key string of the tag
2018-12-10 21:05:35 +00:00
### Options
2020-05-26 09:17:30 +00:00
#### -a, --application APPLICATION
2018-12-10 21:05:35 +00:00
application name
2020-05-26 09:17:30 +00:00
#### -d, --device DEVICE
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
device UUID
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
#### -r, --release RELEASE
2018-12-10 21:05:35 +00:00
release id
2020-05-26 09:17:30 +00:00
#### --app APP
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
same as '--application'
## tag set <tagKey> [value]
Set a tag on an application, 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.
2018-12-10 21:05:35 +00:00
Examples:
2020-05-26 09:17:30 +00:00
$ balena tag set mySimpleTag --application MyApp
$ balena tag set myCompositeTag myTagValue --application MyApp
$ 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
### Arguments
#### TAGKEY
the key string of the tag
#### VALUE
the optional value associated with the tag
2018-12-10 21:05:35 +00:00
### Options
2020-05-26 09:17:30 +00:00
#### -a, --application APPLICATION
2018-12-10 21:05:35 +00:00
application name
2020-05-26 09:17:30 +00:00
#### -d, --device DEVICE
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
device UUID
2018-12-10 21:05:35 +00:00
2020-05-26 09:17:30 +00:00
#### -r, --release RELEASE
2018-12-10 21:05:35 +00:00
release id
2020-05-26 09:17:30 +00:00
#### --app APP
same as '--application'
2019-06-24 15:51:07 +00:00
# Help and Version
2015-04-16 14:42:09 +00:00
2018-03-20 17:43:26 +00:00
## help [command...]
2015-04-16 13:34:40 +00:00
Get detailed help for an specific command.
Examples:
2018-10-19 14:38:50 +00:00
$ balena help apps
$ balena help os download
2015-04-16 13:34:40 +00:00
2015-10-15 12:48:34 +00:00
### Options
#### --verbose, -v
show additional commands
2018-03-20 17:43:26 +00:00
## version
2015-04-16 13:34:40 +00:00
2019-06-24 15:51:07 +00:00
Display version information for the balena CLI and/or Node.js.
2020-01-03 23:13:20 +00:00
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/).
2019-06-24 15:51:07 +00:00
Examples:
$ balena version
$ balena version -a
$ balena version -j
### Options
#### -a, --all
include version information for additional components (Node.js)
#### -j, --json
output version information in JSON format for programmatic use
2015-04-16 13:34:40 +00:00
# Keys
2015-04-16 14:42:09 +00:00
2018-03-20 17:43:26 +00:00
## keys
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
List all SSH keys registered in balenaCloud for the logged in user.
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena keys
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
### Options
2018-03-20 17:43:26 +00:00
## key <id>
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
Display a single SSH key registered in balenaCloud for the logged in user.
2015-04-16 13:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena key 17
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
### Arguments
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
#### ID
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
balenaCloud ID for the SSH key
2015-04-16 13:34:40 +00:00
### Options
2018-03-20 17:43:26 +00:00
## key add <name> [path]
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
Register an SSH in balenaCloud for the logged in user.
2015-04-16 13:34:40 +00:00
If `path` is omitted, the command will attempt
to read the SSH key from stdin.
Examples:
2018-10-19 14:38:50 +00:00
$ balena key add Main ~/.ssh/id_rsa.pub
$ cat ~/.ssh/id_rsa.pub | balena key add Main
2015-04-16 13:34:40 +00:00
2020-04-17 13:19:33 +00:00
### Arguments
#### NAME
the SSH key name
#### PATH
the path to the public key file
### Options
## key rm <id>
Remove a single SSH key registered in balenaCloud for the logged in user.
The --yes option may be used to avoid interactive confirmation.
Examples:
$ balena key rm 17
$ balena key rm 17 --yes
### Arguments
#### ID
balenaCloud ID for the SSH key
### Options
#### -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
2019-04-24 11:08:26 +00:00
## logs <uuidOrDevice>
2015-04-16 13:34:40 +00:00
Use this command to show logs for a specific device.
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
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
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
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
### Options
#### --tail, -t
continuously stream output
2019-04-24 13:59:07 +00:00
#### --service, -s <service>
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
#### --system, -S
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
## scan
2020-03-13 11:32:29 +00:00
Scan for balenaOS devices on your local network.
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
2019-04-24 17:45:19 +00:00
## ssh <applicationOrDevice> [serviceName]
2016-05-19 14:10:45 +00:00
2019-04-24 17:45:19 +00:00
This command can be used to 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.
2020-04-06 21:47:57 +00:00
If an application name 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
Examples:
2019-04-24 17:45:19 +00:00
balena ssh MyApp
2016-04-24 19:52:41 +00:00
2019-04-24 17:45:19 +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
2019-08-09 20:00:20 +00:00
Warning: `balena ssh` requires an openssh-compatible client to be correctly
2019-04-24 17:45:19 +00:00
installed in your shell environment. For more information (including Windows
2019-05-13 14:03:07 +00:00
support) please check:
2019-04-24 17:45:19 +00:00
https://github.com/balena-io/balena-cli/blob/master/INSTALL.md#additional-dependencies
2016-04-24 19:52:41 +00:00
### Options
2016-07-21 16:35:44 +00:00
#### --port, -p <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-03-31 13:50:09 +00:00
#### --tty, -t
Force pseudo-terminal allocation (bypass TTY autodetection for stdin)
2016-06-22 13:46:18 +00:00
#### --verbose, -v
2019-04-24 17:45:19 +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-03-27 01:26:37 +00:00
Bypass global proxy configuration for the ssh connection
2019-03-11 18:54:22 +00:00
2019-06-06 16:56:20 +00:00
## tunnel <deviceOrApplication>
2019-04-18 15:49:17 +00:00
Use this command to open local ports which tunnel to listening ports on your balenaOS device.
For example, you could open port 8080 on your local machine to connect to your managed balenaOS
device running a web server listening on port 3000.
You can tunnel multiple ports at any given time.
Examples:
# map remote port 22222 to localhost:22222
$ balena tunnel abcde12345 -p 22222
# map remote port 22222 to localhost:222
$ balena tunnel abcde12345 -p 22222:222
# map remote port 22222 to any address on your host machine, port 22222
$ balena tunnel abcde12345 -p 22222:0.0.0.0
# map remote port 22222 to any address on your host machine, port 222
$ balena tunnel abcde12345 -p 22222:0.0.0.0:222
# multiple port tunnels can be specified at any one time
$ balena tunnel abcde12345 -p 8080:3000 -p 8081:9000
### Options
#### --port, -p <port>
The mapping of remote to local ports.
2015-04-16 13:34:40 +00:00
# Notes
2015-04-16 14:42:09 +00:00
2018-03-20 17:43:26 +00:00
## note <|note>
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
2015-09-29 17:03:14 +00:00
# OS
2018-03-20 17:43:26 +00:00
## os versions <type>
2017-06-12 10:21:12 +00:00
2018-10-19 14:38:50 +00:00
Use this command to show the available balenaOS versions for a certain device type.
Check available types with `balena devices supported`
2017-06-12 10:21:12 +00:00
Example:
2018-10-19 14:38:50 +00:00
$ balena os versions raspberrypi3
2017-06-12 10:21:12 +00:00
2018-03-20 17:43:26 +00:00
## os download <type>
2015-09-29 17:03:14 +00:00
Use this command to download an unconfigured os image for a certain device type.
2018-10-19 14:38:50 +00:00
Check available types with `balena devices supported`
2015-09-29 17:03:14 +00:00
2017-03-22 10:50:06 +00:00
If version is not specified the newest stable (non-pre-release) version of OS
is downloaded if available, or the newest version otherwise (if all existing
versions for the given device type are pre-release).
You can pass `--version menu` to pick the OS version from the interactive menu
of all available versions.
2015-09-29 17:03:14 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version 1.24.1
$ balena os download raspberrypi3 -o ../foo/bar/raspberry-pi.img --version ^1.20.0
$ 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
2015-09-29 17:03:14 +00:00
### Options
#### --output, -o <output>
output path
2017-03-22 10:50:06 +00:00
#### --version <version>
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)
2018-03-20 17:43:26 +00:00
## os build-config <image> <device-type>
2017-06-12 10:21:12 +00:00
2018-10-19 14:38:50 +00:00
Use this command to prebuild the OS config once and skip the interactive part of `balena os configure` .
2017-06-12 10:21:12 +00:00
2017-11-16 18:11:17 +00:00
Example:
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
### Options
#### --advanced, -v
2017-06-14 21:51:56 +00:00
show advanced configuration options
2017-06-12 10:21:12 +00:00
#### --output, -o <output>
the path to the output JSON file
2019-10-31 01:46:14 +00:00
## os configure IMAGE
2015-09-29 17:36:29 +00:00
2019-10-31 01:46:14 +00:00
Configure a previously downloaded balenaOS image for a specific device type or
balena application.
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
2019-10-31 01:46:14 +00:00
The --device-type option may be used to override the application's default
device type, in case of an application with mixed device types.
2017-11-16 18:13:20 +00:00
2020-01-21 16:51:06 +00:00
The --system-connection (-c) option can be used to inject NetworkManager connection
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/
https://developer.gnome.org/NetworkManager/stable/nm-settings.html
2019-10-31 01:46:14 +00:00
The --device-api-key option is deprecated and will be removed in a future release.
A suitable key is automatically generated or fetched if this option is omitted.
2018-12-07 15:44:18 +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
$ balena os configure ../path/rpi3.img --device 7cf02a6 --device-api-key < existingDeviceKey >
$ balena os configure ../path/rpi3.img --app MyApp
$ balena os configure ../path/rpi3.img --app MyApp --version 2.12.7
$ balena os configure ../path/rpi3.img --app MyFinApp --device-type raspberrypi3
2019-10-31 01:46:14 +00:00
$ balena os configure ../path/rpi3.img --app MyFinApp --device-type raspberrypi3 --config myWifiConfig.json
### 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
2019-10-31 01:46:14 +00:00
#### --app APP
same as '--application'
#### -a, --application APPLICATION
2017-11-16 18:13:20 +00:00
application name
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
2019-10-31 01:46:14 +00:00
interval (in minutes) for the on-device balena supervisor periodic app update check
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)
#### -d, --device DEVICE
device UUID
#### -k, --device-api-key DEVICE-API-KEY
custom device API key (DEPRECATED and only supported with balenaOS 2.0.3+)
#### --device-type DEVICE-TYPE
device type slug (e.g. "raspberrypi3") to override the application device type
#### --version VERSION
balenaOS version, for example "2.32.0" or "2.44.0+rev1"
2017-06-12 10:21:12 +00:00
2020-01-21 16:51:06 +00:00
#### -c, --system-connection SYSTEM-CONNECTION
paths to local files to place into the 'system-connections' directory
2018-03-20 17:43:26 +00:00
## os initialize <image>
2015-09-29 18:52:34 +00:00
2017-03-24 09:48:14 +00:00
Use this command to initialize a device with previously configured operating system image.
Note: Initializing the device may ask for administrative permissions
because we need to access the raw devices directly.
2015-09-29 18:52:34 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena os initialize ../path/rpi.img --type 'raspberry-pi'
2015-10-15 12:48:34 +00:00
### Options
#### --yes, -y
confirm non interactively
2017-05-12 10:01:37 +00:00
#### --type, -t <type>
2015-10-15 12:48:34 +00:00
2018-10-19 14:38:50 +00:00
device type (Check available types with `balena devices supported` )
2015-09-29 18:52:34 +00:00
2015-10-20 13:17:48 +00:00
#### --drive, -d <drive>
2018-10-19 14:38:50 +00:00
the drive to write the image to, like `/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-20 13:17:48 +00:00
2015-11-10 16:53:34 +00:00
# Config
2018-03-20 17:43:26 +00:00
## config read
2015-11-10 16:53:34 +00:00
2016-06-22 13:46:18 +00:00
Use this command to read the config.json file from the mounted filesystem (e.g. SD card) of a provisioned device"
2015-11-10 16:53:34 +00:00
2015-11-10 18:27:01 +00:00
Examples:
2015-11-10 16:53:34 +00:00
2018-10-19 14:38:50 +00:00
$ balena config read --type raspberry-pi
$ balena config read --type raspberry-pi --drive /dev/disk2
2015-11-10 16:53:34 +00:00
### Options
2017-05-12 10:01:37 +00:00
#### --type, -t <type>
2015-11-10 16:53:34 +00:00
2018-10-19 14:38:50 +00:00
device type (Check available types with `balena devices supported` )
2015-11-10 16:53:34 +00:00
#### --drive, -d <drive>
drive
2018-03-20 17:43:26 +00:00
## config write <key> <value>
2015-11-10 18:27:01 +00:00
2016-06-22 13:46:18 +00:00
Use this command to write the config.json file to the mounted filesystem (e.g. SD card) of a provisioned device
2015-11-10 18:27:01 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena config write --type raspberry-pi username johndoe
$ balena config write --type raspberry-pi --drive /dev/disk2 username johndoe
$ balena config write --type raspberry-pi files.network/settings "..."
2015-11-10 18:27:01 +00:00
### Options
2017-05-12 10:01:37 +00:00
#### --type, -t <type>
2015-11-10 18:27:01 +00:00
2018-10-19 14:38:50 +00:00
device type (Check available types with `balena devices supported` )
2015-11-10 18:27:01 +00:00
#### --drive, -d <drive>
drive
2018-03-20 17:43:26 +00:00
## config inject <file>
2016-03-17 20:07:19 +00:00
2018-01-26 14:43:00 +00:00
Use this command to inject a config.json file to the mounted filesystem
2018-10-19 14:38:50 +00:00
(e.g. SD card or mounted balenaOS image) of a provisioned device"
2016-03-17 20:07:19 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena config inject my/config.json --type raspberry-pi
$ balena config inject my/config.json --type raspberry-pi --drive /dev/disk2
2016-03-17 20:07:19 +00:00
### Options
2017-05-12 10:01:37 +00:00
#### --type, -t <type>
2016-03-17 20:07:19 +00:00
2018-10-19 14:38:50 +00:00
device type (Check available types with `balena devices supported` )
2016-03-17 20:07:19 +00:00
#### --drive, -d <drive>
drive
2018-03-20 17:43:26 +00:00
## config reconfigure
2015-11-11 14:38:45 +00:00
Use this command to reconfigure a provisioned device
Examples:
2018-10-19 14:38:50 +00:00
$ balena config reconfigure --type raspberry-pi
$ balena config reconfigure --type raspberry-pi --advanced
$ balena config reconfigure --type raspberry-pi --drive /dev/disk2
2015-11-11 14:38:45 +00:00
### Options
2017-05-12 10:01:37 +00:00
#### --type, -t <type>
2015-11-11 14:38:45 +00:00
2018-10-19 14:38:50 +00:00
device type (Check available types with `balena devices supported` )
2015-11-11 14:38:45 +00:00
#### --drive, -d <drive>
drive
#### --advanced, -v
show advanced commands
2018-03-20 17:43:26 +00:00
## config generate
2016-02-27 02:37:15 +00:00
2017-11-14 13:14:53 +00:00
Use this command to generate a config.json for a device or application.
2018-10-15 17:03:21 +00:00
Calling this command with the exact version number of the targeted image is required.
2018-07-11 18:56:13 +00:00
2017-11-14 13:14:53 +00:00
This is interactive by default, but you can do this automatically without interactivity
by specifying an option for each question on the command line, if you know the questions
that will be asked for the relevant device type.
2016-02-27 02:37:15 +00:00
2018-12-07 15:44:18 +00:00
In case that you want to configure an image for an application with mixed device types,
you can pass the --device-type argument along with --app to specify the target device type.
2016-02-27 02:37:15 +00:00
Examples:
2018-11-23 13:33:41 +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 --device-api-key < existingDeviceKey >
$ balena config generate --device 7cf02a6 --version 2.12.7 --output config.json
$ balena config generate --app MyApp --version 2.12.7
2018-12-07 15:44:18 +00:00
$ balena config generate --app MyApp --version 2.12.7 --device-type fincm3
2018-11-23 13:33:41 +00:00
$ balena config generate --app MyApp --version 2.12.7 --output config.json
$ balena config generate --app MyApp --version 2.12.7 --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 1
2016-02-27 02:37:15 +00:00
### Options
2018-07-11 18:56:13 +00:00
#### --version <version>
2018-10-19 14:38:50 +00:00
a balenaOS version
2018-07-11 18:56:13 +00:00
2017-12-21 17:40:13 +00:00
#### --application, -a, --app <application>
2016-03-28 13:25:40 +00:00
application name
#### --device, -d <device>
device uuid
2017-04-19 03:21:59 +00:00
#### --deviceApiKey, -k <device-api-key>
2018-10-19 14:38:50 +00:00
custom device key - note that this is only supported on balenaOS 2.0.3+
2017-04-19 03:21:59 +00:00
2018-12-07 15:44:18 +00:00
#### --deviceType <device-type>
device type slug
2018-07-10 17:45:48 +00:00
#### --generate-device-api-key
generate a fresh device key for the device
2016-02-27 02:37:15 +00:00
#### --output, -o <output>
output
2017-11-14 13:14:53 +00:00
#### --network <network>
the network type to use: ethernet or wifi
#### --wifiSsid <wifiSsid>
the wifi ssid to use (used only if --network is set to wifi)
#### --wifiKey <wifiKey>
the wifi key to use (used only if --network is set to wifi)
#### --appUpdatePollInterval <appUpdatePollInterval>
how frequently (in minutes) to poll for application updates
2017-10-25 11:17:07 +00:00
# Preload
2018-03-20 17:43:26 +00:00
## preload <image>
2017-10-25 11:17:07 +00:00
2019-11-08 14:32:21 +00:00
Preload a balena application release (app images/containers), 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.
When the device boots, it will not need to download the application, as it was
preloaded.
2019-11-08 14:32:21 +00:00
2018-10-19 14:38:50 +00:00
Warning: "balena preload" requires Docker to be correctly installed in
2017-10-25 11:17:07 +00:00
your shell environment. For more information (including Windows support)
2019-11-08 14:32:21 +00:00
check: https://github.com/balena-io/balena-cli/blob/master/INSTALL.md
2017-10-25 11:17:07 +00:00
Examples:
2018-10-03 13:27:53 +00:00
2018-10-19 14:38:50 +00:00
$ balena preload balena.img --app 1234 --commit e1f2592fc6ee949e68756d4f4a48e49bff8d72a0 --splash-image image.png
$ balena preload balena.img
2017-10-25 11:17:07 +00:00
### Options
#### --app, -a <appId>
id of the application to preload
#### --commit, -c <hash>
2019-05-28 09:39:30 +00:00
The commit hash for a specific application 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
manually pinned using https://github.com/balena-io-projects/staged-releases .
2017-10-25 11:17:07 +00:00
#### --splash-image, -s <splashImage.png>
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
2018-08-20 16:19:10 +00:00
Disables check for matching architecture in image and application
2017-10-25 11:17:07 +00:00
2018-05-30 13:33:05 +00:00
#### --pin-device-to-release, -p
2019-05-13 14:03:07 +00:00
Pin the preloaded device to the preloaded release on provision
2018-05-30 13:33:05 +00:00
2019-05-30 11:57:03 +00:00
#### --add-certificate <certificate.crt>
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.
2017-10-25 11:17:07 +00:00
#### --docker, -P <docker>
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
#### --dockerHost, -h <dockerHost>
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
2019-05-13 14:03:07 +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
#### --ca <ca>
Docker host TLS certificate authority file
#### --cert <cert>
Docker host TLS certificate file
#### --key <key>
Docker host TLS key file
2018-06-26 16:59:44 +00:00
# Push
2018-10-16 10:25:37 +00:00
## push <applicationOrDevice>
2018-06-26 16:59:44 +00:00
2019-04-23 10:38:13 +00:00
This command can be used to start a build on the remote balena cloud builders,
or a local mode balena 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-05-01 11:18:11 +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:
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}'
2018-10-16 10:25:37 +00:00
2019-08-15 14:38:50 +00:00
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/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.
2019-06-18 10:13:09 +00:00
2020-05-01 11:18:11 +00:00
DOCKERIGNORE AND GITIGNORE FILES
By default, both '.dockerignore' and '.gitignore' files are taken into account
in order to prevent files from being sent to the balenaCloud builder or Docker
or balenaEngine (balenaOS device).
However, this behavior has been DEPRECATED and will change in an upcoming major
version release. The --nogitignore (-G) option should be used to enable the new
behavior already now. This option will cause the CLI to:
* Disregard all '.gitignore' files at the source directory and subdirectories,
and consider only the '.dockerignore' file (if any) at the source directory.
* Consequently, allow files to be sent to balenaCloud / Docker / balenaEngine
even if they are listed in '.gitignore' files (a longstanding feature request).
* Use a new '.dockerignore' parser and filter library that improves compatibility
with "docker build" and fixes several issues (mainly on Windows).
* Prevent a warning message from being printed.
When --nogitignore (-G) is provided, a few "hardcoded" dockerignore patterns are
also used and "merged" (in memory) with the patterns found in the '.dockerignore'
file (if any), in the following order:
** /.git
< user ' s patterns from the ' . dockerignore ' file , if any >
!**/.balena
!**/.resin
!**/Dockerfile
!**/Dockerfile.*
!**/docker-compose.yml
If necessary, the effect of the '**/.git' pattern may be modified by adding
"counter patterns" to the '.dockerignore' file, for example '!service1/.git'.
For documentation on pattern format, see:
- https://docs.docker.com/engine/reference/builder/#dockerignore-file
- https://www.npmjs.com/package/@balena/dockerignore
2018-06-26 16:59:44 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena push myApp
$ balena push myApp --source < source directory >
$ balena push myApp -s < source directory >
2018-06-26 16:59:44 +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
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
2018-06-26 16:59:44 +00:00
### Options
#### --source, -s <source>
2020-05-01 11:18:11 +00:00
Source directory to be sent to balenaCloud or balenaOS device (default: current working dir)
2018-06-26 16:59:44 +00:00
2018-06-21 13:29:25 +00:00
#### --emulated, -e
Force an emulated build to occur on the remote builder
2019-04-11 11:49:19 +00:00
#### --dockerfile <Dockerfile>
Alternative Dockerfile name/path, relative to the source folder
2018-06-21 13:29:25 +00:00
#### --nocache, -c
Don't use cache when building this project
2020-02-15 20:20:56 +00:00
#### --noparent-check
Disable project validation check of 'docker-compose.yml' file in parent folder
2018-11-07 18:15:05 +00:00
#### --registry-secrets, -R <secrets.yml|.json>
2019-06-18 10:13:09 +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
2019-05-29 14:09:05 +00:00
Don't run a live session on this push. The filesystem will not be monitored, and changes
2020-01-03 18:37:55 +00:00
will not be synchronized to any running containers. Note that both this flag and --detached
2019-05-29 14:09:05 +00:00
and required to cause the process to end once the initial build has completed.
2019-01-14 16:51:57 +00:00
2019-04-24 13:31:30 +00:00
#### --detached, -d
2019-07-25 09:11: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 the command to not tail application logs when the build
has completed.
2019-04-24 13:31:30 +00:00
2019-04-24 13:59:07 +00:00
#### --service <service>
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.
2019-05-27 10:32:47 +00:00
#### --env <env>
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-01-29 11:10:59 +00:00
#### --convert-eol, -l
2020-02-07 13:22:20 +00:00
On Windows only, convert line endings from CRLF (Windows format) to LF (Unix format).
Source files are not modified.
2020-01-29 11:10:59 +00:00
2020-05-01 11:18:11 +00:00
#### --nogitignore, -G
Disregard all .gitignore files, and consider only the .dockerignore file (if any)
at the source directory. This will be the default behavior in an upcoming major
version release. For more information, see 'balena help push'.
2020-03-25 17:07:17 +00:00
# Settings
## settings
Use this command to display current balena CLI settings.
Examples:
$ balena settings
### Options
2017-04-11 13:25:54 +00:00
# Local
2018-03-20 17:43:26 +00:00
## local configure <target>
2017-04-11 13:25:54 +00:00
2018-10-19 14:38:50 +00:00
Use this command to configure or reconfigure a balenaOS drive or image.
2017-04-11 13:25:54 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena local configure /dev/sdc
$ balena local configure path/to/image.img
2017-04-11 13:25:54 +00:00
2019-05-30 14:18:58 +00:00
## local flash <image>
Use this command to flash a balenaOS image to a drive.
Examples:
$ balena local flash path/to/balenaos.img[.zip|.gz|.bz2|.xz]
$ balena local flash path/to/balenaos.img --drive /dev/disk2
$ balena local flash path/to/balenaos.img --drive /dev/disk2 --yes
### Options
#### --yes, -y
confirm non-interactively
#### --drive, -d <drive>
drive
2017-04-26 12:34:40 +00:00
# Deploy
2018-03-20 17:43:26 +00:00
## build [source]
2017-04-26 12:34:40 +00:00
2019-04-11 11:49:19 +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.)
2017-04-26 12:34:40 +00:00
2019-04-11 11:49:19 +00:00
You must provide either an application or a device-type/architecture pair to use
the balena Dockerfile pre-processor (e.g. Dockerfile.template -> Dockerfile).
2017-04-26 12:34:40 +00:00
2017-12-11 22:37:56 +00:00
This command will look into the given source directory (or the current working
2020-04-01 10:39:30 +00:00
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.
2017-12-11 22:37:56 +00:00
2020-05-01 11:18:11 +00:00
REGISTRY SECRETS
2019-02-27 18:01:47 +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:
'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}'
2019-08-15 14:38:50 +00:00
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/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.
2019-06-18 10:13:09 +00:00
2020-05-01 11:18:11 +00:00
DOCKERIGNORE AND GITIGNORE FILES
By default, both '.dockerignore' and '.gitignore' files are taken into account
in order to prevent files from being sent to the balenaCloud builder or Docker
or balenaEngine (balenaOS device).
However, this behavior has been DEPRECATED and will change in an upcoming major
version release. The --nogitignore (-G) option should be used to enable the new
behavior already now. This option will cause the CLI to:
* Disregard all '.gitignore' files at the source directory and subdirectories,
and consider only the '.dockerignore' file (if any) at the source directory.
* Consequently, allow files to be sent to balenaCloud / Docker / balenaEngine
even if they are listed in '.gitignore' files (a longstanding feature request).
* Use a new '.dockerignore' parser and filter library that improves compatibility
with "docker build" and fixes several issues (mainly on Windows).
* Prevent a warning message from being printed.
When --nogitignore (-G) is provided, a few "hardcoded" dockerignore patterns are
also used and "merged" (in memory) with the patterns found in the '.dockerignore'
file (if any), in the following order:
** /.git
< user ' s patterns from the ' . dockerignore ' file , if any >
!**/.balena
!**/.resin
!**/Dockerfile
!**/Dockerfile.*
!**/docker-compose.yml
If necessary, the effect of the '**/.git' pattern may be modified by adding
"counter patterns" to the '.dockerignore' file, for example '!service1/.git'.
For documentation on pattern format, see:
- https://docs.docker.com/engine/reference/builder/#dockerignore-file
- https://www.npmjs.com/package/@balena/dockerignore
2017-04-26 12:34:40 +00:00
Examples:
2018-10-19 14:38:50 +00:00
$ balena build
$ balena build ./source/
2018-12-03 13:10:54 +00:00
$ balena build --deviceType raspberrypi3 --arch armv7hf --emulated
2018-10-19 14:38:50 +00:00
$ balena build --application MyApp ./source/
2019-10-07 01:25:18 +00:00
$ balena build --docker /var/run/docker.sock # Linux, Mac
$ balena build --docker //./pipe/docker_engine # Windows
2018-10-19 14:38:50 +00:00
$ balena build --dockerHost my.docker.host --dockerPort 2376 --ca ca.pem --key key.pem --cert cert.pem
2017-04-26 12:34:40 +00:00
### Options
#### --arch, -A <arch>
The architecture to build for
2017-05-29 12:59:25 +00:00
#### --deviceType, -d <deviceType>
2017-04-26 12:34:40 +00:00
The type of device this build is for
#### --application, -a <application>
2018-10-19 14:38:50 +00:00
The target balena application this build is for
2017-04-26 12:34:40 +00:00
2017-12-11 22:37:56 +00:00
#### --projectName, -n <projectName>
Specify an alternate project name; default is the directory name
#### --emulated, -e
Run an emulated build using Qemu
2019-04-11 11:49:19 +00:00
#### --dockerfile <Dockerfile>
Alternative Dockerfile name/path, relative to the source folder
2017-12-11 22:37:56 +00:00
#### --logs
Display full log output
2020-05-01 11:18:11 +00:00
#### --nogitignore, -G
Disregard all .gitignore files, and consider only the .dockerignore file (if any)
at the source directory. This will be the default behavior in an upcoming major
version release. For more information, see 'balena help undefined'.
2020-02-15 20:20:56 +00:00
#### --noparent-check
Disable project validation check of 'docker-compose.yml' file in parent folder
2019-02-26 13:32:27 +00:00
#### --registry-secrets, -R <secrets.yml|.json>
Path to a YAML or JSON file with passwords for a private Docker registry
2020-01-29 11:10:59 +00:00
#### --convert-eol, -l
2020-02-07 13:22:20 +00:00
On Windows only, convert line endings from CRLF (Windows format) to LF (Unix format). Source files are not modified.
2020-01-29 11:10:59 +00:00
2017-04-26 12:34:40 +00:00
#### --docker, -P <docker>
2019-02-26 13:32:27 +00:00
Path to a local docker socket (e.g. /var/run/docker.sock)
2017-04-26 12:34:40 +00:00
#### --dockerHost, -h <dockerHost>
2019-02-26 13:32:27 +00:00
Docker daemon hostname or IP address (dev machine or balena device)
2017-04-26 12:34:40 +00:00
#### --dockerPort, -p <dockerPort>
2019-02-26 13:32:27 +00:00
Docker daemon TCP port number (hint: 2375 for balena devices)
2017-04-26 12:34:40 +00:00
#### --ca <ca>
Docker host TLS certificate authority file
#### --cert <cert>
Docker host TLS certificate file
#### --key <key>
Docker host TLS key file
#### --tag, -t <tag>
The alias to the generated image
2017-05-12 10:01:37 +00:00
#### --buildArg, -B <arg>
Set a build-time variable (eg. "-B 'ARG=value'"). Can be specified multiple times.
2020-02-12 11:35:03 +00:00
#### --cache-from <image-list>
Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the "docker build --cache-from" option.
2017-04-26 12:34:40 +00:00
#### --nocache
Don't use docker layer caching when building
2017-06-23 15:20:16 +00:00
#### --squash
Squash newly built layers into a single new layer
2018-03-20 17:43:26 +00:00
## deploy <appName> [image]
2017-04-26 12:34:40 +00:00
2017-10-09 17:10:50 +00:00
Usage: `deploy <appName> ([image] | --build [--source build-dir])`
2019-02-26 13:32:27 +00:00
Use this command to deploy an image or a complete multicontainer project to an
application, 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
2019-02-27 18:01:47 +00:00
the image in the balenaCloud build servers.)
2019-02-26 13:32:27 +00:00
2017-12-11 22:37:56 +00:00
Unless an image is specified, this command will look into the current directory
2019-04-11 11:49:19 +00:00
(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. 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.
2017-12-11 22:37:56 +00:00
2017-10-09 17:10:50 +00:00
To deploy to an app on which you're a collaborator, use
2018-10-19 14:38:50 +00:00
`balena deploy <appOwnerUsername>/<appName>` .
2017-04-26 12:34:40 +00:00
2019-04-11 11:49:19 +00:00
When --build is used, all options supported by `balena build` are also supported
by this command.
2019-02-27 18:01:47 +00:00
2020-05-01 11:18:11 +00:00
REGISTRY SECRETS
2019-02-27 18:01:47 +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:
'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}'
2017-04-26 12:34:40 +00:00
2019-08-15 14:38:50 +00:00
For a sample project using registry secrets with the Google Container Registry,
check: https://github.com/balena-io-playground/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.
2019-06-18 10:13:09 +00:00
2020-05-01 11:18:11 +00:00
DOCKERIGNORE AND GITIGNORE FILES
By default, both '.dockerignore' and '.gitignore' files are taken into account
in order to prevent files from being sent to the balenaCloud builder or Docker
or balenaEngine (balenaOS device).
However, this behavior has been DEPRECATED and will change in an upcoming major
version release. The --nogitignore (-G) option should be used to enable the new
behavior already now. This option will cause the CLI to:
* Disregard all '.gitignore' files at the source directory and subdirectories,
and consider only the '.dockerignore' file (if any) at the source directory.
* Consequently, allow files to be sent to balenaCloud / Docker / balenaEngine
even if they are listed in '.gitignore' files (a longstanding feature request).
* Use a new '.dockerignore' parser and filter library that improves compatibility
with "docker build" and fixes several issues (mainly on Windows).
* Prevent a warning message from being printed.
When --nogitignore (-G) is provided, a few "hardcoded" dockerignore patterns are
also used and "merged" (in memory) with the patterns found in the '.dockerignore'
file (if any), in the following order:
** /.git
< user ' s patterns from the ' . dockerignore ' file , if any >
!**/.balena
!**/.resin
!**/Dockerfile
!**/Dockerfile.*
!**/docker-compose.yml
If necessary, the effect of the '**/.git' pattern may be modified by adding
"counter patterns" to the '.dockerignore' file, for example '!service1/.git'.
For documentation on pattern format, see:
- https://docs.docker.com/engine/reference/builder/#dockerignore-file
- https://www.npmjs.com/package/@balena/dockerignore
2017-04-26 12:34:40 +00:00
Examples:
2017-12-11 22:37:56 +00:00
2018-10-19 14:38:50 +00:00
$ balena deploy myApp
$ balena deploy myApp --build --source myBuildDir/
$ balena deploy myApp myApp/myImage
2017-04-26 12:34:40 +00:00
### Options
2017-12-11 22:37:56 +00:00
#### --source, -s <source>
2017-04-26 12:34:40 +00:00
2017-12-11 22:37:56 +00:00
Specify an alternate source directory; default is the working directory
2017-04-26 12:34:40 +00:00
2017-12-11 22:37:56 +00:00
#### --build, -b
2017-04-26 12:34:40 +00:00
2017-12-11 22:37:56 +00:00
Force a rebuild before deploy
2017-04-26 12:34:40 +00:00
2017-05-12 10:01:37 +00:00
#### --nologupload
Don't upload build logs to the dashboard with image (if building)
2017-12-11 22:37:56 +00:00
#### --projectName, -n <projectName>
Specify an alternate project name; default is the directory name
#### --emulated, -e
Run an emulated build using Qemu
2019-04-11 11:49:19 +00:00
#### --dockerfile <Dockerfile>
Alternative Dockerfile name/path, relative to the source folder
2017-12-11 22:37:56 +00:00
#### --logs
Display full log output
2020-05-01 11:18:11 +00:00
#### --nogitignore, -G
Disregard all .gitignore files, and consider only the .dockerignore file (if any)
at the source directory. This will be the default behavior in an upcoming major
version release. For more information, see 'balena help undefined'.
2020-02-15 20:20:56 +00:00
#### --noparent-check
Disable project validation check of 'docker-compose.yml' file in parent folder
2019-02-26 13:32:27 +00:00
#### --registry-secrets, -R <secrets.yml|.json>
Path to a YAML or JSON file with passwords for a private Docker registry
2020-01-29 11:10:59 +00:00
#### --convert-eol, -l
2020-02-07 13:22:20 +00:00
On Windows only, convert line endings from CRLF (Windows format) to LF (Unix format). Source files are not modified.
2020-01-29 11:10:59 +00:00
2017-04-26 12:34:40 +00:00
#### --docker, -P <docker>
2019-02-26 13:32:27 +00:00
Path to a local docker socket (e.g. /var/run/docker.sock)
2017-04-26 12:34:40 +00:00
#### --dockerHost, -h <dockerHost>
2019-02-26 13:32:27 +00:00
Docker daemon hostname or IP address (dev machine or balena device)
2017-04-26 12:34:40 +00:00
#### --dockerPort, -p <dockerPort>
2019-02-26 13:32:27 +00:00
Docker daemon TCP port number (hint: 2375 for balena devices)
2017-04-26 12:34:40 +00:00
#### --ca <ca>
Docker host TLS certificate authority file
#### --cert <cert>
Docker host TLS certificate file
#### --key <key>
Docker host TLS key file
#### --tag, -t <tag>
The alias to the generated image
2017-05-12 10:01:37 +00:00
#### --buildArg, -B <arg>
Set a build-time variable (eg. "-B 'ARG=value'"). Can be specified multiple times.
2020-02-12 11:35:03 +00:00
#### --cache-from <image-list>
Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the "docker build --cache-from" option.
2017-04-26 12:34:40 +00:00
#### --nocache
Don't use docker layer caching when building
2017-05-12 10:01:37 +00:00
2017-06-23 15:20:16 +00:00
#### --squash
Squash newly built layers into a single new layer
2018-11-14 22:26:14 +00:00
# Platform
2020-04-09 14:34:24 +00:00
## join [deviceIpOrHostname]
2018-11-14 22:26:14 +00:00
2020-04-09 14:34:24 +00:00
Move a local device to an application on another balena server, causing
the device to "join" the new server. The device must be running balenaOS.
2018-11-14 22:26:14 +00:00
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.
2019-11-21 15:31:45 +00:00
To move a device between applications on the same server, use the
`balena device move` command instead of `balena join` .
2018-11-14 22:26:14 +00:00
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
2020-04-09 14:34:24 +00:00
from an interactive picker. This requires root privileges. Likewise, if
the application flag is not provided then a picker will be shown.
2018-11-14 22:26:14 +00:00
Examples:
$ balena join
$ balena join balena.local
$ balena join balena.local --application MyApp
$ balena join 192.168.1.25
$ balena join 192.168.1.25 --application MyApp
2020-04-09 14:34:24 +00:00
### Arguments
#### DEVICEIPORHOSTNAME
the IP or hostname of device
2018-11-14 22:26:14 +00:00
### Options
2020-04-09 14:34:24 +00:00
#### -a, --application APPLICATION
2018-11-14 22:26:14 +00:00
2020-04-09 14:34:24 +00:00
application name
2018-11-14 22:26:14 +00:00
2020-04-09 14:34:24 +00:00
## leave [deviceIpOrHostname]
2018-11-14 22:26:14 +00:00
2020-04-09 14:34:24 +00:00
Remove a local device from its balena application, causing the device to
"leave" the server it is provisioned on. This effectively makes the device
"unmanaged". The device must be running balenaOS.
2018-11-14 22:26:14 +00:00
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 usually requires root privileges.
Examples:
$ balena leave
$ balena leave balena.local
$ balena leave 192.168.1.25
2020-04-09 14:34:24 +00:00
### Arguments
#### DEVICEIPORHOSTNAME
the device IP or hostname
### Options
2017-06-14 21:23:39 +00:00
# Utilities
2018-03-20 17:43:26 +00:00
## util available-drives
2017-06-14 21:23:39 +00:00
Use this command to list your machine's drives usable for writing the OS image to.
Skips the system drives.