Skip to main content

Kazzle CLI

Use the Kazzle CLI to run app commands in development and preview:
Everything after -- is the real command. Kazzle injects the runtime environment first. kazzle run is for development and preview only. It belongs in the dev script, never in start. In production, the deployed runtime injects PORT, HOST, and secrets directly, and the production command is the bare command (e.g. bun run index.ts). The kazzle CLI is not installed in deployed images, so a production command that calls kazzle run crashes with kazzle: command not found.

What kazzle run injects

  • secrets from the component’s env entry in kazzle.config.ts
  • PORT and HOST
  • sibling component URLs like KAZZLE_APP_COMPONENT_SERVER_URL
  • Kazzle runtime identity such as app ID and component name

Example

dev runs through kazzle run so Kazzle can inject the preview port and runtime env. start is the bare command — production injects PORT/HOST/secrets itself. Do not put secret collection names in package.json. Put them in kazzle.config.ts.

Linking a checkout to an app

kazzle run needs to know which app this directory belongs to. Resolution order:
  1. --app=<appId> on the command line
  2. KAZZLE_APP_ID env var (set automatically when Kazzle starts a supervised component)
  3. .kazzle/link.json walked up from the current directory
If none of those resolve, kazzle run exits with:
app { action: "create" } writes <checkout>/.kazzle/link.json automatically — like Vercel’s .vercel/project.json. The file is per-clone and gitignored. After a fresh git clone of an existing app, run:
The AI can repair a missing link from a thread with app { action: "link", appId }.