This guide gets a local Cake Agents development environment running. The default and preferred path is the full AWS/Kubernetes-backed flow. A sandboxed fallback exists for environments without cluster access.Documentation Index
Fetch the complete documentation index at: https://docs.cake.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Install these tools before you start. Runnpm run doctor at any
point to verify your setup.
- Node — version pinned in
.node-version - npm — bundled with Node
- direnv — loads
.envrcautomatically - Nix (recommended) — provides the flake dev shell
- kubectl and ktunnel — required for the default AWS/K8s flow
- Docker — needed for some tests and image builds
- Helm — needed for the Helm deploy workflow
Default flow (AWS/Kubernetes)
This flow loads environment variables from.envrc, brings up a Postgres
connection, and connects to the dev Kubernetes cluster used by real session
data planes.
Start the dev server
Open the UI
The web app listens on http://localhost:4000.
Sandboxed fallback (no AWS/K8s)
Use this mode only when AWS or Kubernetes access is unavailable — for example, no SSO, no cluster credentials, or nokubectl / ktunnel. Data
plane behavior is not representative of normal local development.
/api to the backend (port 4001).
Required environment variables
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string. The server will not start without it. |
DATA_PLANE_IMAGE | Container image used for session data plane pods. dev:local sets a dummy default. |
DATA_PLANE_INIT_IMAGE | Init container image for data plane pods. dev:local sets a dummy default. |
| Variable | Default | Description |
|---|---|---|
PORT | 4000 | Server port |
NODE_ENV | development | Environment mode |
KUBE_CONTEXT | in-cluster | Kubernetes context name |
SESSION_NAMESPACE | opencode-sessions | Namespace for session workloads |
Quality checks and tests
Frompackages/web:
Troubleshooting
- Missing executables — Load the Nix flake dev shell with
nix develop --command <command>, or trust direnv withdirenv allow. initdb/pg_ctlnot found — Run them through the flake:nix develop --command initdb -D ~/.local/state/cake-agents/pgdata --no-locale --encoding=UTF8 -A trust -U postgres.- Postgres pod crash loops — The official Postgres 18 image expects the PVC
mounted at
/var/lib/postgresql. For disposable dev data, delete the release’s Postgres PVC once so a fresh data directory is created.