docs/reference/cli.md

CLI reference

Every script declared in packages/core/package.json, grouped by purpose. Run from packages/core/ unless noted.

Local development

ScriptPurpose
npm run devStart the dev stack: PGLite database server + Next.js dev server + Spotlight error monitor. Fastest path to a working app.
npm run dev:nextNext.js dev server only. Use when you've started Postgres yourself (e.g. via root docker compose up).
npm run dev:spotlightSpotlight UI for local Sentry error capture. Bundled into npm run dev.
npm run buildFull production build chain: db:migratebuild:nextdocs:index (Pagefind). Requires DATABASE_URL.
npm run build:nextJust Next.js build. Skips migrations + Pagefind indexing. Used inside the Docker image build where DATABASE_URL isn't available.
npm run build-localLike build:next but stands up an in-memory PGLite first. Useful for "does this compile in production mode?" checks.
npm run startServe the production build. Assumes npm run build has already run.
npm run cleanDelete .next, out, coverage.

Database

ScriptPurpose
npm run db:generateGenerate a Drizzle migration from schema changes in src/models/Schema.ts.
npm run db:migrateApply pending migrations against $DATABASE_URL.
npm run db:studioOpen Drizzle Studio in the browser — a visual query/edit UI for the live DB.

Workspace-as-code

Edit YAML + markdown in workspace/<org>/, then:

ScriptPurpose
npm run workspace:checkDry-run validation: parses every file, computes the diff against the DB, prints what would change. Read-only.
npm run workspace:applyValidate + write changes to the DB. Records a new workspace_version row + bumps workspace_sha.
npm run workspace:exportPull the DB state back to disk — useful when editing via the dashboard UI and you want to commit the result.

Agents + workers

ScriptPurpose
npm run mcp:serveStart the MCP server on stdin/stdout (for Claude Code, Cursor, Zed).
npm run worker:serveRun the feedback worker loop. Opt-in via ENABLE_FEEDBACK_WORKER=1.
npm run temporal:workerRun the Temporal worker for vocionWorkflow + ingestion activities. Opt-in via ENABLE_TEMPORAL_WORKER=1.

Evals

ScriptPurpose
npm run eval:run -- --dataset <slug>Run a context-authored dataset through the agent + judge. Exits non-zero if pass-rate < 0.8 — wire into CI.

Observability

ScriptPurpose
npm run langfuse:smokeVerify the local Langfuse stack accepts + returns a trace. Useful in dev:up post-boot hooks.
npm run langfuse:bootstrapOne-time: register Claude 4.6 / 4.7 / Haiku 4.5 + OpenAI model pricing via Langfuse's /api/public/models API. Idempotent.

Docs

ScriptPurpose
npm run docs:indexRun Pagefind against the built Next.js static output to produce the docs search index at public/pagefind/. Chained into npm run build.
npm run docs:lintWalk every .md and report broken cross-document links. Exits non-zero on failure — wire into CI.

Quality + tests

ScriptPurpose
npm run check:typesTypeScript tsc --noEmit. Pretty output.
npm run check:i18nValidate translation keys via @lingual/i18n-check.
npm testVitest unit tests.
npm run test:e2ePlaywright end-to-end tests.
npm run lint / lint:fixESLint (Antfu config).

Billing (optional)

ScriptPurpose
npm run stripe:listenForward Stripe webhooks to localhost:3000/webhook/billing for local testing.
npm run stripe:setup-priceOne-shot to create Stripe prices for the configured PricingPlanList.

Storybook

ScriptPurpose
npm run storybookComponent dev environment on :6006.
npm run storybook:testVitest-driven Storybook stories.
npm run build-storybookStatic Storybook build for deployment.

Repo-root scripts

Run from the monorepo root (/), not packages/core/:

ScriptPurpose
npm run dev:upBoot the full local platform: app DB (pgvector + FTS) + Langfuse + Temporal + OTel collector.
npm run dev:downTear it all down.