tulipfarm docs
Reference

Commands

The scripts that set up, run, and check a TulipFarm checkout.

TulipFarm is a pnpm + Turborepo monorepo. Run these from the repository root unless noted. The package manager is pnpm — do not substitute npm or yarn.

Setup

CommandWhat it does
bash scripts/setup-dev.shInstalls PostgreSQL 17 + pgvector, starts the database, creates the tulipfarm database, initializes the soul repo at ~/.tulipfarm/soul, and writes .env.local with generated secrets.
pnpm installInstalls workspace dependencies. Use --frozen-lockfile in CI.
pnpm reset:devTears down the local dev database and soul, then re-runs setup. Use when you want a clean slate.

Run

CommandWhat it does
pnpm devStarts the API (:4010) and web UI (:4000) together.
pnpm dev:apiStarts only the API.
pnpm dev:webStarts only the web UI.
pnpm dev:docsStarts this documentation site (:4020).
curl http://localhost:4010/healthChecks API health; returns { "status": "ok" }.

Build and check

CommandWhat it does
pnpm buildBuilds every workspace through Turbo.
pnpm lintRuns Biome across all workspaces.
pnpm typecheckRuns tsc --noEmit across all workspaces.
pnpm testRuns the Vitest suites.

Single workspace

Target one workspace with a filter:

pnpm --filter @tulipfarm/api dev
pnpm --filter @tulipfarm/web test
pnpm --filter @tulipfarm/docs build

Secrets and encryption

These run against a local or production instance. They read .env.local and DATABASE_URL.

CommandWhat it does
pnpm --filter @tulipfarm/api keys verifyChecks that the active DEK unwraps correctly under the current ENCRYPTION_KEY. Run after a key rotation to confirm the new key works.
pnpm --filter @tulipfarm/api keys show-recoveryMints the offline recovery key and prints it once. Store it in a password manager or sealed vault — it is never shown again.
pnpm --filter @tulipfarm/api keys rotate-kekRe-wraps the DEK under the new ENCRYPTION_KEY. Requires both ENCRYPTION_KEY (new) and ENCRYPTION_KEY_PREVIOUS (old) to be set.
pnpm --filter @tulipfarm/api keys recoverRecovers a lost ENCRYPTION_KEY using the offline recovery key. Set RECOVERY_KEY=<base64> in the environment before running.
pnpm --filter @tulipfarm/api keys backfillMigrates secrets written before envelope encryption onto the DEK. Idempotent and resumable.

On this page