Skip to content

CLI scripts

Carabase ships a set of pnpm scripts that wrap shell scripts under scripts/. The shell scripts are the canonical implementation; the pnpm script is just a typed alias.

ScriptWhat it does
pnpm bootstrapOne-command first-run setup: pre-flight checks → install → env scaffold → migrate → seed
pnpm bootstrap --env <env>Same, for staging or prod
pnpm setup:env <env>Just the env-scaffold step (idempotent; refuses to overwrite without --force)
pnpm setup:envsCreate + migrate all three databases (idempotent)
pnpm dev:devRun the host against the dev DB with file-watching
pnpm dev:stagingSame, against staging
pnpm start:prodRun the built host against prod
ScriptWhat it does
pnpm db:generateDrizzle migration codegen from schema
pnpm db:migrateRun migrations against current DATABASE_URL
pnpm db:migrate:<env>Run migrations against a specific env
pnpm db:seedTiny 4-entity hand-written CI fixture
pnpm db:seed:<env>Same, scoped to an env
pnpm db:seed:evalRealistic sam-rivera fixture (~30 entities, ~90 daily notes)
pnpm db:seed:eval:<env>Same, scoped (no :prod — refuses)
pnpm db:reset:dev / :stagingTruncate + reseed
pnpm db:studioDrizzle Studio (DB browser)

There is intentionally no pnpm db:reset:prod. To wipe prod, you have to type CARABASE_I_KNOW=1 ./scripts/with-env.sh prod -- tsx src/db/reset.ts yourself.

ScriptWhat it does
pnpm testVitest test suite
pnpm test:ciSame with JSON reporter for CI
pnpm checkBiome lint + format check
pnpm lintBiome CI mode (stricter)
pnpm smoke:mcpRun the in-memory MCP smoke (every Phase 11–15 capability)
pnpm smoke:e2eFull E2E smoke against a throwaway scratch DB
pnpm smoke:prod --url <host>Read-only prod smoke against a deployed host
pnpm eval:agentPhase 12 agent-eval harness (replays scripted trajectories)
ScriptWhat it does
pnpm deploy:prodBackup → pull → migrate → build → restart → smoke → auto-rollback
pnpm deploy:prod --tag v0.2.0Pin to a specific release tag
pnpm rollback:prod --to <ref>Manual rollback (no migrations)
pnpm install-prod-serviceInstall the launchd LaunchAgent (KeepAlive=true)
ScriptWhat it does
pnpm backup:dev / :staging / :prodEncrypted nightly backup
pnpm backup:prune <env>Apply 7d / 4w / 3m retention policy
pnpm backup:statusReport age of latest backup per env. Non-zero exit if any FAIL
pnpm backup:restore <env> <file>Interactive restore. Production guardrail in place
pnpm backup:install-cron <env>Install the launchd backup cron (03:17 nightly)
ScriptWhat it does
pnpm buildBuild admin SPA + TypeScript compilation
pnpm build:adminBuild just the Admin SPA
pnpm docs:devLocal dev server for the docs site (this site)
pnpm docs:buildProduction build of the docs site
ScriptWhat it does
./scripts/gen-secret.sh [bytes]Print a fresh hex secret (default 32 bytes / 256 bits)
./scripts/agent-pickup.sh <issue>Headless issue-to-PR automation
./scripts/auto-fix.shAutonomous test-failure repair loop