The API is the filesystem and the engine
Casa is local-first, so its programmatic surface is not a hosted REST API. It is the engine CLI, the brain files, and their formats: stable interfaces any script, agent, or harness can drive.
There is no capx.ai endpoint to call and no API key to manage. Everything on this page runs on your machine, against your repository.
Engine CLI
The deterministic engine ships as Node CLIs with zero runtime dependencies. The reference harness's skills wrap these commands; any shell-capable agent or script can call them directly.
node casa/engine/casa.mjs route # compute the eligible playbook setnode casa/engine/casa.mjs next # rank ready work against the constraintnode casa/engine/casa.mjs state get # read canonical state as JSONnode casa/engine/casa.mjs gates check # list actions waiting on a human| Command | Reads | Writes |
|---|---|---|
route | build-map.json, state.json | Nothing; pure |
next | state.json, pulse, ledger.jsonl | Nothing; pure |
state get | state.json | Nothing |
state set | state.json | state.json, via validated transition |
gates check | dials.json, ledger.jsonl | Nothing |
Engine commands that answer questions never mutate. The only engine writer is state set, and it validates every transition against the same rules the reference harness uses.
Attestation commands
Rendering, signing, and checking an attestation are local operations. Casa renders. The sidecar signs. There is no network step.
node caf/keygen.mjs company-brainnode scripts/brain.mjs attest company-brainnode caf/sign.mjs company-brainnode caf/check.mjs company-brain| Command | Reads | Writes |
|---|---|---|
caf/keygen.mjs | Nothing (creates keys) | A local signing identity |
brain.mjs attest | The company brain | A CAF projection |
caf/sign.mjs | The projection | A signed envelope |
caf/check.mjs | The signed envelope | Nothing; offline self-check |
caf check is a self-check, not a verdict. Passing means the record is internally coherent and structurally legal. It does not mean the record is true.
File formats
| File | Format | Contract |
|---|---|---|
NOW.md | Markdown | Human-first operating summary, regenerated each session |
profile.json | JSON | Confirmed company identity; changes only with your approval |
build-map.json | JSON | The selected, sequenced playbook graph |
state.json | JSON | Canonical state; one writer, validated transitions |
ledger.jsonl | JSONL | Append-only events: activity, approvals, learnings |
dials.json | JSON | Per-department autonomy settings |
outputs/ | Markdown | Operator deliverables, organized by department |
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Invalid input or unreadable brain |
2 | Refused: the action is behind a human gate |
3 | State conflict: the transition is not valid from the current state |
Stability
- Brain file formats are versioned; changes are additive wherever possible
- Engine commands and flags stay stable within a major version
- Anything not documented here is internal and may change without notice
