Skip to content

Scripts And Commands

Last refreshed: 2026-07-27

Development

  • pnpm install
  • pnpm dev
  • pnpm devsafe
  • pnpm build
  • pnpm start

pnpm devsafe uses rimraf to clear .next and starts non-Turbopack dev mode.

Local Compose Stack

  • pnpm stack:config: validate the resolved Compose model.
  • pnpm stack:up: build, start, and wait for web, postgres, pgadmin, rag-worker, and presentation-worker.
  • pnpm stack:status: show service and health status.
  • pnpm stack:logs: show the latest 200 service log lines.
  • pnpm stack:restart: restart services without removing volumes.
  • pnpm stack:down: stop and remove containers/networks while preserving named volumes.
  • pnpm stack:verify: run the Payload, Mastra, RAG vector, and worker API smoke inside web.
  • pnpm stack:reset: print the destructive reset plan. Execution additionally requires --execute --confirm anuvax-cms-local.

Every Compose command loads .env.compose. Start from .env.compose.example; never commit the local file.

scripts/local-stack/start-web.mjs is the container entry point. It waits for PostgreSQL, detects an existing Payload schema, and prevents repeat push on routine restarts while retaining first-boot push for an empty local database.

Local Database Migration Tooling

  • pnpm local-stack:db:env -- inventory ...
  • pnpm local-stack:db:env -- export ...
  • pnpm local-stack:db -- verify ...
  • pnpm local-stack:db -- prepare ...
  • pnpm local-stack:db:migrate -- create-target ...
  • pnpm local-stack:db:migrate -- align-target ...
  • pnpm local-stack:db:migrate -- restore ...
  • pnpm local-stack:db:migrate -- parity ...
  • pnpm local-stack:db:migrate -- probe ...

These commands default to plan mode and write only under the ignored .local-data/database/<run-id> hierarchy. The pinned Supabase CLI performs reviewed-schema dry runs and exports. Inventory is read-only; verification checks SHA-256 manifests; preparation removes only hosted ownership/ACL statements; target creation and restore require exact confirmations and loopback endpoints. Restore is checksum-gated and transactional. Parity records exact counts, hashed primary keys, constraint/index signatures, sequences, workspace-null state, Payload/Mastra/RAG state, and vector-index state without row contents. The targeted probe checks workspace relationships, queues, and vector-query behavior. See docs/bootstrap/LocalDevelopmentStack.md for the full runbook.

Quality And Docs

  • git diff --check
  • mkdocs build --strict
  • pnpm lint
  • pnpm typecheck
  • pnpm test:int
  • pnpm test:e2e
  • pnpm test

Payload

  • pnpm payload
  • pnpm generate:types
  • pnpm generate:importmap

Run generated-file commands after Payload schema/admin component changes.

flowchart LR
  dev["Development"] --> pnpmDev["pnpm dev / devsafe"]
  quality["Quality and docs"] --> diff["git diff --check"]
  quality --> docs["mkdocs build --strict"]
  quality --> lint["pnpm lint"]
  quality --> typecheck["pnpm typecheck"]
  quality --> tests["pnpm test:int / test:e2e"]
  payload["Payload"] --> types["generate:types"]
  payload --> importmap["generate:importmap"]
  workers["Workers"] --> rag["rag:worker"]
  workers --> presentation["presentation:worker"]
  diagnostics["Diagnostics"] --> reports["reports and reconciliation"]

Seeders And Fixtures

  • pnpm seed
  • pnpm seed:rag:manifest
  • pnpm seed:rag:fixture
  • pnpm seed:presentation:fixture
  • pnpm fixture:rag:export
  • pnpm fixture:presentation:export

Script files:

  • scripts/seed.ts
  • scripts/seed-rag-manifest.ts
  • scripts/seed-rag-fixture.ts
  • scripts/seed-presentation-fixture.ts
  • scripts/export-rag-fixture.ts
  • scripts/export-presentation-fixture.ts

Presentation fixture export and import reject legacy compilation records and scene records without a valid v2 surface plan. Upload binaries retain their SHA-256 checks. Use a separate disposable database for a real recreation test; never reset a current database or named volume as part of routine verification.

Workers

  • pnpm rag:worker
  • pnpm presentation:worker
  • pnpm anuva:worker

The local Compose stack runs rag:worker and presentation:worker as separate services after web is healthy. Use the direct pnpm commands for targeted host-run work. The upgrade-path anuva:worker remains a manual process.

Diagnostics And Reports

  • pnpm diagnose:presentation:generation
  • pnpm requeue:presentation:job
  • pnpm reconcile:zoho-billing

Mastra Provider Registry

Use before changing model/provider strings:

node .agents/skills/mastra/scripts/provider-registry.mjs --list
node .agents/skills/mastra/scripts/provider-registry.mjs --provider openai

Command Notes

Most worker, seed, fixture, diagnostic, and billing scripts load .env through dotenv-cli.

The repository is standardized on pnpm. Keep pnpm-lock.yaml in sync with dependency changes.