Skip to content

CLI quick reference

Global flags: --config <path> (default is the packaged config.toml) and -o, --output table|json. Run db-branch <command> --help for the full list.

Command What it does
db-branch init --pool <pool> Prepare this node: ZFS datasets, ARC limit, admin password, TLS certificate. --storage <module> uses a module’s storage instead of a pool.
db-branch version Print the version.
db-branch admin reset-password Set a new random admin password for the whole cluster and end every console session.
Command What it does
base create <name> --runtime <engine@version> [--dump file.sql.gz] [--node N] Create a base and take its first snapshot.
base snapshot <name> Stop the base server cleanly and take a new snapshot.
base mask <target> --from <base> --masker <module> [--snapshot S] [--rules file] Write a masked copy of another base into an empty base and snapshot it.
base list, base show <name> List bases, or show one with its snapshots.
base start <name>, base stop <name> Start or stop the base server.
base delete <name> Delete a base that no branch uses.
base refresh set <base> --host H --port P --user U --databases a,b --every 24h Refresh from a source database on a schedule. Password via --password-stdin or an environment variable.
base refresh show|run|off <base> Show the schedule and last run, refresh now, or stop refreshing.

branch can be shortened to br.

Command What it does
branch create <name> --base <base> [--snapshot S] [--ttl 72h] [--init-sql SQL | --init-file F] [--node N] [--owner O] [--access private|open] Clone a base into a new branch.
branch list, branch show <name> List branches, or show one.
branch dsn <name> [--proxy] Print the connection URL, including the password. --proxy goes through this node’s proxy.
branch reset <name> Discard every change since the branch was created.
branch recreate <name> [--node N] Build a lost branch again on another node.
branch delete <name> Delete a branch (alias rm).
branch extend <name> <ttl> Push the expiry to now plus the ttl.

base create, base snapshot, base mask and the branch commands that change state accept --no-wait, which prints the operation ID and returns.

Command What it does
runtime available [mysql|postgres] List versions that can be installed.
runtime list List installed versions.
runtime install <engine@version> Install a version. In a cluster it goes on every node.
runtime remove <engine@version> Remove a version from every node where nothing uses it.

See Connecting to a branch.

Command What it does
route user add <user> --default <branch> Add or update a user shared by every branch. The password is read from stdin.
route user list, route user remove <user> List or remove route users.

See Clusters: cluster init, cluster token, cluster join, cluster status.

Command What it does
token create <name> [--scope branches|full] [--ttl 720h] Issue an API token for scripts and LLM agents (MCP). It is shown once.
token list, token revoke <id> List or revoke tokens.
module install <name>, module remove <name>, module list Manage modules (package db-branch-<name>) on every node.
settings list, settings set <scope> <key>=<value>... Show or change cluster-wide settings. An empty value restores the default.
backup now, backup list, backup restore <file> Back up and restore the cluster state.
update check, update status, update apply <version>, update cancel Update the cluster to a newer minor version, one node at a time.