CambrionixDevelopers
Cambrionix CLI

Cambrionix CLI

Install the command-line tool that enrolls computers, controls hubs and collects support bundles.

cambrionix-cli runs on a computer that has the Cambrionix Connect Suite installed. It talks to the local services on that computer and, when you sign in, to Connect itself. Use it to:

  • Enroll a computer into your organisation without a browser.
  • List and control hubs, ports and devices, locally or through Connect.
  • Run premium hub actions, such as DFU on every port or a target charge level, within your permissions.
  • Restart, stop and update the local services.
  • Read logs and collect a redacted support bundle.

Install

Install links are issued by Connect to signed-in users. In Connect, open Computers → Add a computer → Headless enrollment and choose Create enrollment command. You get one command for macOS and Linux, or for Windows PowerShell, that installs the CLI and enrolls the computer. Its link and code work for 15 minutes.

The installer puts the binary in ~/.local/bin (or $XDG_BIN_HOME) and adds that directory to your PATH. Open a new terminal afterwards, or run the binary by its full path.

PlatformArchitectures
Linuxx86-64, 64-bit Arm (Raspberry Pi 4 and 5)
macOSApple silicon, Intel
Windowsx86-64

First commands

cambrionix-cli status          # this computer, its services, its organisation and its hubs
cambrionix-cli doctor          # diagnostic checks with suggested fixes
cambrionix-cli hubs list
cambrionix-cli ports list HUB-1234
cambrionix-cli --help          # every command; add --help to any command for its options

Run cambrionix-cli with no arguments for a short list of commands, and cambrionix-cli tui for the interactive enrollment screen.

Output and scripting

Every command prints a table by default and JSON with --json (or -o json). JSON is the API object itself, so you can pipe it to jq:

cambrionix-cli hubs list --json | jq -r '.[].serialNumber'

Commands never prompt when standard input isn't a terminal. A command that would ask for confirmation, such as hubs reboot or ports dfu … all, fails with exit code 2 instead, unless you pass --yes.

Exit codeMeaning
0Success
1Unexpected error
2Usage error, or a confirmation was needed without --yes
3A local service isn't reachable
4Not signed in, permission denied, or the hub's licence lacks the feature
5Not found (hub, port, device, computer)
6Partial success: a doctor check or a support bundle collector failed
7The computer is offline or didn't answer in time (through Connect)

Global options

OptionEffect
--json, -o jsonJSON output
--yes, -yAnswer yes to confirmations
--no-inputNever prompt
--profile <name>Use a named profile from the config file
--connect-url <url>Use another Connect deployment
--local-url <service>=<url>Reach a local service at another address, e.g. hub=http://lab:43424
--identity auto|user|computerWhich credentials local hub calls use (see sign-in)
--timeout <seconds>Request timeout (default 10)
--verbose, -vPrint requests to standard error
--no-colorPlain output (NO_COLOR also works)

Configuration

Settings live in config.toml in the CLI's config directory; cambrionix-cli config path prints where. Profiles hold a Connect URL, a default organisation and local service addresses:

default_profile = "lab"

[profiles.lab]
connect_url = "https://connect.cambrionix.com"

[profiles.lab.local]
hub = "http://10.0.0.5:43424"

Change settings with cambrionix-cli config set profiles.lab.connect_url <url>. Environment variables override the file: CAMBRIONIX_PROFILE, CAMBRIONIX_CONNECT_URL, CAMBRIONIX_ORG and CAMBRIONIX_TOKEN.

Updating and shell completion

cambrionix-cli self-update             # latest version
cambrionix-cli self-update --to 0.2.0  # a specific version
cambrionix-cli completion bash | sudo tee /etc/bash_completion.d/cambrionix-cli

completion supports bash, zsh, fish, elvish and PowerShell.