balena-cli/README.md
Paulo Castro 2ad0b60aeb Unify the CLI instructions between capitanodoc.ts and README.md, move
the installation instructions to INSTALL.md, and update the markdown
generation scripts.

Change-type: minor
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-04-29 14:27:32 +01:00

5.2 KiB

balena CLI

The official balena CLI tool.

npm version dependencies Gitter

About

The balena CLI (Command-Line Interface) allows you to interact with the balenaCloud and the balena API through a terminal window on Linux, MacOS or Windows. You can also write shell scripts around it, or import its Node.js modules to use it programmatically. As an open-source project on GitHub, your contribution is also welcome!

Installation

Check the balena CLI installation instructions on GitHub.

Getting Started

Choosing a shell (command prompt/terminal)

On Linux and MacOS, bash is the standard and recommended shell for use with the balena CLI.

bash command auto completion
bash command auto completion can be enabled by copying the balena-completion.bash file to the default bash completions directory (usually /etc/bash_completion.d/), or by appending it to ~/.bash_completion.

On Windows, we support the standard Windows Command Prompt (cmd.exe) and the Windows PowerShell. We are aware of users also having a good experience with alternative shells, including:

Logging in

Several CLI commands require access to your balenaCloud account, for example in order to push a new release to your app. 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 order of preference:

  • Set the `BALENARC_PROXY` environment variable in URL format (with protocol, host, port, and optionally basic auth).
  • Alternatively, use the balena config file (project-specific or user-level) and set the `proxy` setting. It can be:
  • Alternatively, set the conventional `https_proxy` / `HTTPS_PROXY` / `http_proxy` / `HTTP_PROXY` environment variable (in the same standard URL format).

To get a proxy to work with the balena ssh command, check the installation instructions.

Command reference documentation

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

Support, FAQ and troubleshooting

If you come across any problems or would like to get in touch:

Contributing

The balena CLI is an open source project and your contribution is welcome!

The CLI was originally written in CoffeeScript, but we have decided to migrate to TypeScript in order to take advantage of static typing and formal programming interfaces. The migration is taking place gradually, as part of maintenance work or the implementation of new features.

After cloning this repository and running npm install you can build the CLI using npm run build. You can then run the generated build using ./bin/balena. In order to ease development:

  • you can build the CLI using the npm run build:fast variant which skips some of the build steps or
  • you can use ./bin/balena-dev which live transpiles the sources of the CLI.

In either case, before opening a PR be sure to also test your changes with npm test.

Note on editing this README document

This file is edited/created by hand, but it is then automatically parsed to extract selected subsections for the CLI's web documentation page. The code that parses this file is in automation/capitanodoc/capitanodoc.ts .

License

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