This page is the full local dev and testing loop for a pack. It assumes you have a pack already scaffolded — if not, start at Your first pack.Documentation Index
Fetch the complete documentation index at: https://docs.khal.ai/llms.txt
Use this file to discover all available pages before exploring further.
The FDE rule is test local first. Use this page for pack-level build/test work, then follow the FDE environment ladder to move from local PM2/dev-local proof into shared dev, customer dev/HML, and production gates.
Build and watch
From the pack repo root:.d.ts outputs into package/dist/. The publish pipeline only ships what’s under package/.
Typecheck and lint
Unit tests
Vitest is the default. A tiny NATS mock is enough for most frontend tests:Integration tests
For full-stack packs, a lightweight integration test talks to your service over a local NATS instance:Start a local NATS
Any NATS server will do — e.g.,
nats-server -js if you have it installed, or a Docker one-liner.Point your service at it
Set
KHAL_NATS_URL=nats://localhost:4222 when running the service in test mode.The khal developer CLI
@khal-os/app-kit ships the public khal CLI. Install it from npmjs and use it for scaffolding, auth, install dry-runs, target context, doctor checks, logs, and the bundled design-system catalog.
Key commands:
khal new app <name>— scaffold a new app from the bundledapptemplate; alsokhal new service <name>andkhal new workflow <name>.khal install . --target dev --dry-run --json— validate a generated repo before touching a target.khal doctor --target dev— check local and target prerequisites.khal dev design-system— serve the bundled feature catalog and design-system recipes.
For the first-run install/login/scaffold path, start with FDE CLI quickstart. The legacy
khal-dev binary is no longer the public FDE surface.Debug tips
Frontend: DevTools
The shell runs in a browser (or Tauri WebView).
F12 opens DevTools — console, network, React DevTools all work.Service: container logs
docker logs -f <container> while running the service via docker run locally. In a deployed instance, logs flow through the platform’s standard log pipeline — your customer admin knows how to read them.NATS traffic: pack-nats-viewer
The reference
pack-nats-viewer app lets you see subjects flowing through your pack’s namespace. Invaluable for debugging message plumbing.Manifest validation
khal-app.json is validated by @khal-os/types; run khal install . --target dev --dry-run --json for the current source/manifest/env preflight before mutating a target.
What’s next
Publish your pack
Push → CI builds → publish.
khal-app.json reference
The full manifest schema.