CambrionixDevelopers
Cambrionix CLI

Command reference

Every Cambrionix CLI command, grouped by what it works on.

Add --help to any command for its full options, for example cambrionix-cli ports dfu --help. Commands marked premium need a licensed hub feature; see Sign-in and premium actions. Hub, port and device commands use the local Hub API unless you add --cloud or --computer <id or name>.

This computer

CommandWhat it does
enroll [--code <code>]Add this computer to an organisation (--name, --replace, --no-browser)
unenroll [--from <org>]Remove this computer from its organisation
statusOne-screen summary: computer, organisation, services, Connect, hubs
doctor [--check <id>]Diagnostic checks with suggested fixes; --fix applies safe fixes

Doctor checks

IDCheck
CBX001Each local service responds
CBX002Connect is reachable (reports the proxy in use)
CBX003The computer is enrolled, and Connect lists it when you are signed in
CBX004The clock is within 60 seconds of Connect's
CBX005The services report no errors
CBX006USB host controllers' endpoint use
CBX007The log directory's disk has free space
CBX008The services' ports belong to Cambrionix services
CBX009CLI sign-in status
CBX010Hub commands can use this computer's enrollment instead of your sign-in

doctor --fix restarts services that don't respond. It exits with code 6 when a check fails.

Services

The local services are relay (port 43420), hub (43424), recorder (43426) and device (43430).

CommandWhat it does
services listEach service's status, version and uptime
services show <service>A service's details: version, directories, capabilities
services config get <service> [key]A service's configuration, or one key
services config set <service> <key> <value>Change one configuration key
services errors [<service>]Errors the services report
services restart <service>… | --allRestart, then wait until the service answers again
services shutdown <service>… | --allStop through the OS service manager (alias stop)
services start <service>… | --allStart through the OS service manager
services update check|apply|statusCheck for, install and follow Hub API updates

restart uses the service's own restart endpoint when it has one, otherwise systemd, launchd or the Windows service manager (--os always uses the service manager). shutdown and start need administrator rights. If the CLI can't find a service's name in the service manager, set CAMBRIONIX_SERVICE_HUB (or _RELAY, _RECORDER, _DEVICE) to it.

Hubs

CommandWhat it does
hubs list [--watch]Hubs on this computer; with --cloud, the organisation's hubs
hubs show <hub>One hub's state and ports
hubs reboot <hub>Reboot a hub
hubs settings get|set|reset <hub>Hub settings
hubs power show|save|revert <hub>Power limits and power setup (premium)
hubs firmware status <hub>Firmware version
hubs firmware update <hub>Install the latest firmware, through Connect

Ports

<port> is a port number or all.

CommandWhat it does
ports list <hub>Mode, attached device, battery, current and schedule per port
ports mode <hub> <port> on|off|detect|chargeSet port mode (on is charge and data)
ports led <hub> <port> <colour> [--pattern p]LED colour and flash pattern
ports lock|unlock <hub> <port>Lock a port
ports power-limit <hub> <port> <watts>Power delivery limit, 4.5–60 W (premium)
ports charge <hub> <percent> [--then off|trickle]Charge every port to a target level (premium)
ports dfu <hub> <port>Put Apple devices into DFU mode (premium)
ports reboot-device <hub> <port>Reboot Apple devices (premium)
ports schedule show|set|clear|options …Port mode schedules (premium to change)

A schedule is a JSON array, inline or from a file with @schedule.json:

cambrionix-cli ports schedule set HUB-1234 all \
  '[{"time":"08:00","days":["mon","tue","wed","thu","fri"],"action":{"mode":"on"}},
    {"time":"18:00","days":["mon","tue","wed","thu","fri"],"action":{"mode":"target","target":80}}]'

Devices and USB

CommandWhat it does
devices list [--hub <hub>]Attached devices, optionally on one hub (--watch)
devices show <id>One device
devices lock|unlock <id>Lock a device
usb endpointsEndpoint and memory use per USB host controller

Logs and support

CommandWhat it does
logs list [-s <service>]Log files per service
logs show [-s …] [--level] [--grep] [--since]Recent lines, merged across services in time order
logs tail [-f]The latest lines; -f keeps following
support bundle [options]Collect a redacted support bundle; see Support bundles
support inspect <bundle.zip>Print a bundle's summary (--json for its manifest)
support upload <bundle.zip> [--case <id>]Upload a bundle to Cambrionix support

Connect

CommandWhat it does
login [--no-browser]Sign in; --token stores an existing access token instead
logoutSign out
whoamiOrganisation, permissions and the premium actions they allow
org list / org use <id>Organisations you belong to; switch by signing in again
computers list / show <id>Computers in your organisation

Everything else

CommandWhat it does
api <method> <path> [--service s | --cloud] [-d json]Raw request to a local service or to Connect
config get|set|list|pathCLI settings and profiles
completion <shell>Shell completion script
self-update [--to <version>]Update the CLI
versionThe CLI's version
tuiThe interactive enrollment screen

api is for anything without its own command. Local paths start with /api/v1; Connect paths are relative to https://connect.cambrionix.com/api:

cambrionix-cli api GET /api/v1/hubs/HUB-1234/hardware
cambrionix-cli api GET /hardware/v1/hubs --cloud