Covendocs

Architecture

How Coven is structured under the hood.

System Overview

Rendering diagram…

Coven Architecture

Coven is a local-first harness substrate. The Rust CLI/daemon is the authority layer; clients such as the CLI/TUI, CastCodes, Cast Agent, and the optional OpenClaw plugin are presentation/integration layers.

The versioned local socket API contract lives in Coven Local API. Clients should use GET /api/v1/health and negotiate against apiVersion: "coven.daemon.v1" and the capabilities object before depending on session or event response shapes. All error responses use the structured { error: { code, message, details } } envelope documented there.

Runtime Topology

Rendering diagram…

Session Lifecycle

Rendering diagram…

Authority Boundary

Rendering diagram…

Cast Codes are parsed intent. Every sensitive request they produce is still revalidated by the Rust daemon.

Cast Agent Request Flow

Rendering diagram…

Automation Boundary

Coven is the canonical shared local runtime for reusable automation because it centralizes the authority surfaces below.

Automation authority surfaces
SurfaceGroupReason
Daemon/process ownershipRuntimeOne process owns launch, liveness, input, and kill decisions.
Policy and permission decisionsPolicySensitive choices fail closed at the daemon boundary.
Config/profile storageStateClients read state instead of inventing drift-prone local copies.
Capability discoveryControl planeClients can show only supported actions.
Action routing and event emissionControl planeAdapter actions stay inspectable and replayable.
Adapter ownershipAdaptersAccessibility, AppleScript, keyboard/mouse, window, filesystem, clipboard, and app-specific bridges stay behind Coven.

The intended flow is:

user -> client -> Coven -> adapters -> desktop/apps
desktop/apps -> Coven -> client UI updates

GET /api/v1/capabilities lets clients discover what Coven can route. POST /api/v1/actions gives clients a stable intent envelope without coupling them directly to brittle OS automation APIs.

Future Adapter Boundary

Coven's current public runtime is single-harness per session. The daemon already keeps the right lower-level boundary for future coordination work: clients can discover capabilities, launch known harnesses, read events, and preserve project-root enforcement in Rust.

Do not document future orchestration commands as user-facing until they exist in the CLI and socket API. Future coordination layers should build above the current session/event contract without bypassing daemon validation.

Current User-facing Surface

Current user-facing commands
SurfaceCategoryBehavior
CovenCLI (coven and coven tui)Entry pointOpen the beginner-friendly slash-command palette.
coven doctorDiagnosticsChecks store/project/harness readiness and prints next steps.
coven daemon start/status/restart/stopDaemonManages the local daemon.
coven run codex|claude <prompt>LaunchLaunches a project-scoped PTY session.
coven sessionsSessionsOpens the human session browser; --plain keeps scriptable output.
Session browser actionsSessionsSurfaces Rejoin, View Log, Summon, Archive, and Sacrifice.
coven attach|summon|archive|sacrifice <session-id>SessionsKeeps explicit lower-level verbs available for scripts and copy/paste workflows.

Distribution Snapshot

The npm wrapper packages are published for early adopters.

Published npm packages
PackageTargetRole
@opencoven/cliUniversal wrapperUser-facing install entrypoint.
@opencoven/cli-macosmacOSPlatform binary package.
@opencoven/cli-linux-x64Linux x64Platform binary package.
@opencoven/cli-windowsWindows x64Platform binary package.

The source package versions stay template-like in the repo; release workflow dispatch supplies the published version and builds platform packages. Check the npm registry and GitHub releases before making version-specific release claims.

Last updated on

On this page