• Stars
    star
    452
  • Rank 96,761 (Top 2 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The official balena CLI tool.

balena CLI

The official balena Command Line Interface.

npm version dependencies

About

The balena CLI is a Command Line Interface for balenaCloud or openBalena. It is a software tool available for Windows, macOS and Linux, used through a command prompt / terminal window. It can be used interactively or invoked in scripts. The balena CLI builds on the balena API and the balena SDK, and can also be directly imported in Node.js applications. The balena CLI is an open-source project on GitHub, and your contribution is also welcome!

Installation

Check the balena CLI installation instructions on GitHub.

Choosing a shell (command prompt/terminal)

On Windows, the standard Command Prompt (cmd.exe) and PowerShell are supported. Alternative shells include:

  • MSYS2:

  • MSYS

  • Git for Windows

    • 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 mentioned above (Git for Windows actually uses MSYS2). For a screenshot, check this comment.
  • Microsoft's Windows Subsystem for Linux (WSL). In this case, a Linux distribution like Ubuntu is installed via the Microsoft Store, and a balena CLI release for Linux should be selected. See FAQ for using the balena CLI with WSL and Docker Desktop for Windows.

On macOS and Linux, the standard terminal window is supported. Optionally, bash command auto completion may be enabled by copying the balena_comp file to your system's bash_completion directory: check Docker's command completion guide for system setup instructions.

Logging in

Several CLI commands require access to your balenaCloud account, for example in order to push a new release to your fleet. Those commands require creating a CLI login session by running:

$ balena login

Proxy support

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:[email protected]:12345'
    • export BALENARC_PROXY='http://localhost:8000'
  • The proxy setting in the CLI config file. It may be:

    • A string in URL format, e.g. proxy: 'http://localhost:8000'
    • An object in the format:
      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.

Proxy setup for balena ssh

In order to work behind a proxy server, the balena ssh command requires the proxytunnel package (command-line tool) to be installed. proxytunnel is available for Linux distributions like Ubuntu/Debian (apt install proxytunnel), and for macOS through Homebrew. Windows support is limited to the Windows Subsystem for Linux (e.g., by installing Ubuntu through the Microsoft App Store).

Ensure that the proxy server is configured to allow proxy requests to ssh port 22, using SSL encryption. For example, in the case of the Squid 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 CLI version 11.30.8 or later. In the case of the npm installation option, 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 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.

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.*'

Matched patterns are excluded from proxying. Wildcard expressions are documented at matcher. 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.

Command reference documentation

The full CLI command reference is available on the web or by running balena help --verbose.

Support, FAQ and troubleshooting

To learn more, troubleshoot issues, or to contact us for support:

For CLI bug reports or feature requests, check the CLI GitHub issues.

Deprecation policy

The balena CLI uses semver versioning, with the concepts of major, minor and patch version releases.

The latest release of a major version of the balena CLI will remain compatible with the balenaCloud backend services for at least one year from the date when the following major version is released. For example, balena CLI v11.36.0, as the latest v11 release, would remain compatible with the balenaCloud backend for one year from the date when v12.0.0 was released.

Half way through to that period (6 months after the release of the next major version), older major versions of the balena CLI will start printing a deprecation warning message when it is used interactively (when stderr is attached to a TTY device file). At the end of that period, older major versions will exit with an error message unless the --unsupported flag is used. This behavior was introduced in CLI version 12.47.0 and is also documented by balena help. To take advantage of the latest backend features and ensure compatibility, users are encouraged to regularly update the balena CLI to the latest version.

Contributing (including editing documentation files)

Please have a look at the CONTRIBUTING.md file for some guidance before submitting a pull request or updating documentation (because some files are automatically generated). Thank you for your help and interest!

License

The project is licensed under the Apache 2.0 License. A copy is also available in the LICENSE file in this repository.

More Repositories

1

etcher

Flash OS images to SD cards & USB drives, safely and easily.
TypeScript
29,210
star
2

open-balena

Open source software to manage connected IoT devices at scale
Shell
1,060
star
3

triangular.js

A natural fusion between d3 and angular.js. See http://alexandros.resin.io/angular-d3-svg/ for more information
CoffeeScript
174
star
4

balena-sdk

The SDK to make balena powered JavaScript applications.
TypeScript
145
star
5

docs

Documentation for the balenaCloud platform.
HTML
68
star
6

balena-sdk-python

Balena SDK for Python
Python
67
star
7

qemu

QEMU with additional QEMU_EXECVE flag that persists emulator after an execve
C
62
star
8

pinejs

Generate rest APIs from natural language models
TypeScript
61
star
9

open-balena-api

The core API of openBalena
TypeScript
58
star
10

open-balena-vpn

openBalena VPN
TypeScript
57
star
11

deploy-to-balena-action

Official Github action to deploy releases to balenaCloud environments
TypeScript
37
star
12

lxc-docker-PKGBUILD

Docker for the RaspberryPi
Shell
34
star
13

docker-install-script

Just the docker install script
Shell
29
star
14

etcher-cli

DEPRECATED: See https://github.com/resin-io/etcher/blob/master/docs/CLI.md
JavaScript
29
star
15

balena-cli-masterclass

A guide to getting started with the balena CLI
JavaScript
29
star
16

sshproxy

sshproxy is a simple ssh server library exposing an even simpler API
Go
28
star
17

capitano

Powerful, non opinionated command line parser for serious applications
CoffeeScript
25
star
18

autohat

balenaCloud end-to-end tests (autohat).
RobotFramework
22
star
19

balena-emails

resin.io email generator
JavaScript
18
star
20

doxx

Doxx — a static docs generator with dynamic pages support.
CoffeeScript
16
star
21

contracts

Balena.io Base Contracts
Smarty
16
star
22

open-balena-registry

Docker image storage backend for openBalena
Dockerfile
16
star
23

etcher-homepage

Static website for etcher
JavaScript
15
star
24

balenaos-masterclass

An introduction to balenaOS
14
star
25

open-balena-s3

Amazon S3-compatible storage backend for openBalena
Dockerfile
13
star
26

balena-mdns-publisher

MDNS address publisher for balena services
TypeScript
13
star
27

reconfix

(Re)Configuration toolkit
Rust
13
star
28

debugging-masterclass

A guide to debugging balena device issues
JavaScript
11
star
29

valletta

Tool to build and manage Discourse theme customizations
JavaScript
10
star
30

autohat-board

Automated Hardware Test Rig
KiCad Layout
9
star
31

docker-masterclass

JavaScript
8
star
32

pensieve

A tool for managing and viewing structured documents, backed by the power of git
JavaScript
7
star
33

balena-base-ui

Extension of resin base that adds Nginx, Yarn and Chrome
JavaScript
7
star
34

logs-to-vector

Shell
6
star
35

resin-node-images

6
star
36

balena-fleet-management-masterclass

A guide to managing an application fleet with balena
Python
6
star
37

open-balena-db

Shell
5
star
38

open-balena-haproxy

Haproxy component for resin environments (bob, onprem, etc)
Lua
5
star
39

community

5
star
40

ca-private

Certificate authority based on CloudFlare's PKI/TLS toolkit.
Shell
5
star
41

resin-multivisor

WORK IN PROGRESS: A modified resin-supervisor that runs as a Resin app and runs multiple containers
CoffeeScript
5
star
42

onlinelabs-cloudformation

CloudFormation Custom Resources for online.net ARM servers
CoffeeScript
5
star
43

balena-cli-advanced-masterclass

A guide to the advanced features available in balena CLI
JavaScript
5
star
44

balena-supervisor-base

Minimal base image for https://github.com/balena-io/balena-supervisor - built with Yocto
Shell
5
star
45

resin-cli-installer-osx

Resin CLI OS X installer
Makefile
4
star
46

arm-builder-kernels

Custom Linux kernel for balenaCloud remote ARM builders.
Dockerfile
4
star
47

resin-yocto

[deprecated] Resin.io Yocto manifests with repo tool
4
star
48

open-balena-registry-proxy

Pull images from balenaCloud container registry with fleet slugs!
TypeScript
4
star
49

resin-plugin-sync

[DEPRECATED] Watch a local project directory and sync it on the fly.
CoffeeScript
4
star
50

services-masterclass

A guide to developing and deploying services on a balena device
JavaScript
4
star
51

cert-manager

Certificate manager with Let's Encrypt DNS validation and private CA support
Shell
4
star
52

renovate-config

Shared renovate configuration and GitHub Action
JavaScript
4
star
53

resin-network-config

DEPRECATED. Handle resin images network configuration.
CoffeeScript
3
star
54

resin-parallella-demo

C
3
star
55

python-connman-control

Example python application that connects to the network manager running on a Resin device.
Python
3
star
56

diskio

DEPRECATED. Raw disk I/O that works in all major operating systems
CoffeeScript
3
star
57

autohat-ondevice

On device application for Automated Hardware Tests
Python
3
star
58

node-audio-stream-skew-correction

Testing audio stream time skew correction in NodeJS
CoffeeScript
3
star
59

resin-cli-installer-win32

Resin CLI Win32 installer
NSIS
2
star
60

capitanodoc

Documentation generator for Capitano projects
JavaScript
2
star
61

resin-device-path

DEPRECATED. Parse Resin.io device and partition paths.
CoffeeScript
2
star
62

balena-masterclass-skeleton

A template skeleton base for balena masterclasses
2
star
63

resin-config-inject

DEPRECATED. Resin.io config.json injection.
CoffeeScript
2
star
64

resin-image

DEPRECATED. Resin.io image utilities.
CoffeeScript
2
star
65

resin-image-config

DEPRECATED. Resin.io image FAT configuration
CoffeeScript
2
star
66

resin-olive-fruit

CoffeeScript
2
star
67

node-binary

DEPRECATED: Download node binaries for various platforms and architectures, easily.
CoffeeScript
2
star
68

leviathan-worker

TypeScript
2
star
69

fleetops-os-update

Shell
2
star
70

resin-librato

Shell
2
star
71

balena-popularity-metrics

TypeScript
2
star
72

fleetops-supervisor-update

Shell
1
star
73

networking-masterclass

A guide to on-device networking on balena devices
1
star
74

balena-blog

Create, edit, and manage the content and design of balena's blog. Uses GatsbyJS and hosted on Netlify.
JavaScript
1
star
75

resin-caddy

Caddy Docker container
JavaScript
1
star
76

autohat-resin-jenkins

Resin application to manage AutoHAT rack
Shell
1
star
77

fleetops-appmigrate

(Experimental) migrate balenaOS devices between apps while migrating volume data
Shell
1
star
78

etcher-homepage-staging

JavaScript
1
star
79

autohat-configurator

A resin application that allows to configure an autohat for a specific device type testing
JavaScript
1
star