UNPKG

balena-cli

Version:

The official balena Command Line Interface

1,115 lines (1,114 loc) • 198 kB
{ "commands": { "api-key:generate": { "aliases": [], "args": { "name": { "description": "the API key name", "name": "name", "required": true } }, "description": "Generate a new balenaCloud API key.\n\nGenerate a new balenaCloud API key for the current user, with the given\nname. The key will be logged to the console.\n\nThis key can be used to log into the CLI using 'balena login --token <key>',\nor to authenticate requests to the API with an 'Authorization: Bearer <key>' header.", "examples": [ "$ balena api-key generate \"Jenkins Key\"" ], "flags": {}, "hasDynamicHelp": false, "hiddenAliases": [], "id": "api-key:generate", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "api-key", "generate.js" ] }, "api-key:list": { "aliases": [ "api-keys" ], "args": {}, "deprecateAliases": true, "description": "Print a list of balenaCloud API keys.\n\nPrint a list of balenaCloud API keys.\n\nPrint a list of balenaCloud API keys for the current user or for a specific fleet with the `--fleet` option.", "examples": [ "$ balena api-key list" ], "flags": { "user": { "char": "u", "description": "show API keys for your user", "name": "user", "allowNo": false, "type": "boolean" }, "fleet": { "char": "f", "description": "fleet name or slug (preferred)", "name": "fleet", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "api-key:list", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "api-key", "list.js" ] }, "api-key:revoke": { "aliases": [], "args": { "ids": { "description": "the API key ids", "name": "ids", "required": true } }, "description": "Revoke balenaCloud API keys.\n\nRevoke balenaCloud API keys with the given\ncomma-separated list of ids.\n\nThe given balenaCloud API keys will no longer be usable.", "examples": [ "$ balena api-key revoke 123", "$ balena api-key revoke 123,124,456" ], "flags": {}, "hasDynamicHelp": false, "hiddenAliases": [], "id": "api-key:revoke", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "api-key", "revoke.js" ] }, "app:create": { "aliases": [], "args": { "name": { "description": "app name", "name": "name", "required": true } }, "description": "Create an app.\n\nCreate a new balena app.\n\nYou can specify the organization the app should belong to using\nthe `--organization` option. The organization's handle, not its name,\nshould be provided. Organization handles can be listed with the\n`balena organization list` command.\n\nThe app's default device type is specified with the `--type` option.\nThe `balena device-type list` command can be used to list the available\ndevice types.\n\nInteractive dropdowns will be shown for selection if no device type or\norganization is specified and there are multiple options to choose from.\nIf there is a single option to choose from, it will be chosen automatically.\nThis interactive behavior can be disabled by explicitly specifying a device\ntype and organization.", "examples": [ "$ balena app create MyApp", "$ balena app create MyApp --organization mmyorg", "$ balena app create MyApp -o myorg --type raspberry-pi" ], "flags": { "organization": { "char": "o", "description": "handle of the organization the app should belong to", "name": "organization", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "type": { "char": "t", "description": "app device type (Check available types with `balena device-type list`)", "name": "type", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "app:create", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "app", "create.js" ] }, "block:create": { "aliases": [], "args": { "name": { "description": "block name", "name": "name", "required": true } }, "description": "Create an block.\n\nCreate a new balena block.\n\nYou can specify the organization the block should belong to using\nthe `--organization` option. The organization's handle, not its name,\nshould be provided. Organization handles can be listed with the\n`balena organization list` command.\n\nThe block's default device type is specified with the `--type` option.\nThe `balena device-type list` command can be used to list the available\ndevice types.\n\nInteractive dropdowns will be shown for selection if no device type or\norganization is specified and there are multiple options to choose from.\nIf there is a single option to choose from, it will be chosen automatically.\nThis interactive behavior can be disabled by explicitly specifying a device\ntype and organization.", "examples": [ "$ balena block create MyBlock", "$ balena block create MyBlock --organization mmyorg", "$ balena block create MyBlock -o myorg --type raspberry-pi" ], "flags": { "organization": { "char": "o", "description": "handle of the organization the block should belong to", "name": "organization", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "type": { "char": "t", "description": "block device type (Check available types with `balena device-type list`)", "name": "type", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "block:create", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "block", "create.js" ] }, "build": { "aliases": [], "args": { "source": { "description": "path of project source directory", "name": "source" } }, "description": "Build a project locally.\n\nUse this command to build an image or a complete multicontainer project with\nthe provided docker daemon in your development machine or balena device.\n(See also the `balena push` command for the option of building images in the\nbalenaCloud build servers.)\n\nYou must specify either a fleet, or the device type and architecture.\n\nThis command will look into the given source directory (or the current working\ndirectory if one isn't specified) for a docker-compose.yml file, and if found,\neach service defined in the compose file will be built. If a compose file isn't\nfound, it will look for a Dockerfile[.template] file (or alternative Dockerfile\nspecified with the `--dockerfile` option), and if no dockerfile is found, it\nwill try to generate one.\n\nREGISTRY SECRETS \nThe --registry-secrets option specifies a JSON or YAML file containing private\nDocker registry usernames and passwords to be used when pulling base images.\nSample registry-secrets YAML file:\n```\n\t'my-registry-server.com:25000':\n\t\tusername: ann\n\t\tpassword: hunter2\n\t'': # Use the empty string to refer to the Docker Hub\n\t\tusername: mike\n\t\tpassword: cze14\n\t'eu.gcr.io': # Google Container Registry\n\t\tusername: '_json_key'\n\t\tpassword: '{escaped contents of the GCR keyfile.json file}'\n```\nFor a sample project using registry secrets with the Google Container Registry,\ncheck: https://github.com/balena-io-examples/sample-gcr-registry-secrets\n\nIf the --registry-secrets option is not specified, and a secrets.yml or\nsecrets.json file exists in the balena directory (usually $HOME/.balena),\nthis file will be used instead.\n\nDOCKERIGNORE AND GITIGNORE FILES \nBy default, the balena CLI will use a single \".dockerignore\" file (if any) at\nthe project root (--source directory) in order to decide which source files to\nexclude from the \"build context\" (tar stream) sent to balenaCloud, Docker\ndaemon or balenaEngine. In a microservices (multicontainer) fleet, the\nsource directory is the directory that contains the \"docker-compose.yml\" file.\n\nThe --multi-dockerignore (-m) option may be used with microservices\n(multicontainer) fleets that define a docker-compose.yml file. When this\noption is used, each service subdirectory (defined by the `build` or\n`build.context` service properties in the docker-compose.yml file) is\nfiltered separately according to a .dockerignore file defined in the service\nsubdirectory. If no .dockerignore file exists in a service subdirectory, then\nonly the default .dockerignore patterns (see below) apply for that service\nsubdirectory.\n\nWhen the --multi-dockerignore (-m) option is used, the .dockerignore file (if\nany) defined at the overall project root will be used to filter files and\nsubdirectories other than service subdirectories. It will not have any effect\non service subdirectories, whether or not a service subdirectory defines its\nown .dockerignore file. Multiple .dockerignore files are not merged or added\ntogether, and cannot override or extend other files. This behavior maximizes\ncompatibility with the standard docker-compose tool, while still allowing a\nroot .dockerignore file (at the overall project root) to filter files and\nfolders that are outside service subdirectories.\n\nbalena CLI v11 also took .gitignore files into account. This behavior was\ndeprecated in CLI v12 and removed in CLI v13. Please use .dockerignore files\ninstead.\n\nDefault .dockerignore patterns \nA few default/hardcoded dockerignore patterns are \"merged\" (in memory) with the\npatterns found in the applicable .dockerignore files, in the following order:\n```\n **/.git\n < user's patterns from the applicable '.dockerignore' file, if any >\n !**/.balena\n !**/.resin\n !**/Dockerfile\n !**/Dockerfile.*\n !**/docker-compose.yml\n```\nThese patterns always apply, whether or not .dockerignore files exist in the\nproject. If necessary, the effect of the `**/.git` pattern may be modified by\nadding exception patterns to the applicable .dockerignore file(s), for example\n`!mysubmodule/.git`. For documentation on pattern format, see:\n- https://docs.docker.com/engine/reference/builder/#dockerignore-file\n- https://www.npmjs.com/package/@balena/dockerignore\n", "examples": [ "$ balena build --fleet myFleet", "$ balena build ./source/ --fleet myorg/myfleet", "$ balena build --deviceType raspberrypi3 --emulated", "$ balena build --deviceType raspberrypi3 --arch armv7hf --emulated", "$ balena build --docker /var/run/docker.sock --fleet myFleet # Linux, Mac", "$ balena build --docker //./pipe/docker_engine --fleet myFleet # Windows", "$ balena build --dockerHost my.docker.host --dockerPort 2376 --ca ca.pem --key key.pem --cert cert.pem -f myFleet" ], "flags": { "arch": { "char": "A", "description": "the architecture to build for", "name": "arch", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "deviceType": { "char": "d", "description": "the type of device this build is for", "name": "deviceType", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "fleet": { "char": "f", "description": "fleet name or slug (preferred)", "name": "fleet", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "emulated": { "char": "e", "description": "Use QEMU for ARM architecture emulation during the image build", "name": "emulated", "allowNo": false, "type": "boolean" }, "dockerfile": { "description": "Alternative Dockerfile name/path, relative to the source folder", "name": "dockerfile", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "nologs": { "description": "Hide the image build log output (produce less verbose output)", "name": "nologs", "allowNo": false, "type": "boolean" }, "multi-dockerignore": { "char": "m", "description": "Have each service use its own .dockerignore file. See \"balena help build\".", "name": "multi-dockerignore", "allowNo": false, "type": "boolean" }, "noparent-check": { "description": "Disable project validation check of 'docker-compose.yml' file in parent folder", "name": "noparent-check", "allowNo": false, "type": "boolean" }, "registry-secrets": { "char": "R", "description": "Path to a YAML or JSON file with passwords for a private Docker registry", "name": "registry-secrets", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "noconvert-eol": { "description": "Don't convert line endings from CRLF (Windows format) to LF (Unix format).", "name": "noconvert-eol", "allowNo": false, "type": "boolean" }, "projectName": { "char": "n", "description": "Name prefix for locally built images. This is the 'projectName' portion\nin 'projectName_serviceName:tag'. The default is the directory name.", "name": "projectName", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "tag": { "char": "t", "description": "Tag locally built Docker images. This is the 'tag' portion\nin 'projectName_serviceName:tag'. The default is 'latest'.", "name": "tag", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "buildArg": { "char": "B", "description": "[Deprecated] Set a build-time variable (eg. \"-B 'ARG=value'\"). Can be specified multiple times.", "name": "buildArg", "hasDynamicHelp": false, "multiple": true, "type": "option" }, "cache-from": { "description": "Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the \"docker build --cache-from\" option.", "name": "cache-from", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "nocache": { "description": "Don't use docker layer caching when building", "name": "nocache", "allowNo": false, "type": "boolean" }, "pull": { "description": "Pull the base images again even if they exist locally", "name": "pull", "allowNo": false, "type": "boolean" }, "squash": { "description": "Squash newly built layers into a single new layer", "name": "squash", "allowNo": false, "type": "boolean" }, "docker": { "char": "P", "description": "Path to a local docker socket (e.g. /var/run/docker.sock)", "name": "docker", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "dockerHost": { "char": "h", "description": "Docker daemon hostname or IP address (dev machine or balena device) ", "name": "dockerHost", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "dockerPort": { "char": "p", "description": "Docker daemon TCP port number (hint: 2375 for balena devices)", "name": "dockerPort", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ca": { "description": "Docker host TLS certificate authority file", "name": "ca", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "cert": { "description": "Docker host TLS certificate file", "name": "cert", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "key": { "description": "Docker host TLS key file", "name": "key", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "build", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "primary": true, "isESM": false, "relativePath": [ "build", "commands", "build", "index.js" ] }, "config:generate": { "aliases": [], "args": {}, "description": "Generate a config.json file.\n\nGenerate a config.json file for a device or fleet.\n\nThe target balenaOS version must be specified with the --version option.\n\nThe '--dev' option is used to configure balenaOS to operate in development mode,\nallowing anauthenticated root ssh access and exposing network ports such as\nbalenaEngine's 2375 (unencrypted). This option causes `\"developmentMode\": true`\nto be inserted in the 'config.json' file in the image's boot partion. Development\nmode (as a configurable option) is applicable to balenaOS releases from early\n2022. Older releases have separate development and production balenaOS images\nthat cannot be reconfigured through 'config.json' or the '--dev' option. Do not\nconfuse the balenaOS \"development mode\" with a device's \"local mode\", the latter\nbeing a supervisor feature that allows the \"balena push\" command to push a user's\napplication directly to a device in the local network.\n\nThe '--secureBoot' option is used to configure a balenaOS installer image to opt-in\nsecure boot and disk encryption.\n\nTo configure an image for a fleet of mixed device types, use the --fleet option\nalongside the --deviceType option to specify the target device type.\n\nTo avoid interactive questions, specify a command line option for each question that\nwould otherwise be asked.\n\nFleets may be specified by fleet name or slug. Fleet slugs are\nthe recommended option, as they are unique and unambiguous. Slugs can be\nlisted with the `balena fleet list` command. Note that slugs may change if the\nfleet is renamed. Fleet names are not unique and may result in \"Fleet is\nambiguous\" errors at any time (even if it \"used to work in the past\"), for\nexample if the name clashes with a newly created public fleet, or with fleets\nfrom other balena accounts that you may be invited to join under any role.\nFor this reason, fleet names are especially discouraged in scripts (e.g. CI\nenvironments).", "examples": [ "$ balena config generate --device 7cf02a6 --version 2.12.7", "$ balena config generate --device 7cf02a6 --version 2.12.7 --generate-device-api-key", "$ balena config generate --device 7cf02a6 --version 2.12.7 --deviceApiKey <existingDeviceKey>", "$ balena config generate --device 7cf02a6 --version 2.12.7 --output config.json", "$ balena config generate --fleet myorg/fleet --version 2.12.7 --dev", "$ balena config generate --fleet myorg/fleet --version 2.12.7 --secureBoot", "$ balena config generate --fleet myorg/fleet --version 2.12.7 --deviceType fincm3", "$ balena config generate --fleet myorg/fleet --version 2.12.7 --output config.json", "$ balena config generate --fleet myorg/fleet --version 2.12.7 --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 15" ], "flags": { "version": { "description": "a balenaOS version", "name": "version", "required": true, "hasDynamicHelp": false, "multiple": false, "type": "option" }, "fleet": { "char": "f", "description": "fleet name or slug (preferred)", "exclusive": [ "device" ], "name": "fleet", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "dev": { "description": "Configure balenaOS to operate in development mode", "name": "dev", "allowNo": false, "type": "boolean" }, "secureBoot": { "description": "Configure balenaOS installer to opt-in secure boot and disk encryption", "name": "secureBoot", "allowNo": false, "type": "boolean" }, "device": { "char": "d", "description": "device UUID", "exclusive": [ "fleet", "provisioning-key-name", "provisioning-key-expiry-date" ], "name": "device", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "deviceApiKey": { "char": "k", "description": "custom device key - note that this is only supported on balenaOS 2.0.3+", "name": "deviceApiKey", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "deviceType": { "description": "device type slug (run 'balena device-type list' for possible values)", "name": "deviceType", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "generate-device-api-key": { "description": "generate a fresh device key for the device", "name": "generate-device-api-key", "allowNo": false, "type": "boolean" }, "output": { "char": "o", "description": "path of output file", "name": "output", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "network": { "description": "the network type to use: ethernet or wifi", "name": "network", "hasDynamicHelp": false, "multiple": false, "options": [ "ethernet", "wifi" ], "type": "option" }, "wifiSsid": { "description": "the wifi ssid to use (used only if --network is set to wifi)", "name": "wifiSsid", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "wifiKey": { "description": "the wifi key to use (used only if --network is set to wifi)", "name": "wifiKey", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "appUpdatePollInterval": { "description": "supervisor cloud polling interval in minutes (e.g. for device variables)", "name": "appUpdatePollInterval", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "provisioning-key-name": { "description": "custom key name assigned to generated provisioning api key", "exclusive": [ "device" ], "name": "provisioning-key-name", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "provisioning-key-expiry-date": { "description": "expiry date assigned to generated provisioning api key (format: YYYY-MM-DD)", "exclusive": [ "device" ], "name": "provisioning-key-expiry-date", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "config:generate", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "config", "generate.js" ] }, "config:inject": { "aliases": [], "args": { "file": { "description": "the path to the config.json file to inject", "name": "file", "required": true } }, "description": "Inject a config.json file to a balenaOS image or attached media.\n\nInject a 'config.json' file to a balenaOS image file or attached SD card or\nUSB stick.\n\nDocumentation for the balenaOS 'config.json' file can be found at:\nhttps://www.balena.io/docs/reference/OS/configuration/", "examples": [ "$ balena config inject my/config.json", "$ balena config inject my/config.json --drive /dev/disk2" ], "flags": { "drive": { "char": "d", "description": "path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)", "name": "drive", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "config:inject", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "root": true, "offlineCompatible": true, "isESM": false, "relativePath": [ "build", "commands", "config", "inject.js" ] }, "config:read": { "aliases": [], "args": {}, "description": "Read the config.json file of a balenaOS image or attached media.\n\nRead the 'config.json' file of a balenaOS image file or attached SD card or\nUSB stick.\n\nDocumentation for the balenaOS 'config.json' file can be found at:\nhttps://www.balena.io/docs/reference/OS/configuration/", "examples": [ "$ balena config read", "$ balena config read --drive /dev/disk2", "$ balena config read --drive balena.img" ], "flags": { "drive": { "char": "d", "description": "path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)", "name": "drive", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "json": { "char": "j", "description": "produce JSON output instead of tabular output", "name": "json", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "config:read", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "root": true, "offlineCompatible": true, "isESM": false, "relativePath": [ "build", "commands", "config", "read.js" ] }, "config:reconfigure": { "aliases": [], "args": {}, "description": "Interactively reconfigure a balenaOS image file or attached media.\n\nInteractively reconfigure a balenaOS image file or attached media.\n\nThis command extracts the device UUID from the 'config.json' file of the\nchosen balenaOS image file or attached media, and then passes the UUID as\nthe '--device' argument to the 'balena os configure' command.\n\nFor finer-grained or scripted control of the operation, use the\n'balena config read' and 'balena os configure' commands separately.", "examples": [ "$ balena config reconfigure", "$ balena config reconfigure --drive /dev/disk3", "$ balena config reconfigure --drive balena.img --advanced" ], "flags": { "drive": { "char": "d", "description": "path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)", "name": "drive", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "advanced": { "char": "v", "description": "show advanced commands", "name": "advanced", "allowNo": false, "type": "boolean" }, "version": { "description": "balenaOS version, for example \"2.32.0\" or \"2.44.0+rev1\"", "name": "version", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "config:reconfigure", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "root": true, "isESM": false, "relativePath": [ "build", "commands", "config", "reconfigure.js" ] }, "config:write": { "aliases": [], "args": { "key": { "description": "the key of the config parameter to write", "name": "key", "required": true }, "value": { "description": "the value of the config parameter to write", "name": "value", "required": true } }, "description": "Write a key-value pair to the config.json file of an OS image or attached media.\n\nWrite a key-value pair to the 'config.json' file of a balenaOS image file or\nattached SD card or USB stick.\n\nDocumentation for the balenaOS 'config.json' file can be found at:\nhttps://www.balena.io/docs/reference/OS/configuration/", "examples": [ "$ balena config write ntpServers \"0.resinio.pool.ntp.org 1.resinio.pool.ntp.org\"", "$ balena config write --drive /dev/disk2 hostname custom-hostname", "$ balena config write --drive balena.img os.network.connectivity.interval 300" ], "flags": { "drive": { "char": "d", "description": "path to OS image file (e.g. balena.img) or block device (e.g. /dev/disk2)", "name": "drive", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "config:write", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "root": true, "offlineCompatible": true, "isESM": false, "relativePath": [ "build", "commands", "config", "write.js" ] }, "deploy": { "aliases": [], "args": { "fleet": { "description": "fleet name or slug (preferred)", "name": "fleet", "required": true }, "image": { "description": "the image to deploy", "name": "image" } }, "description": "Deploy a single image or a multicontainer project to a balena fleet.\n\nUsage: `deploy <fleet> ([image] | --build [--source build-dir])`\n\nUse this command to deploy an image or a complete multicontainer project to a\nfleet, optionally building it first. The source images are searched for\n(and optionally built) using the docker daemon in your development machine or\nbalena device. (See also the `balena push` command for the option of building\nthe image in the balenaCloud build servers.)\n\nUnless an image is specified, this command will look into the current directory\n(or the one specified by --source) for a docker-compose.yml file. If one is\nfound, this command will deploy each service defined in the compose file,\nbuilding it first if an image for it doesn't exist. Image names will be looked\nup according to the scheme: `<projectName>_<serviceName>`.\n\nIf a compose file isn't found, the command will look for a Dockerfile[.template]\nfile (or alternative Dockerfile specified with the `-f` option), and if yet\nthat isn't found, it will try to generate one.\n\nTo deploy to a fleet where you are a collaborator, use fleet slug including the\norganization: `balena deploy <organization>/<fleet>`.\n\nREGISTRY SECRETS \nThe --registry-secrets option specifies a JSON or YAML file containing private\nDocker registry usernames and passwords to be used when pulling base images.\nSample registry-secrets YAML file:\n```\n\t'my-registry-server.com:25000':\n\t\tusername: ann\n\t\tpassword: hunter2\n\t'': # Use the empty string to refer to the Docker Hub\n\t\tusername: mike\n\t\tpassword: cze14\n\t'eu.gcr.io': # Google Container Registry\n\t\tusername: '_json_key'\n\t\tpassword: '{escaped contents of the GCR keyfile.json file}'\n```\nFor a sample project using registry secrets with the Google Container Registry,\ncheck: https://github.com/balena-io-examples/sample-gcr-registry-secrets\n\nIf the --registry-secrets option is not specified, and a secrets.yml or\nsecrets.json file exists in the balena directory (usually $HOME/.balena),\nthis file will be used instead.\n\nDOCKERIGNORE AND GITIGNORE FILES \nBy default, the balena CLI will use a single \".dockerignore\" file (if any) at\nthe project root (--source directory) in order to decide which source files to\nexclude from the \"build context\" (tar stream) sent to balenaCloud, Docker\ndaemon or balenaEngine. In a microservices (multicontainer) fleet, the\nsource directory is the directory that contains the \"docker-compose.yml\" file.\n\nThe --multi-dockerignore (-m) option may be used with microservices\n(multicontainer) fleets that define a docker-compose.yml file. When this\noption is used, each service subdirectory (defined by the `build` or\n`build.context` service properties in the docker-compose.yml file) is\nfiltered separately according to a .dockerignore file defined in the service\nsubdirectory. If no .dockerignore file exists in a service subdirectory, then\nonly the default .dockerignore patterns (see below) apply for that service\nsubdirectory.\n\nWhen the --multi-dockerignore (-m) option is used, the .dockerignore file (if\nany) defined at the overall project root will be used to filter files and\nsubdirectories other than service subdirectories. It will not have any effect\non service subdirectories, whether or not a service subdirectory defines its\nown .dockerignore file. Multiple .dockerignore files are not merged or added\ntogether, and cannot override or extend other files. This behavior maximizes\ncompatibility with the standard docker-compose tool, while still allowing a\nroot .dockerignore file (at the overall project root) to filter files and\nfolders that are outside service subdirectories.\n\nbalena CLI v11 also took .gitignore files into account. This behavior was\ndeprecated in CLI v12 and removed in CLI v13. Please use .dockerignore files\ninstead.\n\nDefault .dockerignore patterns \nA few default/hardcoded dockerignore patterns are \"merged\" (in memory) with the\npatterns found in the applicable .dockerignore files, in the following order:\n```\n **/.git\n < user's patterns from the applicable '.dockerignore' file, if any >\n !**/.balena\n !**/.resin\n !**/Dockerfile\n !**/Dockerfile.*\n !**/docker-compose.yml\n```\nThese patterns always apply, whether or not .dockerignore files exist in the\nproject. If necessary, the effect of the `**/.git` pattern may be modified by\nadding exception patterns to the applicable .dockerignore file(s), for example\n`!mysubmodule/.git`. For documentation on pattern format, see:\n- https://docs.docker.com/engine/reference/builder/#dockerignore-file\n- https://www.npmjs.com/package/@balena/dockerignore\n", "examples": [ "$ balena deploy myFleet", "$ balena deploy myorg/myfleet --build --source myBuildDir/", "$ balena deploy myorg/myfleet --build --source myBuildDir/ --note \"this is the note for this release\"", "$ balena deploy myorg/myfleet myRepo/myImage", "$ balena deploy myFleet myRepo/myImage --release-tag key1 \"\" key2 \"value2 with spaces\"" ], "flags": { "source": { "char": "s", "description": "specify an alternate source directory; default is the working directory", "name": "source", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "build": { "char": "b", "description": "force a rebuild before deploy", "name": "build", "allowNo": false, "type": "boolean" }, "nologupload": { "description": "don't upload build logs to the dashboard with image (if building)", "name": "nologupload", "allowNo": false, "type": "boolean" }, "release-tag": { "description": "Set release tags if the image deployment is successful. Multiple\narguments may be provided, alternating tag keys and values (see examples).\nHint: Empty values may be specified with \"\" (bash, cmd.exe) or '\"\"' (PowerShell).", "name": "release-tag", "hasDynamicHelp": false, "multiple": true, "type": "option" }, "draft": { "description": "Deploy the release as a draft. Draft releases are ignored\nby the 'track latest' release policy but can be used through release pinning.\nDraft releases can be marked as final through the API. Releases are created\nas final by default unless this option is given.", "name": "draft", "allowNo": false, "type": "boolean" }, "note": { "description": "The notes for this release", "name": "note", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "emulated": { "char": "e", "description": "Use QEMU for ARM architecture emulation during the image build", "name": "emulated", "allowNo": false, "type": "boolean" }, "dockerfile": { "description": "Alternative Dockerfile name/path, relative to the source folder", "name": "dockerfile", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "nologs": { "description": "Hide the image build log output (produce less verbose output)", "name": "nologs", "allowNo": false, "type": "boolean" }, "multi-dockerignore": { "char": "m", "description": "Have each service use its own .dockerignore file. See \"balena help build\".", "name": "multi-dockerignore", "allowNo": false, "type": "boolean" }, "noparent-check": { "description": "Disable project validation check of 'docker-compose.yml' file in parent folder", "name": "noparent-check", "allowNo": false, "type": "boolean" }, "registry-secrets": { "char": "R", "description": "Path to a YAML or JSON file with passwords for a private Docker registry", "name": "registry-secrets", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "noconvert-eol": { "description": "Don't convert line endings from CRLF (Windows format) to LF (Unix format).", "name": "noconvert-eol", "allowNo": false, "type": "boolean" }, "projectName": { "char": "n", "description": "Name prefix for locally built images. This is the 'projectName' portion\nin 'projectName_serviceName:tag'. The default is the directory name.", "name": "projectName", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "tag": { "char": "t", "description": "Tag locally built Docker images. This is the 'tag' portion\nin 'projectName_serviceName:tag'. The default is 'latest'.", "name": "tag", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "buildArg": { "char": "B", "description": "[Deprecated] Set a build-time variable (eg. \"-B 'ARG=value'\"). Can be specified multiple times.", "name": "buildArg", "hasDynamicHelp": false, "multiple": true, "type": "option" }, "cache-from": { "description": "Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the \"docker build --cache-from\" option.", "name": "cache-from", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "nocache": { "description": "Don't use docker layer caching when building", "name": "nocache", "allowNo": false, "type": "boolean" }, "pull": { "description": "Pull the base images again even if they exist locally", "name": "pull", "allowNo": false, "type": "boolean" }, "squash": { "description": "Squash newly built layers into a single new layer", "name": "squash", "allowNo": false, "type": "boolean" }, "docker": { "char": "P", "description": "Path to a local docker socket (e.g. /var/run/docker.sock)", "name": "docker", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "dockerHost": { "char": "h", "description": "Docker daemon hostname or IP address (dev machine or balena device) ", "name": "dockerHost", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "dockerPort": { "char": "p", "description": "Docker daemon TCP port number (hint: 2375 for balena devices)", "name": "dockerPort", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "ca": { "description": "Docker host TLS certificate authority file", "name": "ca", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "cert": { "description": "Docker host TLS certificate file", "name": "cert", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "key": { "description": "Docker host TLS key file", "name": "key", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "deploy", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "primary": true, "isESM": false, "relativePath": [ "build", "commands", "deploy", "index.js" ] }, "device-type:list": { "aliases": [ "devices supported" ], "args": {}, "deprecateAliases": true, "description": "List the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').\n\nList the device types supported by balena (like 'raspberrypi3' or 'intel-nuc').\n\nBy default, only actively supported device types are listed.\nThe --all option can be used to list all device types, including those that are\nno longer supported by balena.\n\nThe --json option is recommended when scripting the output of this command,\nbecause the JSON format is less likely to change and it better represents data\ntypes like lists and empty strings (for example, the ALIASES column contains a\nlist of zero or more values). The 'jq' utility may be helpful in shell scripts\n(https://stedolan.github.io/jq/manual/).", "examples": [ "$ balena device-type list", "$ balena device-type list --all", "$ balena device-type list --json" ], "flags": { "json": { "char": "j", "description": "produce JSON output instead of tabular output", "name": "json", "allowNo": false, "type": "boolean" }, "all": { "description": "include device types no longer supported by balena", "name": "all", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "device-type:list", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "isESM": false, "relativePath": [ "build", "commands", "device-type", "list.js" ] }, "device:deactivate": { "aliases": [], "args": { "uuid": { "description": "the UUID of the device to be deactivated", "name": "uuid", "required": true } }, "description": "Deactivate a device.\n\nDeactivate a device.\n\nNote this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` option.", "examples": [ "$ balena device deactivate 7cf02a6", "$ balena device deactivate 7cf02a6 --yes" ], "flags": { "yes": { "char": "y", "description": "answer \"yes\" to all questions (non interactive use)", "name": "yes", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "device:deactivate", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "authenticated": true, "isESM": false, "relativePath": [ "build", "commands", "device", "deactivate.js" ] }, "device:detect": { "aliases": [ "scan" ], "args": {}, "deprecateAliases": true, "description": "Scan for balenaOS devices on your local network.\n\nScan for balenaOS devices on your local network.\n\nThe output includes device information collected through balenaEngine for\ndevices running a development image of balenaOS. Devices running a production\nimage do not expose balenaEngine (on TCP port 2375), which is why less\ninformation is printed about them.", "examples": [ "$ balena device detect", "$ balena device detect --timeout 120", "$ balena device detect --verbose" ], "flags": { "verbose": { "char": "v", "description": "display full info", "name": "verbose", "allowNo": false, "type": "boolean" }, "timeout": { "char": "t", "description": "scan timeout in seconds", "name": "timeout", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "json": { "char": "j", "description": "produce JSON output instead of tabular output", "name": "json", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": false, "hiddenAliases": [], "id": "device:detect", "pluginAlias": "balena-cli", "pluginName": "balena-cli", "pluginType": "core", "strict": true, "enableJsonFlag": false, "primary": true, "root": true, "offlineCompatible": true, "dockerInfoProperties": [ "Containers", "ContainersRunning", "ContainersPaused", "ContainersStopped", "Images",