CLI reference
Sadie’s scripts live in the root package.json and are fanned out to workspace packages by Turbo where appropriate. Package manager is pnpm@10.33.0.
./sadie
Section titled “./sadie”The one-command bootstrap at the repo root. Installs dependencies if missing, confirms .env.local exists, and launches pnpm dev:all: Next.js + Yjs collab + scheduler in one shell.
./sadiePrints a short banner with the three local URLs and exits cleanly on Ctrl-C.
pnpm dev
Section titled “pnpm dev”Runs Next.js dev server against apps/app on localhost:3000.
pnpm devBacked by next dev -p 3000 in the app workspace. Only process that runs; Studio multiplayer and the cadence scheduler are not included.
pnpm dev:collab
Section titled “pnpm dev:collab”Runs the Yjs y-websocket server at scripts/collab-server.mjs. Required for Studio multiplayer; optional for solo editing (y-indexeddb persists locally).
pnpm dev:collabDefault bind ws://127.0.0.1:1234. Override with COLLAB_HOST / COLLAB_PORT.
pnpm dev:scheduler
Section titled “pnpm dev:scheduler”Runs the cadence scheduler at scripts/scheduler.mjs. Periodically POSTs to /api/compile/run and /api/feeds/refresh-all using SADIE_CRON_SECRET.
pnpm dev:schedulerLoads env via --env-file=.env.local. Without the cron secret, it logs and no-ops.
pnpm dev:all
Section titled “pnpm dev:all”All three (dev, dev:collab, dev:scheduler) in one shell via concurrently. This is what ./sadie wraps.
pnpm dev:allpnpm build
Section titled “pnpm build”Turbo-fanned build across the workspace.
pnpm buildFor the Cloudflare deploy target, use the app-specific script:
pnpm --filter @sadie/app build:cfWhich runs next build followed by @opennextjs/cloudflare build. See Cloudflare Pages deploy.
pnpm lint
Section titled “pnpm lint”Turbo-fanned lint. In the app, this is eslint . --ext .ts,.tsx --max-warnings=0: zero tolerance.
pnpm lintpnpm typecheck
Section titled “pnpm typecheck”Turbo-fanned tsc --noEmit. Catches type errors across the whole monorepo without producing artifacts.
pnpm typecheckpnpm test
Section titled “pnpm test”Turbo-fanned test. In the app, runs tsx --test tests/**/*.test.ts.
pnpm testpnpm db:migrate
Section titled “pnpm db:migrate”Replays packages/db/drizzle/*.sql against DATABASE_URL in order. Production-safe and idempotent.
pnpm db:migrateSee Migrations.
pnpm db:push
Section titled “pnpm db:push”Diffs packages/db/src/schema.ts against the live database and applies the changes directly, without recording a migration. Destructive for renames; use on empty databases only.
pnpm db:pushpnpm db:reset
Section titled “pnpm db:reset”Wipes the database and re-seeds demo fixtures: seven wiki entries, two briefs, eight sources, five feeds, ten feed items, three Studio documents, two conversations, nine activity events, three discourse opportunities.
pnpm db:resetUseful for resetting dev state to a known baseline. Runs apps/app/scripts/reset.ts with .env.local loaded.
pnpm verify:health
Section titled “pnpm verify:health”CI gate. Spawns next dev, bootstraps a session cookie, curls every canonical route (Today / Chats / Studio / Memory graph+wiki+sources+briefs+soul+activity / Feeds / Access / Settings), asserts every response is 200, and checks /api/internal/health. Exits non-zero on failure.
pnpm verify:healthImplementation at scripts/verify-health.mjs.
Workspace-scoped scripts
Section titled “Workspace-scoped scripts”Drill into one package by filtering:
# app onlypnpm --filter @sadie/app devpnpm --filter @sadie/app buildpnpm --filter @sadie/app lintpnpm --filter @sadie/app typecheckpnpm --filter @sadie/app testpnpm --filter @sadie/app build:cfpnpm --filter @sadie/app deploy # build:cf + wrangler pages deploy
# db onlypnpm --filter @repo/db db:migratepnpm --filter @repo/db db:pushpnpm --filter @repo/db exec drizzle-kit generateTurbo config
Section titled “Turbo config”turbo.json at the repo root controls the fan-out. build, lint, typecheck, test each declare their inputs and the workspaces they apply to. Running a top-level script (pnpm lint) invokes the workspace-level script (eslint in the app, etc.) through Turbo’s cache.