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> --helpcapability 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.
--profilesets the target device for a single command.profile set-defaultsets 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 setrejects a second profile for a device that is already registered. Use the existing profile listed byprofile list, or remove it withprofile 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
doneConfiguration 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_TOKENtakes 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 withCYBRAVE_CLI_BASE_URL.- The CLI never assumes confirmation. Pass the confirmation flag that
capability getreports for the command. Without it, a command that takes--yesfails immediately. A command that takes--confirm-base-urlprompts 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 variable | Purpose |
|---|---|
CYBRAVE_CLI_BASE_URL | Address of the target device |
CYBRAVE_CLI_TOKEN | Access token. Takes precedence over a stored credential |
CYBRAVE_CLI_CONFIG_FILE | Path of the configuration file. The default is ~/.cybrave-cli/config.yaml |
CYBRAVE_CLI_CREDENTIAL_STORE | Credential 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 installOn Windows, add completion to your PowerShell profile:
cybrave-cli.exe completion powershell >> $PROFILECommand 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.code | Exit code | Meaning |
|---|---|---|
BAD_INPUT | 2 | A flag, a request body, or a confirmation flag is missing or invalid |
AUTH_REQUIRED | 3 | The credential is missing or expired |
SCOPE_DENIED | 4 | The credential lacks the required permission |
CONFLICT | 5 | The request conflicts with the current state of the device |
NOT_FOUND | 5 | The addressed resource does not exist. An empty list is a success |
STEP_UP_REQUIRED | 6 | The device requires operation confirmation |
STEP_UP_REJECTED | 6 | The device rejected the operation confirmation |
SERVER_VALIDATION | 7 | The device rejected the request |
NETWORK | 8 | A read failed, or the device returned a retryable status |
DEFINITELY_NOT_SENT | 8 | The write request was not sent |
UNKNOWN_OUTCOME | 8 | The write might have been applied |
INTERRUPTED | 8 | The command was interrupted |
VERSION_INCOMPATIBLE | 9 | The device does not offer the operation |
INTERNAL | 10 | An 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:
- Remove the stored credentials before you delete the binary:
cybrave-cli auth logout --all-local --yes. - Delete the
cybrave-clifolder from the skill directory of each agent, for example~/.claude/skillsor~/.agents/skills. - Delete the binary, for example
~/.local/bin/cybrave-cli. - 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.
| Symptom | Cause | Action |
|---|---|---|
BAD_INPUT, unknown profile | The profile name is not in ~/.cybrave-cli/config.yaml | Run cybrave-cli profile list and use a listed name |
BAD_INPUT, device already registered as another profile | A device can have only one profile | Use the existing profile, or delete it with cybrave-cli profile delete |
doctor reports tls as WARN: certificate not verified | The profile sets insecure, which takes precedence over a CA certificate | Run 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 unusable | The CLI accepts the CA-verified connection without asking and keeps the old record | Check whether the device certificate was replaced, then run cybrave-cli auth trust forget --yes |
doctor reports clock as WARN | The local clock differs from the device clock | Synchronize the clock on your computer or on the device |
doctor reports operations as WARN | The device does not offer an operation this CLI calls | Upgrade the CLI or Cybrave OS to matching releases |
UNKNOWN_OUTCOME | The request was sent, but the result is unknown | Do not retry the write. First check config pending-changes and config published-commits |
Known limitations
The following limitations apply to the current release.
| Limitation | Details | Workaround |
|---|---|---|
| Some commands require a newer Cybrave OS release | A command fails with VERSION_INCOMPATIBLE (exit code 9) when the device does not offer its operation. cybrave-cli doctor lists the missing operations | Upgrade Cybrave OS, or use the Web UI |
| The compatibility check covers operations only | cybrave-cli doctor does not detect renamed actions or data nodes | Keep the CLI and Cybrave OS on matching releases |
| Default security rules are read-only | policy security-default-rule provides only list and get | Change default rules in the Web UI |
| Sign-out is local only | cybrave-cli auth logout deletes only the local credential. The token or session remains valid on the device | Run cybrave-cli auth access-token revoke or cybrave-cli auth session revoke before you sign out |
| Credential storage varies by platform | Headless Linux has no credential store. On Windows, the optional file backend stores the credential in plaintext | On headless Linux, set CYBRAVE_CLI_CREDENTIAL_STORE=file or use CYBRAVE_CLI_TOKEN. On Windows, use the default backend |