Command Reference

Every command, subcommand, and option in the base CLI surface.

Global options (all commands): [worker] positional / -w · -e, --environment (default Development) · --workers-folder. Run base <command> --help for the same information in the terminal.

Core

CommandWhat it does
develop [worker]Start the local dev server (wrangler dev, or Node with -p node)
check [worker]Validate settings ↔ wrangler bindings ↔ ORM ↔ GraphQL baseline
bundle [worker]Compile and bundle; --analyze for size breakdowns
deploy [worker]Publish to Cloudflare (requires -e)
test [worker]Run integration tests against a running worker
tail [worker]Stream a deployed worker's logs
info [worker]Print resolved workspace/worker/environment + resolution path
keygenGenerate an AES-GCM encryption key (--format json|toml)

develop: --platform/-p (default cloudflare) · --run-config/-c (default @default) · --remote · --test-scheduled · --persist-to <dir>. Ports come from settings.server, not flags.

check: --all-workers.

bundle: --bundler · --minify · --tree-shake · --watch · --analyze · --expand (with analyze) · --meta (with analyze).

deploy: --all-workers (deploys every worker that targets the environment, binding targets before their binders) · --dry-run (checks only, no publish) · --force (skips checks, but not the git gate) · --allow-dirty (Production only needs this) · --skip-workspace-checks (CI that already ran typecheck/lint/test).

test: --all-workers · --test-host · --test-name-pattern/-t · --test-path-pattern · --test-timeout (default 60000).

tail: --format json|pretty · --status ok|error|canceled · --method · --header · --search · --ip (use self for your own) · --sampling-rate · --version-id.

info: --with-settings (loads settings.ts; lists modules + databases).

Scaffolding

CommandWhat it does
workspace create [directory]New workspace + starter worker
worker create <worker>New worker in this workspace

workspace create: --name · --starter (default app) · --port (default 3000) · --no-install · --force. worker create: --port (default 3000) · --force.

Secrets

CommandWhat it does
workspace secrets exportBundle every env.toml/test.env.toml for CI
workspace secrets importRestore them (--env <VAR> or --file <path>)

export --repo <owner>/<repo> encrypts with the repo's Actions public key and uploads GitHub secrets ENV_TOML + TEST_ENV_TOML (needs a GITHUB_API_TOKEN with repo scope). Without --repo it writes plaintext base64 files; treat them like the secrets they are.

ORM: base orm <command>

Group option: --database <name> (default: the '@default' database).

SubcommandWhat it does
schema:generateRegenerate schema.generated.ts + create a migration (--name/-m, --custom for an empty migration, --no-fold to keep every iteration)
schema:checkRead-only: fails if schema:generate would change anything (--all-workers)
schema:syncApply entity schema directly, skipping migrations; a dev shortcut (--force, --strict, --all-tables)
schema:introspectDump the live database's schema for reference (--casing, --tables-filter)
schema:compatVerify a target environment's schema matches Development (-t <env>, Durable DBs)
migration:runApply pending migrations (--local for wrangler's local D1, --persist-to)
migration:checkMigration-file consistency: collisions, corrupt journal
migration:baselinePrint SQL to adopt an already-matching database into migration tracking
migration:releasePromote migrations to the released list; deploys are blocked until released
migration:dropDelete a migration file (not a database rollback)
migration:upgrade-metadataUpgrade snapshot files after a drizzle-kit upgrade
db:resetWipe local state (--local required; --dry-run to preview; --force outside Development)
db:studioDrizzle Studio browser GUI (--port, default 4983)

Workers sharing a database keep independent migration histories; the tracking table is suffixed per worker.

GraphQL: base graphql <command>

SubcommandWhat it does
schema:generateEmit the SDL snapshot to <worker>/graphql/schemas/ (--all-workers, --path/-p, --split-schema/-s, --metadata/-m)
schema:checkFail on breaking changes vs the committed baseline (--all-workers, --allow-breaking, --strict treats dangerous changes as breaking)

Containers: base container <command>

SubcommandWhat it does
container bundleBundle <worker>/container/index.ts for the container image
container distBundle the container script + Node bootstrap into container/dist/

develop, deploy, and bundle run the container build automatically when a container/ folder exists; these exist for building it in isolation.