How to Use bzCLI
  • 06 May 2026
  • Dark
    Light

How to Use bzCLI

  • Dark
    Light

Article summary

bzCLI is a cross-platform tool designed to enable Remote Monitoring and Management (RMM) systems to configure and administer the Backblaze Backup Client. It provides enterprise IT administrators with the ability to remotely manage backup configurations on client computers without requiring direct user interaction.

The tool follows a Git-style command syntax, offering an intuitive interface with named arguments instead of position-based parameters, making it easier to use correctly and debug when issues arise.

Installation

No separate installation of bzCLI is required. The tool is installed automatically as part of the Backup Client installation.

Installation Paths

Platform

Location

macOS

/Applications/Backblaze.app/Contents/MacOS/bzcli

Windows

C:\Program Files\Backblaze\bzcli.exe

Command Syntax

Two primary syntax forms are supported:

Global Options

bzcli [-h|--help] [-v|--version] [--verbose]

Each option begins with a hyphen (-) for short form or double hyphen (--) for long form.

Option

Description

-h, --help

Print help message.

-v, --version

Print the program version.

--verbose

Print extra debugging information to stderr.

Command Execution

bzcli <command> [<args>]

Where command specifies the operation to perform, followed by optional arguments.

Output and Exit Status

Non-error results are printed to stdout. If an error occurs, bzCLI prints details about the error to stderr. The utility returns 0 on success, or a non-zero value on error.

Commands

action

Causes the backup software to perform a single operation. Only one operation is allowed per command invocation; to run multiple operations, invoke bzcli more than once.

Syntax

bzcli action [--group <groupid:grouptoken>] --<operation> [arguments...]

Options

Option

Description

--group <groupid:grouptoken>

Authenticate using a group ID and group token. Required for PEK operations.

--backup-now

Start a backup immediately if one is not already in progress. Does not require authentication.

--pause-backup

Pause a running backup. Does not require authentication.

--set-pek

Set a new Private Encryption Key (PEK) for a backup that does not already have one. Accepts one argument: the new PEK. Requires authentication.

--clear-pek

Clear the existing PEK. Accepts one argument: the current PEK. Requires authentication.

--change-pek

Change an existing PEK. Accepts two arguments: the old PEK, followed by the new PEK. Requires authentication.

Account Authentication

Some action operations require account authentication to prevent unauthorized changes. Provide a group ID and group token separated by a colon:

bzcli action --group groupid:grouptoken --operation [arguments...]

This example shows how to set a PEK using group authentication:

bzcli action --group 27194:c24a998252466cb --set-pek foobar

Private Encryption Key (PEK) Operations

A PEK provides an additional layer of security for backed-up data. When a PEK is set, it is impossible to access backup data without it. If you forget a PEK, Backblaze cannot reset it or recover your data.

To check whether a backup already has a PEK set, run:

bzcli report -v /backup/installation/has_pek

This command returns true or false.

Note

If the Backup Client is actively backing up when you attempt to change the PEK, bzcli may be unable to complete the operation. To avoid this, pause backup first, change the PEK, then resume with --backup-now.

configure

Updates the configuration of Backblaze's backup software using key-value pairs to specify what to change.

Syntax

bzcli configure [-j|--json <filepath>] [--json-example] [-p|--print] [-v|--value <key=val>]

Options

Option

Description

-j, --json <filepath>

Apply one or more configuration changes from a JSON input file.

--json-example

Print a sample JSON configuration file.

-p, --print

Print the updated configuration without actually applying the changes.

-v, --value <key=val>

Apply a single configuration change as a key=value pair.

Input Methods

There are two ways to specify configuration changes:

  • Single value: Use -v or --value with a key=value argument. For example, to change the computer name:

    bzcli configure -v online_hostname=MyNewComputerName
  • JSON file: Use -j or --json to apply one or more changes from a JSON input file. Use --json-example to print a sample file.

Operation

The configure command validates and parses the input, reads the current bzinfo.xml configuration file, applies the specified settings, and writes the updated configuration back to bzinfo.xml. Unrecognized configuration keys are silently ignored.

Exit Status

Code

Meaning

0

No fatal errors were encountered.

< 0

One or more fatal errors were encountered (for example, malformed input).

report

Prints information about Backblaze's backup software and status. Reports any problems analyzing backup status to stderr.

Syntax

bzcli report [--exit-on-error] [-f|--format <format>] [-v|--value <query>]

Options

Option

Description

--exit-on-error

Treat all errors as fatal and return a non-zero exit code. By default, many problems (such as malformed XML data) are nonfatal and only reported to stderr.

-f, --format <format>

Output format: json (pretty-printed) or minijson (minified, all on one line). Defaults to json.

-v, --value <query>

Report only a single value using a slash-delimited query path into the JSON report.

Output Format

Reports are output to stdout in JSON format. Two formats are supported:

  • json — Pretty-printed JSON with line breaks and indentation (default).

  • minijson — Minified JSON, all on one line with whitespace omitted.

Timestamps

Reports include timestamps in two formats:

  • gmt_millis — Number of non-leap milliseconds since the Unix epoch (00:00:00 UTC, 1 January 1970).

  • gmt_time — UTC time in YYYYMMDDhhmmss format.

Timestamps may also be the string none when a value is not applicable. For example, if license renewal has never failed, the renewal failure time is none.

Querying Single Values

Use the -v or --value option with a slash-delimited query path to retrieve a specific value from the report:

bzcli report -v /backup/account/email

If the query resolves to a JSON object or array rather than a scalar value, the full matching element is printed. For more advanced querying (such as extracting individual values from arrays), pipe the full JSON output to a tool like jq.

Examples


# Get the account email address
bzcli report -v /backup/account/email

# Check whether a PEK is set
bzcli report -v /backup/installation/has_pek

# Get the full report in minified JSON
bzcli report --format minijson

Configuration Settings Reference

The following settings can be configured using the configure command, either via the -v flag or a JSON input file.

Backup Settings

Key

Description

backup_on_battery

Whether to back up when on battery power.

backup_schedule_type

When to back up. Allowed values: continuously, when_files_change, once_per_day, only_when_click_backup_now.

backup_schedule_detail

When using once_per_day, the hour of the day to start the backup (for example, 13 for 1 PM).

backup_schedule_end_hour

When using once_per_day, the hour to stop backing up. Set to none to continue until finished.

max_filesize_mb

Do not back up files larger than this many MB.

net_auto_throttle

true lets the backup software automatically manage its network bandwidth.

net_throttle

For manual throttle, each thread will use up to this many Mbps.

num_backup_threads

Use up to this many threads (background processes) for backup.

File Exclusion Settings

Key

Description

excludefiletypes_add

Exclude files with these extensions from backup.

excludefiletypes_remove

Remove a file extension from the exclusion list.

excludefiletypes_restore_defaults

Reset the list of excluded file extensions to defaults.

bzdirfilter_add

Exclude files from these directories from backup.

bzdirfilter_remove

Remove a directory from the exclusion list.

bzdirfilter_restore_defaults

Reset the list of excluded directories to defaults.

Identity and Preferences

Key

Description

online_hostname

The name this computer uses when backing up. Supports %HOSTNAME% and %DATETIME% substitution tokens.

allow_network_tests

Allow network connectivity tests.

numdays_warn_if_no_backup

Warn if the computer has not backed up for this many days.

show_help_tips

Show or hide help tips.

suppress_notification

Do not display notifications to the user.

Administrative Lock Settings

Key

Description

lock_schedule

Prevent users from changing the backup schedule in the GUI.

lock_exclusion

Prevent users from changing exclusion settings in the GUI.

lock_PEK

Prevent users from changing the private encryption key in the GUI.

Network Settings

Key

Description

blocked_networks_add

Add a network/MAC address pair to the network block list. Backup will not run when connected to a blocked network.

blocked_networks_remove

Remove a network/MAC address pair from the block list.

blocked_networks_clear

Clear the entire network block list.

Note

To block a network, you must specify both the network name and the MAC address of the associated network interface. If a computer has multiple network interfaces, fully blocking a network requires a separate block list entry for each interface.

Example JSON Configuration File

Run bzcli configure --json-example to print a full sample. The following is an abbreviated example:

{
        "settings": {
        "online_hostname": "MyComputerName",
        "backup_schedule_type": "continuously",
        "num_backup_threads": 8,
        "net_auto_throttle": true,
        "excludefiletypes_add": [
        {
        "ext": "xxx"
        },
        {
        "ext": "yyy"
        }
        ],
        "blocked_networks_add": [
        {
        "blocked_network_name": "CafeWifi",
        "blocked_network_mac_addr": "10:c4:ca:69:66:64"
        }
        ],
        "lock_schedule": true
        }
        }

Error Handling

Descriptive error messages are provided to help administrators diagnose and resolve issues. Common error scenarios include:

  • Invalid or malformed JSON configuration file

  • Missing or inaccessible configuration files

  • Insufficient permissions to modify settings

  • Unrecognized configuration keys (these are silently ignored)

Platform Notes

Unicode Support

Unicode is fully supported in command-line arguments. On macOS, arguments are interpreted as UTF-8. On Windows, the tool uses the wmain() entry point to accept UTF-16LE encoded arguments, which are automatically converted to UTF-8 for internal processing.

RMM Integration

bzCLI is designed for integration with enterprise RMM systems. These systems typically invoke bzcli through shell scripts to automate backup configuration across managed devices.

Platform

Supported RMM Systems

macOS

Jamf, Kandji, Addigy

Windows

Microsoft Intune


Was this article helpful?