Search docs

Jump to a BRB documentation page

Operations

Test BRB locally from end to end

Start local app, create local user, register repo, validate sync, then test restore and optional Artifacts source-of-truth flows.

Operations
https://docs.brbgit.com/local-testing

Start local app

bash
pnpm dev
  • App runs on http://127.0.0.1:3000.
  • If local Worker state is broken, delete apps/web/.wrangler and restart.

Create local user and sign in

bash
brb login --register --base-url http://127.0.0.1:3000
brb whoami --base-url http://127.0.0.1:3000
Saved locally

CLI stores local auth in ~/.brb/auth.json and reuses it for init, sync, watch, and daemon commands.

Register repo and start syncing

bash
cd /Users/charlkruger/github/sample
brb init --base-url http://127.0.0.1:3000
brb watch --base-url http://127.0.0.1:3000
Agent-first local shortcut on macOS
cd /Users/charlkruger/github/sample
brb sync --ensure-daemon --base-url http://127.0.0.1:3000
First sync automatic

Watch mode performs startup sync automatically. brb sync --ensure-daemon can bootstrap registration, sync, and background watching in one step.

Validate UI

  • Dashboard should show repo and sync state.
  • Repo detail page should show overview, history, checkpoints, and Artifacts state.
  • Edit local file and wait for quiet window to confirm new BRB commit appears.

Restore test

  • Create at least one synced BRB commit while brb watch is running.
  • Restore an older checkpoint from the web UI.
  • Confirm BRB creates a restore commit remotely and the running watcher applies that restored snapshot back to local files.
  • If local files are dirty, BRB should refuse to overwrite them until you sync or clean the repo.

Optional Cloudflare Artifacts test

  1. 1Copy apps/web/.dev.vars.example to apps/web/.dev.vars and fill in ARTIFACTS_API_TOKEN.
  2. 2Create a BRB project and make a synced commit.
  3. 3Confirm repo payload includes an Artifacts target and mirrored commit SHA.
  4. 4Clone or inspect the Artifacts remote with a short-lived repo token.
  5. 5Create an isolated session fork from the Backup page and confirm it gets its own Artifacts remote.
Quick verify
BRB_TOKEN=your-cli-token pnpm test:artifacts-mirror -- <repoId>

Optional import test

  1. 1Open the dashboard and click Import repo.
  2. 2Enter a project name and a public HTTPS Git URL.
  3. 3Confirm the imported project opens successfully.
  4. 4Check that History shows the imported head commit without an extra synthetic BRB import commit.
CLI import
brb repo create --name workers-sdk --import-url https://github.com/cloudflare/workers-sdk --import-branch main --import-depth 100 --base-url http://127.0.0.1:3000

Full checklist

Repo contains full local operator checklist in LOCAL_TESTING.md, including reset steps and common failure modes.