Skip to content

CLI

The System Bridge CLI provides commands to interact with the System Bridge backend. Most commands live under the system-bridge client subcommand, while backend, tui, version and completions are top-level commands.

The token is essential to connect to the API/WebSocket. To get it, run the following command:

Terminal window
system-bridge client token

Alternatively, you can find your token in the application startup logs when running the backend. The logs will show “Your API token is” followed by your token value.

To send a notification, use the following command:

Terminal window
system-bridge client notification --title "Title" --message "Message" --icon "icon-name"

Available flags:

  • --title: The title of the notification (default: “System Bridge”)
  • --message: The message of the notification (default: “Hello, world!”)
  • --icon: The icon of the notification (default: “system-bridge”)
  • --sound: Path to a sound file to play with the notification (Linux only)
  • --action-url: URL to open when the notification is clicked (Linux only)
  • --action-path: File/folder path to open when the notification is clicked (Linux only)

To list discovered services on the network, run:

Terminal window
system-bridge client discovery list

This will scan for available System Bridge instances and display them with their hostname, IP, port, and type.

To list all available data modules, run:

Terminal window
system-bridge client data list

By default, this outputs as a simple list. You can also use:

Terminal window
system-bridge client data list --json

To output as a JSON array.

Available flags:

  • --json: Output as a JSON array
  • --table: Output as a table (default)

To run a specific data module and get its data as JSON, use:

Terminal window
system-bridge client data run --module cpu

For example, to get CPU data:

Terminal window
system-bridge client data run --module cpu

To run all modules and get a JSON object with all data:

Terminal window
system-bridge client data run --all

To pretty-print the JSON output:

Terminal window
system-bridge client data run --module cpu --pretty

Available flags:

  • --module or -m: Module name (e.g., cpu, memory)
  • --all: Run all modules
  • --pretty: Pretty-print JSON output

To run the backend server, use:

Terminal window
system-bridge backend

Add --open-web-client to open the web client once the backend has started:

Terminal window
system-bridge backend --open-web-client

See Running for autostart and service setup.

To get the version of System Bridge, run:

Terminal window
system-bridge version

System Bridge can generate shell completion scripts for the CLI, so you get tab-completion of commands, flags and data module names.

On Linux, the DEB, RPM and Arch packages install completions for bash, zsh and fish automatically. Start a new shell after installing and completion works with no extra setup.

To enable completions yourself, or on another shell, generate a script with:

Terminal window
system-bridge completions <shell>

Supported shells are bash, zsh, fish and pwsh (PowerShell). Source the output to load completion into your shell:

Terminal window
# bash (~/.bashrc)
source <(system-bridge completions bash)
# zsh (~/.zshrc)
source <(system-bridge completions zsh)
# fish
system-bridge completions fish > ~/.config/fish/completions/system-bridge.fish

On PowerShell, load it in the current session, and add the same line to your profile to make it persist:

Terminal window
system-bridge completions pwsh | Out-String | Invoke-Expression