OpenSana Docs
CLI Internals

CLI Architecture Overview

Understand the CLI as the bridge between OpenSana threads and local agent runtimes.

The CLI is a bridge between the OpenSana backend and local or remote machines that can run agent runtimes.

Responsibilities

  • register a session
  • maintain heartbeats
  • subscribe to pending thread work
  • claim threads
  • run the selected runtime
  • stream output back to the server

Core Shape

Web UI <-> Convex backend <-> OpenSana CLI <-> local runtime

Main Code Areas

  • command surface in apps/cli/src/commands
  • thread processing in apps/cli/src/agent/app
  • runtime adapters in apps/cli/src/agent/runtimes
  • subprocess SDK in apps/cli/src/agent/sdk

On this page