Kernlift

Scripts

Every pnpm script in the template's package.json except the individual validators, grouped by what you use it for.

Run each with pnpm <name> from the project root. Scripts that touch the database read DATABASE_DIALECT and DATABASE_URL from .env or the shell. The individual validate:* scripts are listed in Validators.

Develop

ScriptDoes
pnpm devStarts the web app with Vite on port 5173
pnpm dev:agentStarts the web app together with the Agent service (agent-starter), with local addresses and temporary signing secrets
pnpm kernliftRuns the Kernlift CLI in tools/kernlift, for example pnpm kernlift deploy-target fly. See deploy.config.json
pnpm previewServes the last build with vite preview
pnpm cf-typegenGenerates worker-configuration.d.ts, the Workers runtime and binding types the source compiles against
pnpm assets:generateRegenerates the placeholder site icons and social share image
pnpm assets:screenshotsCaptures marketing screenshots from a running local instance through Chrome; CHROME_PATH picks the executable

Build and run

ScriptDoes
pnpm buildBuilds for the platform recorded in deploy.config.json: the Cloudflare Worker, or the Node server for every other platform
pnpm build:cloudflareBuilds the Cloudflare Worker regardless of deploy.config.json
pnpm build:nodeBuilds the Node server and bundles the administrator bootstrap into .output/scripts/ for production images
pnpm build:agent-serviceBuilds the separate Agent service package
pnpm startRuns the Node build (.output/server/index.mjs)
pnpm deployRuns the chosen platform's deploy command; wrangler deploy in a Cloudflare project

Database

ScriptDoes
pnpm db:migrateApplies the migration chain of the configured dialect, and prints the database state when it cannot
pnpm db:migrate:runtimeApplies the same migrations with plain Node and no TypeScript tooling; the release step of production images
pnpm db:migrate:d1:localApplies the SQLite chain to the local D1 database through wrangler
pnpm db:migrate:d1:remoteApplies the SQLite chain to the deployed D1 database
pnpm db:generateRuns drizzle-kit generate for the dialect in DATABASE_DIALECT
pnpm db:generate:sqliteGenerates a migration for the SQLite schema
pnpm db:generate:postgresGenerates a migration for the Postgres schema
pnpm db:studioOpens Drizzle Studio on the configured database
pnpm db:seed-baselineWrites baseline content a fresh database needs: email templates, marketing pages and blocks, rate-limit rules. Existing rows are left alone
pnpm db:bootstrap-super-adminCreates the first administrator from SUPER_ADMIN_EMAIL and SUPER_ADMIN_PASSWORD, writes the permission catalogue and runs the baseline seed
pnpm db:seedSeeds nothing; prints that baseline content comes from pnpm db:seed-baseline
pnpm db:encrypt-config-secretsEncrypts the secret admin config values still stored as plaintext, with CONFIG_ENCRYPTION_KEY from .env or the shell. Values already encrypted are skipped, so a second run changes nothing; without a valid key it exits with an error. On D1 it uses the local state by default, --remote for the deployed database and --persist-to <dir> for another local state

Jobs

ScriptDoes
pnpm jobs:runRuns one round of the scheduled jobs and prints its report, or "skipped" when another runner holds the round. Exits non-zero when a job failed

Agent

ScriptDoes
pnpm agent:publish-skillsPublishes every platform Skill whose bundled content changed to the skill registry; SKILL_PUBLISH_DRY_RUN previews without writing

Registry and skills

registry:build checks the module manifests against the code; see Build a module. registry:publish uploads the result to a registry server, which a project cloned from GitHub does not have.

ScriptDoes
pnpm registry:buildSlices the checkout into a foundation item and one item per modules/<key>/module.json, into registry/dist
pnpm registry:publishPushes registry/dist to the registry at KERNLIFT_REGISTRY_URL with KERNLIFT_PUBLISH_TOKEN
pnpm skills:packBuilds packages/kernlift-skills from skills/ and writes its skills.json manifest

Checks

ScriptDoes
pnpm typechecktsc --noEmit, including the unit tests in tests/
pnpm testRuns the unit tests in tests/unit/*.test.ts with Node's test runner (tsx --test). They cover signing, verification, amounts and encryption, and need no database or network
pnpm checkbiome check .: lint and format check; reports pre-existing violations
pnpm lintbiome lint .
pnpm lint:budgetFails when a lint rule has more violations than its recorded budget; --update lowers the budget after a real reduction
pnpm formatbiome format --write .
pnpm validate:allRuns the wired validator chain in order and stops at the first failure
pnpm validate:gateRuns every validator except the manual and known-failing ones; what CI gates on
pnpm openspec:validateRuns openspec-cn validate for every active change with a tasks.md
pnpm smoke:nodeRuns the Node build on a throwaway SQLite database without the Agent service; run pnpm build:node first
pnpm smoke:workerRuns the built Worker under local wrangler dev on a throwaway D1 database without the Agent service; run pnpm build first

Do not run biome check --write --unsafe across the repository. Its fixes strip !important from the stylesheet and rewrite React hook dependency arrays, both of which change behaviour.

Next steps