Skip to main content

Commands

Run everything from the repository root. Scripts that target one workspace use -w api or -w frontend underneath.

Develop​

CommandWhat it does
npm run devWorker on :8787 (wrangler dev) and Vite on :5173, side by side. Vite proxies /api, including the voice WebSocket.
npm run typechecktsc --noEmit in every workspace, then the root tooling project (e2e and test configs).
npm run buildThe SPA to frontend/dist, then the embed bundle dist/claimpilot-assistant.js. The Worker serves dist.

Test​

CommandWhat it does
npm testVitest: the shared, api and frontend projects, once. Offline.
npm run test:watchVitest in watch mode.
npm run test:coverageVitest with v8 coverage and the per-layer gates. Report in coverage/.
npm run test:e2eBuild, then Playwright against a throwaway Worker on :8799 with the scripted model.
npm run test:e2e:uiThe same in Playwright's UI mode.
npm run test:allTypecheck, Vitest and Playwright: what CI runs.

Narrower runs:

npx vitest run --project api # one project: shared | api | frontend
npx vitest run api/src/chat # one folder
npx playwright test e2e/chat.spec.ts --headed
npx playwright show-report # the last run, with traces of any failure

Data​

CommandWhat it does
npm run db:migrateApply D1 migrations to the local database.
npm run db:migrate:remoteApply D1 migrations to the real D1 database.
npm run db:migrate:neonApply Neon migrations in order, recording each in schema_migrations.
npm run generate -- …The claim generator. See Generating claims.
npm run copy-claims -- --from <store> --to <store>Copy every claim between d1-local, d1-remote and neon.
Remote targets are shared

db:migrate:remote, --target d1-remote, --target neon and --to neon change shared data. Run them deliberately, never as part of a habit.

Deploy​

CommandWhat it does
npm run deployBuild, then wrangler deploy: the D1 flavour.
npm run deploy:neonBuild, then wrangler deploy --env neon: the Neon flavour.

See Deploying before the first deploy of an environment.

Documentation​

CommandWhat it does
npm run docs:referenceRegenerate the reference pages from the code. -- --check fails if any are stale.
npm run docs:devRegenerate, then serve this site with hot reload on :3000.
npm run docs:buildRegenerate, then build the static site into docusaurus/build.

The site is its own npm project: run npm install --prefix docusaurus once before the first docs:dev.