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.
How it works
CLI, step by step
- Step 01
Log in
Save an API key (and optionally a default org and project) in your OS config directory with zb login.
- Step 02
Create
zb instances create picks an engine, size and placement, and --wait returns when the instance is ready.
- Step 03
Connect
zb connect starts psql, mysql, valkey-cli or mongosh over TLS with a one-time credential.
- 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
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, elvishPlan availability
Generated from the same plan catalogue that billing and the API use.
- Included
Free
$0 /moAll commands, within your plan's limits
- Included
Solo
$25 /moAll commands, within your plan's limits
- Included
Team
$599 /moAll commands, within your plan's limits
- Included
Enterprise
CustomAll 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.
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.
Related features
-
API and MCP
A REST API with an OpenAPI 3.1 document, signed webhooks, an MCP server for AI assistants and llms.txt.
Learn more about API and MCP -
Backups and PITR
Scheduled backups to object storage, point-in-time recovery where the engine supports it, and restores rehearsed every week.
Learn more about Backups and PITR -
Migrations
Move a database in from another provider, a server, your laptop or a file, verified before cutover.
Learn more about Migrations
Start today
Create your first database
A free instance, no card. Upgrade when you outgrow it; nothing converts silently.