Kazzle CLI
Use the Kazzle CLI to run app commands in development and preview:-- 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
enventry inkazzle.config.ts PORTandHOST- 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:
--app=<appId>on the command lineKAZZLE_APP_IDenv var (set automatically when Kazzle starts a supervised component).kazzle/link.jsonwalked up from the current directory
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:
app { action: "link", appId }.