Configuration

May 13, 2026 ยท View on GitHub

Configuration lives in JSONC files. The extension reads both and merges project over global key-by-key at the top level.

File locations

FileScopeFormat
.pi/cua.jsoncprojectJSONC
~/.pi/cua.jsonglobalJSON

Both are optional. When neither exists the defaults apply (local mode, Linux XFCE container).

Top-level schema

KeyTypeDefault
mode"local" | "localhost" | "cloud""local"
localobject{} (defaults)
localhostobject{} (defaults)
cloudobject{} (defaults)
pythonobject{} (defaults)
telemetryobject{ enabled: false }

local

KeyTypeDefault
runtime"auto" | "docker" | "qemu" | "lume" | "tart""auto"
image.os"linux" | "macos" | "windows" | "android""linux"
image.versionstringunset
image.kind"vm" | "container""container"
ephemeralbooleantrue

localhost

KeyTypeDefault
confirmDestructivebooleantrue

cloud

KeyTypeDefault
apiKeyEnvstring"CUA_API_KEY"
image.os"linux" | "macos" | "windows" | "android""linux"
image.versionstringunset
regionstringunset

python

KeyTypeDefault
executablestring"python3"
startupTimeoutMsinteger30000
requestTimeoutMsinteger60000

telemetry

KeyTypeDefault
enabledbooleanfalse

When false, the extension exports CUA_TELEMETRY_ENABLED=false to the Python daemon so Cua does not phone home.

Merge semantics

For each top-level key, project overrides global by replacing the corresponding object (with sub-keys also merged shallowly). Unknown top-level keys are rejected with an error - the loader will throw at session start to avoid silent misconfiguration.

Annotated example

{
  // Pick a mode. Local is default; explicit value shown here.
  "mode": "local",

  "local": {
    // 'auto' lets Cua decide based on image.os and image.kind.
    "runtime": "auto",
    "image": {
      "os": "linux",
      "version": "24.04",
      "kind": "container"
    },
    "ephemeral": true
  },

  "localhost": {
    "confirmDestructive": true
  },

  "cloud": {
    "apiKeyEnv": "CUA_API_KEY",
    "region": "north-america",
    "image": { "os": "linux" }
  },

  "python": {
    "executable": "python3.12",
    "startupTimeoutMs": 30000,
    "requestTimeoutMs": 90000
  },

  "telemetry": { "enabled": false }
}

JSON Schema

The schema lives at schema/cua.schema.json and is hand-maintained via scripts/generate-schema.mjs. Reference it from .pi/cua.jsonc for IDE validation:

{
  "$schema": "https://raw.githubusercontent.com/code-yeongyu/pi-cua-integration/main/schema/cua.schema.json",
  "mode": "local"
}