Commands
Learn what every script in package.json runs — dev, database, the lint checks and the verify gate.
Every command on this page is a script in package.json and runs with bun run <name> from the repository root.
packageManager pins bun@1.2.2, and .github/workflows/verify.yml installs that version, so the CI run and your local run are the same tool at the same version.
Daily
bun run devnext dev -p 3000 --turbopack — the storefront on :3000, the admin at /admin.
bun run buildnext build under NODE_OPTIONS=--max-old-space-size=6144. The prebuild hook runs icons first.
bun run startnext start -p 3000.
bun run iconsscripts/build-icons.ts — writes the icon sprite and types/icons.d.ts.
Both outputs are gitignored, so a fresh clone needs this before typecheck or the sprite contract test passes.
bun run emailSKIP_ENV_VALIDATION=1 email dev — the React Email preview server for the templates in emails/.
bun run formatbiome format --write ..
bun run clean:nextDeletes the .next-build and .next-dev directories.
bun run scaffold:analytics-cardscripts/scaffold-analytics-card.ts <kebab-key> "<Human Title>" — prints ready-to-paste snippets for the six places an analytics card has to be wired: query, service, action, row builder, table registry, dashboard card and module registry.
Database
bun run db:generateprisma generate. The postinstall hook already runs it after bun install.
bun run db:migrateprisma migrate dev.
bun run db:pushAlso prisma migrate dev — the same command as db:migrate, not prisma db push.
bun run db:deployprisma migrate deploy — applies committed migrations without generating new ones.
bun run db:resetprisma migrate reset — drops, re-applies every migration, then runs the seed through the prisma.seed hook (bun prisma/seed.ts).
bun run db:seedtsx prisma/seed.ts.
bun run db:studioprisma studio --port 5556.
bun run db:guarantees:auditscripts/check-db-guarantees.ts — a read-only audit of the constraints, indexes, triggers and views the migrations install. It fails when a drift view or a pre-index duplicate probe returns rows.
bun run db:guarantees:audit:strictThe same audit with --strict, which also fails on any unvalidated CHECK.
db:push is not a schema push
db:push and db:migrate are both prisma migrate dev, so either one
writes a migration file. prisma/migrations/ holds a committed history —
20260726143000_baseline_with_db_guarantees (the schema plus every CHECK
constraint and case-insensitive unique index) and
20260730090000_performance_indexes.
db:seed has a matching trap. tsx is not a dependency in package.json, so bun run db:seed fails when tsx is not installed globally. Run the file directly instead:
bun prisma/seed.tsThat is the same file — it is what the prisma.seed hook uses, and what db:reset invokes.
Checks
bun run lintThe short working loop, in order:
biome check --write .lint:cachelint:disciplinelint:deadlint:flexlint:critical-testslint:no-as-anylint:cleanliness
This one writes fixes. It is the only command in this file that changes your working tree without being asked.
bun run lint:disciplinescripts/check-discipline.ts — icons, table factory, CRUD routing and the other on-pattern rules.
bun run lint:critical-testsscripts/check-critical-tests.ts — fails when a money or correctness-critical file has no test.
bun run lint:cleanlinessThirteen checks in sequence:
- orphan exports
- dead server actions
- dead Prisma fields
- field balance
- duplicate utils
- unused deps
- hacks
- events
- cache tags
- guarantees contract
- client/server boundary
- client bundle
- discipline hygiene
bun run lint:knipknip — unreferenced files and exports. Not part of verify.
bun run testvitest in watch mode.
bun run vitest runOne pass of the unit and contract suite. vitest here is the binary in node_modules/.bin, not a package.json script.
bun run test:integrationvitest run --config vitest.integration.config.ts — the files under test/integration/ against a real litestore_test Postgres, run sequentially. Override the connection with TEST_DATABASE_URL.
bun run typechecktsc --noEmit under NODE_OPTIONS=--max-old-space-size=12288.
bun run typecheck:strictThe same with --strict --noImplicitAny --noImplicitReturns --noImplicitThis --noUnusedLocals --noUnusedParameters.
Typecheck memory
typecheck asks Node for a 12 GB heap. On smaller machines, close the dev
server and run it alone.
The verify gate
bun run verifyverify is the one command that decides whether a change is mergeable. .github/workflows/verify.yml runs it on every push to main and every pull request.
It is a single && chain in package.json, run sequentially and stopping at the first failure. The legs are:
biome check .lint:disciplinelint:cachelint:deadlint:flexlint:theme-boundarieslint:no-as-anylint:critical-testslint:event-completenesslint:nested-soft-deletelint:public-feed-visibilitylint:nested-hiddenlint:cleanlinessvitest runtypecheck
Biome runs there without --write, unlike in lint. Between it and the typechecker sit twelve lint checks and the test suite.
Every leg is its own script, so you can run one in isolation rather than re-running the chain.
How the 25 checks map onto the gate
Eleven of the legs execute exactly one scripts/check-*.ts file each:
lint:discipline
lint:cache
lint:dead
lint:flex
lint:theme-boundaries
lint:no-as-any
lint:critical-tests
lint:event-completeness
lint:nested-soft-delete
lint:public-feed-visibility
lint:nested-hiddenlint:cleanliness chains thirteen more:
lint:orphans
lint:dead-actions
lint:dead-schema
lint:field-balance
lint:dupes
lint:deps
lint:hacks
lint:events
lint:cache-tags
lint:guarantees
lint:client-boundary
lint:client-bundle
lint:hygieneThat is 24 of the 25 scripts/check-*.ts files.
The twenty-fifth, check-db-guarantees.ts, is not in the gate because it needs a live database. It runs through db:guarantees:audit.
Running the gate in parallel
bun run verify:parallelscripts/verify.ts spawns the same fifteen legs concurrently, capped at cpus − 1. Override that with VERIFY_CONCURRENCY.
It reports per-leg pass/fail and timing, and surfaces every failure instead of stopping at the first — which is what makes it the better choice when several things are broken at once.
The same gate locally
Lefthook enforces it on your machine, and bun install installs the hooks through the prepare script.
pre-commit runs lint:discipline, lint:critical-tests and vitest run.
pre-push runs verify.
commit-msg rejects messages under 10 characters or 2 words, exempting messages starting with Merge, Revert, fixup! or squash!.
When Prisma disagrees with the schema
If TypeScript claims a model does not exist and you can see it in schema.prisma, the generated client is stale. Regenerate it:
bun run db:generateThis commonly happens after pulling a branch that changed the schema.
Which command to run
For the working loop, run lint — it writes the fixes it can, and it is the shorter chain.
Before you push, run verify, because that is what CI runs and what pre-push runs. Reach for verify:parallel when you already know several legs are failing and want the whole list in one pass.
The one thing neither gate covers is the database audit, since it needs a live connection:
If you changed a migration, verify passing is not evidence that the guarantees still hold — run db:guarantees:audit against the database.
Next Steps
Development
Learn how to run Litestore day to day: starting Postgres and the Turbopack dev server, reseeding with db:seed and db:reset, and the checks bun run verify runs before you commit.
FAQ
Learn about the questions that come up most often when setting up, running, extending and evaluating Litestore, including what the repository does not claim to be.