Skip to content

Ops scripts

The scripts/ directory — one-off and maintenance tasks. Run them in a shell that has the target env's DATABASE_URL + BUNDLE_S3_* set. For the local dev loop see For contributors · Setup; for base propagation see the runbook.

ScriptPurpose
migrate.tsforward-only SQL migration runner
seed-bases.tsseed / self-heal the shared base library (bytes + _library rows)
republish-base.tscut a new base version from current code
rebase-to-latest-base.tsroll stores onto the latest base (overrides preserved)
onboard.ts / delete-store.tscreate / hard-delete a store (rows only)
reset-local.tstruncate app tables for a fresh local onboarding
ensure-bucket.ts / ensure-test-db.tsidempotent object-store bucket / test DB
gen-themes.ts / gen-tokens.ts / gen-client.tscodegen (themes, tokens, the typed API client)

Base propagation is a two-step

republish-base then rebase-to-latest-base — both --apply-gated. See the base propagation runbook for the full flow and the release-freeze warning.