Skip to content
Databasezy

CLI

Every database, one command away

zb covers instances, backups, migrations, teams, approvals, API keys and usage. Every command accepts --json for scripts, and zb connect opens the engine's own shell with a one-time credential that never touches disk.

CLI, step by step

  1. Step 01

    Log in

    Save an API key (and optionally a default org and project) in your OS config directory with zb login.

  2. Step 02

    Create

    zb instances create picks an engine, size and placement, and --wait returns when the instance is ready.

  3. Step 03

    Connect

    zb connect starts psql, mysql, valkey-cli or mongosh over TLS with a one-time credential.

  4. Step 04

    Automate

    Add --json for machine-readable output, -y to skip prompts in CI, and zb api for any endpoint the CLI does not wrap yet.

What you get

  • Credentials stay out of history

    zb connect passes the credential through the client's environment where it can, never to disk or shell history.

  • Backups and restores

    List, create and restore backups, read the PITR window and tune backup settings within your plan.

  • Migrations

    zb migrate runs preflight, copy, verify, sync and cutover, with --dry-run to see the plan first.

  • Usage and cost reports

    zb usage groups spend by team, cost centre, instance or meter, with CSV output. zb cost-report gives the monthly allocation.

  • Teams and approvals

    Manage members, teams, budgets and approval requests without opening the portal.

  • Raw API access

    zb api GET /v1/sizes calls the REST API with your saved credentials; {org} is filled in for you.

Try it

shell
zb login
zb instances create --engine postgres --size s1 --name orders --wait
zb connect inst_7f3k                      # psql over TLS, one-time credential
zb backups list inst_7f3k
zb usage --by instance --csv > usage.csv
zb completion zsh > ~/.zfunc/_zb         # bash, zsh, fish, powershell, elvish

Plan availability

Generated from the same plan catalogue that billing and the API use.

  • Free

    $0 /mo
    Included

    All commands, within your plan's limits

  • Solo

    $25 /mo
    Included

    All commands, within your plan's limits

  • Team

    $599 /mo
    Included

    All commands, within your plan's limits

  • Enterprise

    Custom
    Included

    All commands, within your plan's limits

The CLI uses the same org-scoped, role-checked API as the portal, so it can do exactly what your role allows.

Compare every plan on the pricing page

Questions

How does the CLI authenticate?

With an org-scoped API key saved by zb login, or the ZB_API_KEY environment variable in CI. A key inherits the intersection of its owner's role and its scopes.

Can I use it in scripts?

Yes. Every command accepts --json, -y skips confirmations (never the typed name for erase or an in-place restore), and exit codes are stable.

Is the reference up to date?

The reference page is generated from the CLI binary itself with zb docs, so it always matches the commands that exist.

Create your first database

A free instance, no card. Upgrade when you outgrow it; nothing converts silently.