Commands

Every package.json script in ShipKit, grouped by what you use it for, plus the handful of wrangler one-liners you will reach for.

Every script runs with bun run <name>. Arguments after the name are passed through, so bun run db:seed --reset and bun run verify:deletion credits work as written.

Develop

CommandWhat it does
bun run devDev server on port 3000, running your code inside workerd with local D1 and R2 bindings
bun run previewServe the output of the last bun run build locally
bun run generate-routesRegenerate src/routeTree.gen.ts after adding or moving route files. The dev server does this on its own; use it when the dev server is not running
bun run cf-typegenRegenerate worker-configuration.d.ts (the Env types) from wrangler.jsonc. Run it after a fresh clone and after any change to wrangler.jsonc

Env is read at boot. After editing .dev.vars, restart bun run dev.

Check and test

CommandWhat it does
bun run typechecktsc --noEmit over the whole project
bun run checkBiome format and lint check in one pass (what CI runs)
bun run lintBiome lint only
bun run formatBiome format check only; bun run format --write applies it
bun run testVitest unit tests, including the guard-rail tests (permissions, settings registry) and the money-path tests against an in-memory D1
bun run e2ePlaywright end-to-end suite against the real dev server and local D1. Reuses a server already on :3000 or starts one, seeds demo data, forges an admin and a user session from BETTER_AUTH_SECRET
bun run e2e:uiThe same suite in Playwright's inspector
bun run verify:deletionApply every feature-deletion recipe to a copy of the repo, one at a time, and require build, typecheck and unit tests to pass

verify:deletion takes recipe names (bun run verify:deletion credits files) or all to apply every recipe to one copy. The first bun run e2e on a machine needs a browser: bunx playwright install chromium.

Database

CommandWhat it does
bun run db:generateWrite a new SQL migration into drizzle/ from the schema in src/core/db/schema.ts
bun run db:migrate:localApply pending migrations to the local D1
bun run db:migrate:remoteApply pending migrations to the production D1. Run it by hand, before deploying code that needs them
bun run db:seedFill the local D1 with 90 days of deterministic demo data (every id starts with seed-). Idempotent
bun run db:seed --resetRemove the seed rows only
bun run db:seed --remoteSeed a public demo deployment's D1. Never point it at a real production database
bun run auth:generateRegenerate the better-auth tables in src/features/auth/schema.ts from auth.cli-config.ts; follow with bun run db:generate

See Database for the migration workflow.

Build and deploy

CommandWhat it does
bun run buildProduction build, prerender of the marketing pages, then sitemap.xml and the robots.txt lines from the prerendered page tree
bun run deploybun run build, then wrangler deploy
bun run deploy:wwwDeploy the optional www to apex redirect Worker in infra/www-redirect/. A Cloudflare redirect rule is usually the simpler choice

The build also generates src/paraglide/, which typecheck and the unit tests import, so on a fresh checkout run bun run build (or start the dev server) before bun run typecheck. Deployment is covered in Deploy.

Payments

CommandWhat it does
bun run stripe:listenForward Stripe webhooks to localhost:3000/api/webhooks/stripe through the Stripe CLI, using STRIPE_SECRET_KEY from .dev.vars. It prints the whsec_… value that goes in STRIPE_WEBHOOK_SECRET

Needed for any local purchase test on Stripe. Creem has no forwarding CLI; see Payments.

Marketing assets

CommandWhat it does
bun run capture:marketingRe-shoot the landing page's product screenshots into public/marketing/ from the running app and the seeded local D1. Pass a surface name to redo just one
bun run upload:marketing <dir>Resize the images in <dir> to webp and upload them to the R2 bucket under marketing/, read through appConfig.mediaUrl. --dry-run prints the plan first
bun run ogRedraw public/og.png (1200×630) from scripts/og-card.html

capture:marketing needs the dev server on :3000 and the sessions that bun run e2e sets up, so run the e2e suite once first. After bun run og, bump the v on socialCard in src/routes/__root.tsx, or social crawlers keep serving the cached card. See Landing page and themes.

Useful one-liners

These are not scripts, but you will use them.

Make yourself an admin after your first sign-in (swap --local for --remote in production):

bunx wrangler d1 execute DB --local \
  --command "UPDATE user SET role='admin' WHERE email='you@example.com'"

Query the local database:

bunx wrangler d1 execute DB --local --command "SELECT id, email, role FROM user LIMIT 5"

Run the nightly cron jobs on demand while bun run dev is up:

curl "localhost:3000/cdn-cgi/handler/scheduled"

Add a shadcn/ui primitive (then check git diff src/components/ui, since the CLI can overwrite customized files):

bunx shadcn@latest add <component>

Push a production secret:

bunx wrangler secret put BETTER_AUTH_SECRET