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
| Script | Does |
|---|---|
pnpm dev | Starts the web app with Vite on port 5173 |
pnpm dev:agent | Starts the web app together with the Agent service (agent-starter), with local addresses and temporary signing secrets |
pnpm kernlift | Runs the Kernlift CLI in tools/kernlift, for example pnpm kernlift deploy-target fly. See deploy.config.json |
pnpm preview | Serves the last build with vite preview |
pnpm cf-typegen | Generates worker-configuration.d.ts, the Workers runtime and binding types the source compiles against |
pnpm assets:generate | Regenerates the placeholder site icons and social share image |
pnpm assets:screenshots | Captures marketing screenshots from a running local instance through Chrome; CHROME_PATH picks the executable |
Build and run
| Script | Does |
|---|---|
pnpm build | Builds for the platform recorded in deploy.config.json: the Cloudflare Worker, or the Node server for every other platform |
pnpm build:cloudflare | Builds the Cloudflare Worker regardless of deploy.config.json |
pnpm build:node | Builds the Node server and bundles the administrator bootstrap into .output/scripts/ for production images |
pnpm build:agent-service | Builds the separate Agent service package |
pnpm start | Runs the Node build (.output/server/index.mjs) |
pnpm deploy | Runs the chosen platform's deploy command; wrangler deploy in a Cloudflare project |
Database
| Script | Does |
|---|---|
pnpm db:migrate | Applies the migration chain of the configured dialect, and prints the database state when it cannot |
pnpm db:migrate:runtime | Applies the same migrations with plain Node and no TypeScript tooling; the release step of production images |
pnpm db:migrate:d1:local | Applies the SQLite chain to the local D1 database through wrangler |
pnpm db:migrate:d1:remote | Applies the SQLite chain to the deployed D1 database |
pnpm db:generate | Runs drizzle-kit generate for the dialect in DATABASE_DIALECT |
pnpm db:generate:sqlite | Generates a migration for the SQLite schema |
pnpm db:generate:postgres | Generates a migration for the Postgres schema |
pnpm db:studio | Opens Drizzle Studio on the configured database |
pnpm db:seed-baseline | Writes baseline content a fresh database needs: email templates, marketing pages and blocks, rate-limit rules. Existing rows are left alone |
pnpm db:bootstrap-super-admin | Creates the first administrator from SUPER_ADMIN_EMAIL and SUPER_ADMIN_PASSWORD, writes the permission catalogue and runs the baseline seed |
pnpm db:seed | Seeds nothing; prints that baseline content comes from pnpm db:seed-baseline |
pnpm db:encrypt-config-secrets | Encrypts 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
| Script | Does |
|---|---|
pnpm jobs:run | Runs 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
| Script | Does |
|---|---|
pnpm agent:publish-skills | Publishes 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.
| Script | Does |
|---|---|
pnpm registry:build | Slices the checkout into a foundation item and one item per modules/<key>/module.json, into registry/dist |
pnpm registry:publish | Pushes registry/dist to the registry at KERNLIFT_REGISTRY_URL with KERNLIFT_PUBLISH_TOKEN |
pnpm skills:pack | Builds packages/kernlift-skills from skills/ and writes its skills.json manifest |
Checks
| Script | Does |
|---|---|
pnpm typecheck | tsc --noEmit, including the unit tests in tests/ |
pnpm test | Runs 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 check | biome check .: lint and format check; reports pre-existing violations |
pnpm lint | biome lint . |
pnpm lint:budget | Fails when a lint rule has more violations than its recorded budget; --update lowers the budget after a real reduction |
pnpm format | biome format --write . |
pnpm validate:all | Runs the wired validator chain in order and stops at the first failure |
pnpm validate:gate | Runs every validator except the manual and known-failing ones; what CI gates on |
pnpm openspec:validate | Runs openspec-cn validate for every active change with a tasks.md |
pnpm smoke:node | Runs the Node build on a throwaway SQLite database without the Agent service; run pnpm build:node first |
pnpm smoke:worker | Runs 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.