Skip to content

The burrow CLI

One binary does three jobs:

  • Server. burrow serve, burrow migrate and burrow superuser are PocketBase's own commands, passed to the engine unchanged.
  • Client. Records, collections, files, realtime, SQL, settings, logs, backups and raw API calls against a running server, with a stored login.
  • Deploy kit. burrow up and burrow down for a local Docker stack, kind, an existing Kubernetes cluster, or AWS, GCP and Azure.

burrow --help and burrow COMMAND --help show the same information as this page.

Install

Build from a checkout (Go 1.27). go install ...@latest does not work, because the module replaces PocketBase and dbx with the forks in the repository.

git clone https://github.com/test-zeus-ai/burrowdb && cd burrowdb
go build -o bin/burrow ./cmd/burrow

Global flags and output

Flag Default
--url $BURROW_URL, then the last server you logged in to, then http://127.0.0.1:8090
--token $BURROW_TOKEN, then the stored login for that URL
-o, --output json or table; JSON when stdout is not a terminal

Output is JSON when piped, so scripts and agents can parse it.

Exit codes

Code Meaning
0 OK
1 Other error
2 Usage error (unknown command or flag, wrong arguments, a name such as ..)
3 Not authenticated or not allowed (401, 403)
4 Not found (404)
5 Conflict (409, 412), including a failed --if-updated check
6 Bad input (400)
7 Server unavailable or busy (5xx, 429, connection refused, unknown host); retry later. Also doctor when the server is not ready

Log in

BURROW_PASSWORD='...' burrow login --url http://127.0.0.1:8090 --email admin@example.com
echo "$PASSWORD" | burrow login --email admin@example.com --password-stdin
burrow login --collection users --email someone@example.com             # a user, not a superuser
burrow logout

The password comes from BURROW_PASSWORD, --password-stdin, or a no-echo prompt when run in a terminal. --email defaults to BURROW_EMAIL. The token is stored per server URL in ~/.burrow/credentials.json with mode 0600 ($BURROW_HOME/credentials.json when BURROW_HOME is set). Most commands below need a superuser.

Records

burrow records list posts --filter 'status = "open" && created > @todayStart' --sort '-created' --per-page 100
burrow records list posts --all --fields id,title          # every page
burrow records get posts RECORD_ID --expand author
burrow records create posts '{"title":"Hello"}'
burrow records create posts post.json --file cover=./cover.png
cat patch.json | burrow records update posts RECORD_ID -
burrow records update posts RECORD_ID '{"title":"New"}' --if-updated '2026-01-02 03:04:05.678Z'
burrow records delete posts RECORD_ID
  • records list: --filter, --sort, --expand, --fields, --page (1), --per-page (30, max 1000), --all. Filters use PocketBase syntax.
  • records create and update take JSON inline, a file, or - for stdin. --file field=path uploads a file (repeatable).
  • --if-updated reads the record first and refuses (exit 5) if its updated value differs. This is a client-side check, not a server-side lock: a write between the read and the update can still win.

Collections

burrow collections list
burrow collections get posts
burrow collections create collection.json
burrow collections update posts '{"listRule":""}'
burrow collections import pb_schema.json                     # create or update; the dashboard's export format
burrow collections import pb_schema.json --delete-missing    # also delete collections not in the file
burrow collections delete posts --yes                        # deletes the collection and all its records

Files

burrow files url posts RECORD_ID cover_abc.png --thumb 100x100
burrow files url posts RECORD_ID secret_abc.pdf --protected     # adds a short-lived file token
burrow files download posts RECORD_ID cover_abc.png -O cover.png

Realtime

burrow realtime watch posts                 # every record in posts
burrow realtime watch posts/RECORD_ID orders/*

Prints one JSON event per line until you stop it. Topics are COLLECTION, COLLECTION/* or COLLECTION/ID. When the stream drops, watch reconnects with backoff (up to 30 s) and prints a subscribed line again; events sent while it was disconnected are not replayed, so refetch when you see it. --once exits non-zero instead of reconnecting. Events whose data is not JSON are reported on stderr.

SQL, settings, logs and raw API calls

burrow sql 'SELECT count(*) FROM posts'         # one PostgreSQL statement, through the superuser SQL console
burrow settings get                             # secrets are masked by the server
burrow settings set '{"meta":{"appName":"My app"}}'
burrow logs --filter 'data.status >= 500' --per-page 20
burrow api GET /api/collections/posts/records -q filter='published=true'
burrow api PATCH /api/collections/posts/records/RECORD_ID '{"title":"new"}'
burrow api GET /api/health -i                   # prints {"status":N,"body":...}, exits 0 for any status

burrow api METHOD PATH [JSON|FILE|-] sends any request with the stored login, like gh api. -q k=v adds a query parameter (repeatable).

Status and doctor

burrow status
burrow doctor

status reports /api/health, /readyz, the server version from burrow_info and the number of realtime clients. doctor checks what a cluster needs and prints each check: the server is reachable and ready, you are logged in as a superuser, files are on S3, SMTP is set, scheduled backups are on, backups go to S3, and the app URL is not localhost. It exits 7 when the server is unreachable or not ready; the other checks are advice and do not change the exit code.

Backups

burrow backup create                         # name chosen by the server
burrow backup create before-upgrade.zip
burrow backup list
burrow backup download before-upgrade.zip -O before-upgrade.zip
burrow backup upload before-upgrade.zip
burrow backup restore before-upgrade.zip --yes
burrow backup delete before-upgrade.zip --yes

See Operations for what a backup holds and how restore works.

Moving data

burrow migrate-from-pocketbase all -sqlite pb_data/data.db
burrow export-to-sqlite -template pb_data/data.db -out exported.db

See Migrate from PocketBase.

Server commands

burrow serve --http 0.0.0.0:8090        # BURROW_ROLE decides api, worker or all
burrow migrate                          # apply migrations once for the cluster, then exit
burrow superuser upsert admin@example.com 'a-long-password'

These run the PocketBase engine. Configuration is in Configuration.

Deploy kit

burrow up local --source .              # Docker Compose on this machine
burrow up kind --source .               # a kind cluster
burrow up k8s --kube-context CTX --values my-values.yaml
burrow up aws                           # shows the account and region, writes and shows a Terraform plan
burrow up aws --apply --yes             # applies exactly that saved plan
burrow up aws --stack staging           # another environment: its own directory, state and resource names
burrow down local
burrow up flag What
--dir Where the stack files go (default ~/.burrow/stacks/TARGET, or TARGET-STACK with --stack)
--source Build the image from this checkout instead of pulling (not for clouds: push an image and pass --image)
--image Image to run (default ghcr.io/test-zeus-ai/burrowdb at the CLI's version, latest for dev builds). A digest (repo@sha256:...) works
--replicas API replicas (default 2; clouds keep the module default of 3 unless you pass it)
--port local: port on 127.0.0.1 (default 8090)
--kube-context k8s: context to install into (required)
--namespace, --release kind and k8s: default burrowdb
--values kind and k8s: extra Helm values file (repeatable)
--apply, --yes Clouds: apply the plan saved by the previous burrow up (refused when there is none); --apply needs --yes
--stack Clouds: stack name (default default). Each stack has its own directory, Terraform state and resource names
--upgrade-module Clouds: replace the stack's Terraform module and chart with the ones in this binary

Clouds are two steps. burrow up aws prints the identity and region your credentials point at, writes the module into the stack directory, runs terraform init and terraform plan -out=burrow.tfplan, and shows the plan. burrow up aws --apply --yes runs terraform apply burrow.tfplan: exactly what you reviewed, nothing re-planned. A module file you edited is kept; when this binary ships a different copy it is written next to it as FILE.new. --image and --replicas go into burrow.auto.tfvars.json, so plan, apply and down see the same values. The stack directory is 0700 and the Terraform state, plan and variables files are 0600: they hold the database password and storage keys.

burrow down flag What
--volumes local: also delete the database and file volumes (needs --yes)
--delete-cluster kind: delete the kind cluster
--kube-context, --namespace, --release, --dir, --stack As for up
--yes Confirm; required for --volumes and for clouds (terraform destroy)

Details: Quick start, Kubernetes, Clouds.

Agents

burrow mcp                     # MCP server on stdio
burrow mcp --read-only         # only the tools that read
burrow mcp --allow-sql         # also the raw SQL tool (superuser console)
burrow mcp --listen 127.0.0.1:8765
burrow skills list
burrow skills install          # into ~/.claude/skills; --dir for another place, --force to replace

See Coding agents.

Commands that need --yes

backup restore, backup delete, collections delete, down --volumes, and down for a cloud. Without --yes they change nothing and exit with code 2, saying what --yes would do.