Commands
Run everything from the repository root. Scripts that target one workspace use -w api or -w frontend underneath.
Develop
| Command | What it does |
|---|---|
npm run dev | Worker on :8787 (wrangler dev) and Vite on :5173, side by side. Vite proxies /api, including the voice WebSocket. |
npm run typecheck | tsc --noEmit in every workspace, then the root tooling project (e2e and test configs). |
npm run build | The SPA to frontend/dist, then the embed bundle dist/claimpilot-assistant.js. The Worker serves dist. |
Test
| Command | What it does |
|---|---|
npm test | Vitest: the shared, api and frontend projects, once. Offline. |
npm run test:watch | Vitest in watch mode. |
npm run test:coverage | Vitest with v8 coverage and the per-layer gates. Report in coverage/. |
npm run test:e2e | Build, then Playwright against a throwaway Worker on :8799 with the scripted model. |
npm run test:e2e:ui | The same in Playwright's UI mode. |
npm run test:all | Typecheck, 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
| Command | What it does |
|---|---|
npm run db:migrate | Apply D1 migrations to the local database. |
npm run db:migrate:remote | Apply D1 migrations to the real D1 database. |
npm run db:migrate:neon | Apply 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
| Command | What it does |
|---|---|
npm run deploy | Build, then wrangler deploy: the D1 flavour. |
npm run deploy:neon | Build, then wrangler deploy --env neon: the Neon flavour. |
See Deploying before the first deploy of an environment.
Documentation
| Command | What it does |
|---|---|
npm run docs:reference | Regenerate the reference pages from the code. -- --check fails if any are stale. |
npm run docs:dev | Regenerate, then serve this site with hot reload on :3000. |
npm run docs:build | Regenerate, 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.