Scripts & tooling
Template scripts
Prefer bun run commands over calling files
directly. This page maps each wired command to the script under
scripts/ and explains what that folder is for.
scripts/
grouped by purpose
auto-sync
from README + package.json
pre-push
local CI mirror
apps/ui
Section titled “apps/ui”Folder
Purpose
[`ci/`](ci/)Pre-push gate, CI manifest
[`dev/`](dev/)Local developer workflow guards
[`codegen/`](codegen/)Scaffolding and OpenAPI contract generation
[`quality/`](quality/)Test and bundle adjunct checks outside ESLint
[`lint-meta/`](lint-meta/)Static meta-lint rules ([RULES.md](lint-meta/RULES.md))
Command
Script
Purpose
bun run devdev/preflight-host-dev.sh`./scripts/dev/preflight-host-dev.sh && vite
bun run size:check:modulepreloadquality/check-modulepreload-size-coverage.tsAfter `bun run build`, every `<link rel="modulepreload">` in dist/index.html
bun run lint:metalint-meta/cli.tsStatic checks for files ESLint can't parse as JavaScript:
bun run lint:meta:verifylint-meta/cli.tsStatic checks for files ESLint can't parse as JavaScript:
bun run generate:lint-meta-docslint-meta/generate-rules-md.tstsx scripts/lint-meta/generate-rules-md.ts
bun run check:lint-meta-docslint-meta/generate-rules-md.tstsx scripts/lint-meta/generate-rules-md.ts --check
bun run check:scripts-docscheck-scripts-docs.tstsx scripts/check-scripts-docs.ts
bun run test:ciquality/run-tests-clean.tsRuns vitest and fails when the suite prints warning noise to stdout/stderr.
bun run new:componentcodegen/new-component.tsScaffold a new component folder with the 8-file anatomy.
bun run new:featurecodegen/new-feature.tsScaffold a new feature folder.
bun run generate:apicodegen/generate-api.tsRegenerate src/lib/api/schema.d.ts from the API app's OpenAPI document.
bun run generate:api:checkcodegen/generate-api.tsRegenerate src/lib/api/schema.d.ts from the API app's OpenAPI document.
bun run pre-pushci/pre-push.shLocal mirror of the UI app's CI gate. Runs everything CI runs so that a
- 1/${TOTAL} Fast checks (lint, lint:meta, format, typecheck, knip)
- 2/${TOTAL} Dependency vulnerability scan
- 3/${TOTAL} Tests
- 4/${TOTAL} Production build
- 5/${TOTAL} Bundle size budgets
- 6/${TOTAL} OpenAPI schema drift
apps/api
Section titled “apps/api”Folder
Purpose
[`ci/`](ci/)Pre-push gate, CI manifest
[`dev/`](dev/)Local developer workflow guards
[`codegen/`](codegen/)Scaffolding, ACL type sync, VAPID key generation
[`db/`](db/)Database seed utilities
[`quality/`](quality/)Test and coverage adjunct checks outside ESLint
[`lint-meta/`](lint-meta/)Static meta-lint rules ([RULES.md](lint-meta/RULES.md))
Command
Script
Purpose
bun run testquality/run-tests-clean.tsRuns bun test and fails when the suite prints warning noise to stdout/stderr.
bun run test:coveragequality/check-coverage.tsNODE_ENV=test bun run scripts/quality/check-coverage.ts
bun run devdev/preflight-host-dev.sh`./scripts/dev/preflight-host-dev.sh && bun run --watch src/index.ts
bun run db:seeddb/seed-superuser.tsOptional first-boot superuser bootstrap. Reads SUPERUSER_EMAIL and
bun run lint:metalint-meta/cli.tsStatic checks for files ESLint can't parse as JavaScript:
bun run lint:meta:verifylint-meta/cli.tsStatic checks for files ESLint can't parse as JavaScript:
bun run generate:lint-meta-docslint-meta/generate-rules-md.tsbun run scripts/lint-meta/generate-rules-md.ts
bun run check:lint-meta-docslint-meta/generate-rules-md.tsbun run scripts/lint-meta/generate-rules-md.ts --check
bun run check:scripts-docscheck-scripts-docs.tsbun run scripts/check-scripts-docs.ts
bun run new:resourcecodegen/new-resource.tsScaffolds a new API resource:
bun run vapid:generatecodegen/vapid-generate.tsGenerate a fresh VAPID keypair for the Web Push notification channel.
bun run new:notification-eventcodegen/new-notification-event.tsScaffolds a new notification event:
bun run new:actioncodegen/new-action.tsbun run scripts/codegen/new-action.ts
bun run new:rolecodegen/new-role.tsbun run scripts/codegen/new-role.ts
bun run new:subjectcodegen/new-subject.tsbun run scripts/codegen/new-subject.ts
bun run new:featurecodegen/new-feature.tsbun run scripts/codegen/new-feature.ts
bun run generate:acl-typescodegen/generate-acl-types.tsCopies the canonical ACL type spine from apps/api to
bun run generate:acl-types:checkcodegen/generate-acl-types.tsCopies the canonical ACL type spine from apps/api to
bun run pre-pushci/pre-push.shLocal mirror of apps/api CI gate. Runs everything CI runs so that a
- 1/${TOTAL} Fast checks (typecheck, lint, lint:meta, knip)
- 2/${TOTAL} Dependency vulnerability scan
- 3/${TOTAL} Ensure Postgres + Valkey are running
- 4/${TOTAL} Test suite (integration)
- 5/${TOTAL} Test coverage
- 6/${TOTAL} Production build
- 7/${TOTAL} OpenAPI schema drift
- 8/${TOTAL} ACL types drift
Related
Section titled “Related”- Commands cheatsheet — infra flags and day-to-day workflow
- lint:meta rules — static guardrails under
scripts/lint-meta/ - Lint as the contract — ESLint merge gate