CLI Reference
Every command, flag, and option. Brokr accepts canonical syntax, expressive aliases, and natural language — all three routes compile into the same structured plan.
Core Commands
Every command listed below. Detailed flags and examples are in the sections that follow.
| Command | Description |
|---|---|
brokr create [type] [--name <name>] | Create a stack. Context-aware: auto-detects auth state, git remote, and existing code. |
brokr deploy [--watch] [--skip-git] [-m "msg"] | Push code + sync env vars + trigger a Vercel deployment. |
brokr attach <name | att_code> | Attach this directory to a stack. |
brokr add <capability> --stack <name> | Add a capability (database, deployment, email, repo, ai_provider, kv_store, auth). |
brokr remove <capability> --stack <name> | Remove a capability from a stack. |
brokr status [--stack <name>] [--watch] | Show status for all stacks, or a specific stack. |
brokr list | List all stacks for the current account. |
brokr env <subcommand> | Manage env vars. Subcommands: pull, push, set, import, list. |
brokr deploy --env-only | Sync env vars to Vercel without pushing code. |
brokr promote | Promote staging to production by creating a PR from staging → main. |
brokr logs [--follow] | Live tail or historical log viewer with level/source filtering. |
brokr errors [--last 1d] | Grouped error viewer with fingerprinting and stack traces. |
brokr build [prompt] | AI coding agent with infrastructure superpowers. |
brokr search domains --name <name> | Search for available custom domains with pricing. |
brokr link <target> | Link a provider account (github, vercel, account). |
brokr claim [stack] | Claim a temporary stack. |
brokr delete <stack> | Delete a stack and all its provisioned resources. |
brokr fork git | Fork a Brokr-managed repo into your account (non-destructive). |
brokr transfer git | Transfer repo ownership to your account (irreversible). |
brokr balance | Show credit balance and auto-reload settings. |
brokr topup [amount] | Add credits via Stripe Checkout. |
brokr billing | Open Stripe portal to manage payment methods. |
brokr doctor | Check environment, credentials, and API connectivity. |
brokr whoami | Show the currently authenticated user. |
brokr detach | Remove the .brokr file from the current directory. |
brokr apply <code> | Fetch and apply a file bundle from the dashboard. |
Stack Commands
create — Create a new stack. Brokr auto-detects your environment: logged in? GitHub remote? Existing code? The answers determine mode, repo source, and defaults.
# From a repo with a GitHub remote — name and repo auto-detectedcd ~/my-projectbrokr create web-app# New repo from scratchbrokr create web-app --name my-app# Scaffold a Next.js starter (no login needed)brokr create web-app --name my-app --fw next# With a custom domainbrokr create web-app --name smooth --domain smooth.app# With staging enabledbrokr create web-app --name my-app --staging
| Flag | Description |
|---|---|
--name, -n <name> | Stack name. Inferred from the git repo name when not provided. |
--repo <mode> | Repo source: create | current | owner/repo | GitHub URL. |
--repo-mode <ownership> | Repo ownership: brokr-managed | user-managed. |
--mutation <policy> | Mutation policy: direct | branch | pr-only. |
--fw <framework> | Scaffold a starter template: next | express. |
--domain <domain> | Attach a custom domain during creation. |
--staging | Enable staging environment alongside production. |
--providers <list> | Pre-select capabilities (comma-separated or "auto"). |
--mode <mode> | Creation mode: auto | guided | temporary | personal. |
--yes, -y | Skip confirmation prompts. |
type is the first positional argument: web-app, ai-app, custom, or stack. Templates determine which capabilities are provisioned by default.
delete — Permanently delete a stack and all its cloud resources (GitHub repo, Neon database, Vercel deployment, DNS, R2 storage). Requires double confirmation.
brokr delete my-app# ⚠ This will permanently delete 'my-app' and all resources.# Type the stack name to confirm: my-app# ✓ Stack deleted
list — List all stacks for your account.
brokr list# my-app active https://my-app.brokr.sh# side-proj provisioning
status — Show detailed status for a stack or all stacks. Use --watch to poll every 5 seconds until all capabilities are active.
brokr status my-appbrokr status my-app --watchbrokr status --json
Capability Commands
add — Add a capability to a stack. The --stack flag is auto-detected from the .brokr file in your directory.
brokr add database --stack my-appbrokr add ai_provider --stack my-appbrokr add auth --stack my-app # auto-scaffolds auth files
| Capability | What it provisions |
|---|---|
database | Neon Postgres — connection string written to .env. |
deployment | Vercel project + GitHub integration. |
email | Resend email sending via Brokr gateway. |
repo | GitHub repository (create or attach existing). |
ai_provider | AI gateway access (Claude, GPT, Deepseek, etc.). |
kv_store | Upstash Redis key-value store. |
storage | Cloudflare R2 object storage. |
auth | Brokr Auth integration with auto-scaffolded code. |
remove — Remove a capability from a stack. Accepts capability types or provider names.
brokr remove database --stack my-appbrokr remove neon --stack my-app # provider alias works toobrokr remove email --yes # skip confirmation
| Provider alias | Maps to |
|---|---|
neon, postgres, supabase | database |
vercel | deployment |
resend | email |
github | repo |
openai, anthropic, deepseek | ai_provider |
upstash, redis | kv_store |
r2, cloudflare | storage |
brokr-auth | auth |
The auth capability auto-scaffolds Brokr Auth files into your project and installs dependencies when added.
Deployment & Env
deploy — Full deploy workflow: commit, push code to GitHub, sync env vars, trigger Vercel build. Watches build progress by default.
# Full deploy — code + env + build + watchbrokr deploy# ✓ Code pushed → https://github.com/you/my-app# ✓ Env synced → 12 vars pushed to Vercel# ✓ Deploy triggered → dpl_abc123# ✓ Ready → https://my-app.brokr.sh (1m 18s)# Custom commit messagebrokr deploy -m "fix auth redirect"# Just sync env vars, no code push or buildbrokr deploy --env-only# Skip env sync, just deploy codebrokr deploy --skip-env# Deploy to staging (if enabled)brokr deploy staging# Deploy to productionbrokr deploy prod
| Flag | Description |
|---|---|
--stack, -s | Stack name or ID (auto-detected from .brokr). |
--message, -m <msg> | Git commit message. |
--watch, -w | Poll until deployment is ready (default: true). |
--no-watch | Skip polling after triggering deploy. |
--env-only | Sync env vars only, skip code push and build. |
--skip-env | Skip env var sync. |
--skip-git | Skip git commit and push. |
--yes, -y | Auto-confirm new env vars. |
.env.brokr is the source of truth for all env vars. Local values override DB values when syncing to Vercel. Brokr ensures sensitive files (.env, .brokr, credentials.json) are in .gitignore before staging.
env — Manage environment variables with subcommands. Most auto-detect the stack from the .brokr file.
| Subcommand | Description |
|---|---|
brokr env pull --stack <name> | Pull stack env vars into local .env file. |
brokr env set KEY=VALUE | Set a single env var (local + server + Vercel). |
brokr env import [--env-file <path>] | Bulk import vars from .env or .env.brokr. |
brokr env push | Force-sync server secrets to Vercel deployment. |
brokr env list | Show env var names with masked values. |
promote — Promote staging to production by creating a PR from the staging branch to main. Auto-merges if clean, creates a PR for manual resolution if there are conflicts.
brokr promote# ✓ PR created: staging → main# ✓ Auto-merged (squash)# Production will auto-deploy after merge.
staging — Enable staging environments and manage IP whitelists.
# Enable staging on a stackbrokr staging enable --stack my-app# Add your current IP to the whitelistbrokr staging wl add# Add a specific IPbrokr staging wl add 203.0.113.42# List whitelisted IPsbrokr staging wl list# Disable whitelistingbrokr staging wl off
Directory Commands
attach — Link the current directory to a stack. Pass a stack name (if authenticated), stack ID, or a dashboard attach code (att_XXXX). Writes a .brokr file so other commands auto-detect the stack.
# By name (requires auth)brokr attach my-app# By dashboard attach code (no auth needed — opens OAuth flow)brokr attach att_A1b2C3d4# After attaching, seeds .env.brokr with managed vars# ✓ Attached to my-app# ✓ .env.brokr seeded → 8 vars
When attaching with an att_XXXX code while unauthenticated, Brokr opens a browser OAuth flow and polls for your token. The attach code is single-use and expires.
detach — Disconnect the current directory from Brokr. Removes the .brokr file, .env.brokr, and optionally .git and node_modules.
brokr detach# ✓ Removed .brokr# ✓ Removed .env.brokr# Also remove .git directorybrokr detach# (prompts unless --yes)# Keep git historybrokr detach --keep-git# Full clean including node_modulesbrokr detach --clean
Repo Commands
fork — Fork a Brokr-managed GitHub repo into your account. Non-destructive — both repos continue to exist. Optionally updates Vercel to point to the fork.
brokr fork git --stack my-app# ✓ Forked to github.com/you/my-app# Update Vercel project to use fork? (y/n)# ✓ Local remotes updated: origin → brokr, fork → origin
transfer — Transfer full ownership of a Brokr-managed repo to your GitHub account. This is irreversible. Updates Vercel, local git remotes, and marks the stack as user-owned.
brokr transfer git --stack my-app# ⚠ This is irreversible. Type 'my-app' to confirm: my-app# ✓ Repo transferred to github.com/you/my-app# ✓ Vercel project updated# ✓ Stack marked as user-owned# Preview without making changesbrokr transfer git --stack my-app --dry-run
Both fork and transfer require the stack to have a Brokr-managed repo. If the stack already uses a user-managed repo, these commands are not needed.
Observability
logs — Live tail and historical log viewer with filtering. Auto-follows in TTY mode unless --no-follow or --last is specified.
# Live tail (default)brokr logs# Last 2 hours, errors onlybrokr logs --last 2h --level error# Filter by function pathbrokr logs --source /api/chat# Specific deploymentbrokr logs --deployment dpl_abc123
| Flag | Description |
|---|---|
--follow, -f | Live tail mode (default in TTY). |
--no-follow | Disable live tail, show historical logs. |
--limit <n> | Max lines to show (default: 50, max: 100). |
--last <time> | Time window: 10m, 2h, 3d. |
--level <level> | Filter by level: error, warn, info, debug. |
--source <path> | Filter by function or route path. |
--deployment <id> | Filter by deployment ID. |
errors — Grouped error viewer with fingerprinting. Shows error count, first/last seen timestamps, and stack traces.
# Last 10 error groups (default)brokr errors# Last 24 hours, more groupsbrokr errors --last 1d --limit 25
doctor — Checks your local environment for common issues: Node.js version (≥ 18), authentication status, API reachability, and token validity.
brokr doctor# ✓ Node.js v20.11.0# ✓ Authenticated as you@example.com# ✓ API reachable at https://api.brokr.sh# ✓ Token valid
Billing Commands
balance — Show your current Brokr credit balance and auto-reload settings.
brokr balance# Balance: $42.50# Auto-reload: ON ($25 when below $5)# Payment method: Visa ****4242
topup — Add credits to your account via Stripe Checkout. Opens a browser window. Default amount: $25. Range: $5 to $1,000.
# Default $25 top-upbrokr topup# Custom amountbrokr topup 100# Opens Stripe Checkout → polls for confirmation# ✓ Payment confirmed → Balance: $142.50
billing — Opens the Stripe Customer Portal in your browser to manage payment methods, view invoices, and update billing info.
brokr billing# Opens https://billing.stripe.com/session/...
AI Commands
build — AI coding agent with infrastructure superpowers. Reads your codebase, provisions capabilities, writes code, and optionally deploys. Interactive mode (no arguments) or one-shot mode (with a prompt).
# Interactive sessionbrokr build# One-shot modebrokr build "add a contact form with email sending"# Use a different modelbrokr build --model sonnet "refactor the auth flow"# Create a branch for changesbrokr build --branch "add dark mode support"
| Flag | Description |
|---|---|
--model <model> | AI model: deepseek (default) | sonnet | opus. |
--yes, -y | Skip confirmation prompts (headless mode). |
--no-deploy | Skip auto-deploy after code writes. |
--branch | Create a git branch for changes. |
Requires authentication (brokr link account). The agent creates a pre-build snapshot commit before making changes so you can always roll back.
Other Commands
apply — Fetch and apply a file bundle from the dashboard. The dashboard generates an 8-character hex code that maps to a set of files.
# Apply a bundlebrokr apply a1b2c3d4# ✓ Created src/components/ContactForm.tsx# ✓ Updated src/app/page.tsx# Preview without writing filesbrokr apply a1b2c3d4 --dry-run
search domains — Search for available custom domains. Returns availability and pricing. Interactive selection for purchasing (requires auth).
brokr search domains --name smooth# smooth.app $14.99/yr ✓ available# smooth.dev $12.99/yr ✓ available# smooth.io $34.99/yr ✓ available# smooth.com — ✗ taken# Filter by TLDbrokr search domains --name my-app --tld .app,.dev# Show more resultsbrokr search domains --name cool-project --count 10
whoami — Show the currently authenticated user.
brokr whoami# you@example.com
claim — Claim a temporary stack to make it permanent. Reads the claim code from the .brokr file if present, or accepts a stack ID.
# From the stack directory (reads .brokr)brokr claim# ✓ Stack claimed → clxxxxxxxxxxxxx# Explicit stack IDbrokr claim clxxxxxxxxxxxxx
If you run brokr link account instead, Brokr auto-claims any temporary stacks that match your GitHub repos.
Aliases & Natural Language
Aliases are first-class commands, but the useful set is intentionally small. You should not need to memorize a parallel CLI.
brokr make web-app --name my-app --repo createUse a more natural verb for create. Same stack flow, less ceremony.
brokr want database --stack my-appAsk for a capability in plain English when you do not want to remember the canonical add syntax.
brokr do "add neon to my-app"Drop into natural language when intent matters more than the exact command shape.
Any quoted string or unrecognized command is treated as natural language and routed to the AI parser. The parser returns the same structured CommandPlan schema used by canonical CLI input.
# Quoted string → NL modebrokr "give me a postgres database on neon for my-app"# Unrecognized command → NL modebrokr add a database to my-app# Explicit via aliasbrokr do "spin up an ai-app with vercel and openai"
Global Flags
| Flag | Description |
|---|---|
--json | Output raw JSON (machine-readable). |
--yes, -y | Skip confirmation prompts. |
--verbose, -V | Enable verbose debug output. |
--api-url, -u | Override API URL (default: https://brokr.sh/api/orpc). |
--help, -h | Show help for a command. |
--version, -v | Show CLI version. |
Response Schema
All commands output structured JSON when --json is passed.
// CreateStackResponse{"ok": true,"stackId": "stk_abc123","plan": {"stackName": "my-app","mode": "temporary","repoConfig": {"mode": "create","ownership": "brokr-managed","mutation": "direct","raw": "create","value": "create"}},"message": "Stack provisioned"}// ErrorResponse{"ok": false,"code": "STACK_NOT_FOUND","message": "Stack 'my-app' does not exist.","hint": "Run 'brokr list' to see your stacks."}