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
| Command | What it does |
|---|---|
bun run dev | Dev server on port 3000, running your code inside workerd with local D1 and R2 bindings |
bun run preview | Serve the output of the last bun run build locally |
bun run generate-routes | Regenerate 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-typegen | Regenerate 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
| Command | What it does |
|---|---|
bun run typecheck | tsc --noEmit over the whole project |
bun run check | Biome format and lint check in one pass (what CI runs) |
bun run lint | Biome lint only |
bun run format | Biome format check only; bun run format --write applies it |
bun run test | Vitest unit tests, including the guard-rail tests (permissions, settings registry) and the money-path tests against an in-memory D1 |
bun run e2e | Playwright 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:ui | The same suite in Playwright's inspector |
bun run verify:deletion | Apply 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
| Command | What it does |
|---|---|
bun run db:generate | Write a new SQL migration into drizzle/ from the schema in src/core/db/schema.ts |
bun run db:migrate:local | Apply pending migrations to the local D1 |
bun run db:migrate:remote | Apply pending migrations to the production D1. Run it by hand, before deploying code that needs them |
bun run db:seed | Fill the local D1 with 90 days of deterministic demo data (every id starts with seed-). Idempotent |
bun run db:seed --reset | Remove the seed rows only |
bun run db:seed --remote | Seed a public demo deployment's D1. Never point it at a real production database |
bun run auth:generate | Regenerate 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
| Command | What it does |
|---|---|
bun run build | Production build, prerender of the marketing pages, then sitemap.xml and the robots.txt lines from the prerendered page tree |
bun run deploy | bun run build, then wrangler deploy |
bun run deploy:www | Deploy 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
| Command | What it does |
|---|---|
bun run stripe:listen | Forward 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
| Command | What it does |
|---|---|
bun run capture:marketing | Re-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 og | Redraw 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