Skip to Content
Cybrave OS

CLI Reference

Command discovery, profiles, scripting, exit codes, upgrades, and troubleshooting.

For installation and your first device connection, start with the CLI Quickstart.

Common tasks

Discover commands

The CLI provides the schema of each command at run time:

cybrave-cli capability list
cybrave-cli capability get <command>
cybrave-cli <command> --help

capability get returns the schema of a command: its flags, request body, effect, and required confirmation.

Manage multiple devices

A single installation can manage multiple devices. Create a profile for each device, and authenticate with an access token issued by that device:

cybrave-cli profile set branch --base-url https://10.0.1.1
cybrave-cli auth login --with-token --profile branch < branch-token.txt
cybrave-cli profile list
cybrave-cli doctor --profile branch
cybrave-cli profile set-default edge
  • Device selection. --profile sets the target device for a single command. profile set-default sets the default device for commands that do not specify one.
  • Credential isolation. Each profile has its own stored credential. A stored credential is bound to its device and is never sent to another device.
  • One profile per device. profile set rejects a second profile for a device that is already registered. Use the existing profile listed by profile list, or remove it with profile delete.
  • Target confirmation. A commit or a destructive action must repeat the device address in --confirm-base-url. This prevents the command from reaching an unintended device.

To run the same read operation on every device, iterate over the profiles:

for p in edge branch; do
  cybrave-cli device overview get --profile "$p" --format json
done

Configuration changes are saved, reviewed, and committed on each device separately.

Use in scripts and CI

Scripts, scheduled jobs, CI pipelines, and AI agents run without an operator to answer prompts. Provide the device, the credential, and the output format in advance.

export CYBRAVE_CLI_BASE_URL=https://10.0.0.1
export CYBRAVE_CLI_TOKEN="$TOKEN_FROM_A_PROTECTED_SECRET"
cybrave-cli doctor --format json
  • Retrieve the token from a secret store. Do not embed it in the script.
  • CYBRAVE_CLI_TOKEN takes precedence over a stored credential and is not bound to a device. The CLI sends it to whichever device the command targets, so always set it together with CYBRAVE_CLI_BASE_URL.
  • The CLI never assumes confirmation. Pass the confirmation flag that capability get reports for the command. Without it, a command that takes --yes fails immediately. A command that takes --confirm-base-url prompts on the terminal for up to two minutes, even when standard input is a pipe, and fails immediately only when no terminal is available.
  • For unattended runs, pin the certificate fingerprint in the profile in advance with cybrave-cli profile set <profile> --trust-fingerprint <sha256>.
Environment variablePurpose
CYBRAVE_CLI_BASE_URLAddress of the target device
CYBRAVE_CLI_TOKENAccess token. Takes precedence over a stored credential
CYBRAVE_CLI_CONFIG_FILEPath of the configuration file. The default is ~/.cybrave-cli/config.yaml
CYBRAVE_CLI_CREDENTIAL_STORECredential backend: auto, keyring, or file

Shell completion

Shell completion is optional. On macOS and Linux, install completion for bash, zsh, or fish:

cybrave-cli completion install

On Windows, add completion to your PowerShell profile:

cybrave-cli.exe completion powershell >> $PROFILE

Command output and CLI maintenance

Output and exit codes

In a terminal, the default output format is a table. In a pipe, the default output format is JSON. To select a format explicitly, use --format with json, yaml, table, or csv.

A successful command exits with code 0. A failed command returns ok: false, a stable error.code, and the exit code listed in the following table. Several error codes share an exit code, so base decisions on error.code.

error.codeExit codeMeaning
BAD_INPUT2A flag, a request body, or a confirmation flag is missing or invalid
AUTH_REQUIRED3The credential is missing or expired
SCOPE_DENIED4The credential lacks the required permission
CONFLICT5The request conflicts with the current state of the device
NOT_FOUND5The addressed resource does not exist. An empty list is a success
STEP_UP_REQUIRED6The device requires operation confirmation
STEP_UP_REJECTED6The device rejected the operation confirmation
SERVER_VALIDATION7The device rejected the request
NETWORK8A read failed, or the device returned a retryable status
DEFINITELY_NOT_SENT8The write request was not sent
UNKNOWN_OUTCOME8The write might have been applied
INTERRUPTED8The command was interrupted
VERSION_INCOMPATIBLE9The device does not offer the operation
INTERNAL10An internal CLI error

Exit code 8 does not indicate that a write is safe to retry. Only DEFINITELY_NOT_SENT confirms that a write did not reach the device.

Upgrade and uninstall

To upgrade, run the installation command again.

To uninstall the CLI:

  1. Remove the stored credentials before you delete the binary: cybrave-cli auth logout --all-local --yes.
  2. Delete the cybrave-cli folder from the skill directory of each agent, for example ~/.claude/skills or ~/.agents/skills.
  3. Delete the binary, for example ~/.local/bin/cybrave-cli.
  4. Delete the configuration folder ~/.cybrave-cli/.

Deleting local files does not end a session on the device.

Troubleshooting

Run cybrave-cli doctor first. When a command fails, read error.code rather than the message text, and follow error.actions if the output provides them.

SymptomCauseAction
BAD_INPUT, unknown profileThe profile name is not in ~/.cybrave-cli/config.yamlRun cybrave-cli profile list and use a listed name
BAD_INPUT, device already registered as another profileA device can have only one profileUse the existing profile, or delete it with cybrave-cli profile delete
doctor reports tls as WARN: certificate not verifiedThe profile sets insecure, which takes precedence over a CA certificateRun cybrave-cli profile set <profile> --insecure=false --ca-cert <file>, or delete the profile and create it again
doctor reports tls as WARN: verified by a CA but not the confirmed certificate, or the trust record is unusableThe CLI accepts the CA-verified connection without asking and keeps the old recordCheck whether the device certificate was replaced, then run cybrave-cli auth trust forget --yes
doctor reports clock as WARNThe local clock differs from the device clockSynchronize the clock on your computer or on the device
doctor reports operations as WARNThe device does not offer an operation this CLI callsUpgrade the CLI or Cybrave OS to matching releases
UNKNOWN_OUTCOMEThe request was sent, but the result is unknownDo not retry the write. First check config pending-changes and config published-commits

Known limitations

The following limitations apply to the current release.

LimitationDetailsWorkaround
Some commands require a newer Cybrave OS releaseA command fails with VERSION_INCOMPATIBLE (exit code 9) when the device does not offer its operation. cybrave-cli doctor lists the missing operationsUpgrade Cybrave OS, or use the Web UI
The compatibility check covers operations onlycybrave-cli doctor does not detect renamed actions or data nodesKeep the CLI and Cybrave OS on matching releases
Default security rules are read-onlypolicy security-default-rule provides only list and getChange default rules in the Web UI
Sign-out is local onlycybrave-cli auth logout deletes only the local credential. The token or session remains valid on the deviceRun cybrave-cli auth access-token revoke or cybrave-cli auth session revoke before you sign out
Credential storage varies by platformHeadless Linux has no credential store. On Windows, the optional file backend stores the credential in plaintextOn headless Linux, set CYBRAVE_CLI_CREDENTIAL_STORE=file or use CYBRAVE_CLI_TOKEN. On Windows, use the default backend