Skip to content

CLI and TUI

Caracal ships two terminal tools:

  • caracal — command-line interface for stack management, token injection, and administrative operations against the control-plane API.
  • caracal-tui — interactive terminal UI for browsing zones, applications, resources, policies, sessions, agents, and audit events.

Both tools are compiled with Bun for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64). The runtime is self-contained — no separate Node.js installation is required.


Most caracal commands communicate with the control-plane API. Set these environment variables before using admin commands:

VariableDefaultPurpose
CARACAL_ADMIN_TOKENBearer token for all /v1/* admin API routes. Required for all admin and observability commands.
CARACAL_API_URLhttp://localhost:3000Control-plane API base URL. In production, set this to your API service address.
CARACAL_ZONE_IDFrom caracal.tomlDefault zone for zone-scoped commands. Override per command with --zone.
CARACAL_COORDINATOR_URLhttp://localhost:4000Coordinator service URL. Required only for agent and delegation commands.
CARACAL_COORDINATOR_TOKENJWT with scope agent:lifecycle. Required only for agent and delegation commands.
CARACAL_CONFIGAuto-resolvedExplicit path to caracal.toml. Overrides automatic discovery.

CARACAL_ADMIN_TOKEN is discovered in order: the environment variable → infra/docker/.env.env in the current directory. The caracal init command writes caracal.toml with the local stack credentials after bootstrapping.

In production (NODE_ENV is not development), CARACAL_API_URL and CARACAL_COORDINATOR_URL must be set explicitly. In development, localhost defaults are used.


These flags are accepted by all commands:

FlagDescription
--zone <id>Zone ID for zone-scoped commands. Overrides CARACAL_ZONE_ID and caracal.toml.
--jsonEmit JSON to stdout instead of a formatted table. Suitable for piping to jq.
--help, -hPrint command help and exit.

SectionCommandsPurpose
Stackup, down, status, initStart, stop, probe, and provision the local stack
Runtimerun, credential readInject mandates into subprocesses and print tokens
Adminzone, app, resource, provider, policy, policy-set, grant, sessionManage all control-plane entities
Observabilityaudit tail, explainTail the audit stream and inspect policy decisions
Agents and Delegationagent, delegationInspect and control agent sessions and delegation edges
Configuration Filecaracal.tomlConfig layout, lookup order, credential injection
TUI Walkthroughcaracal-tuiInteractive terminal browser for all admin entities

By default, commands render a left-aligned ASCII table:

id name registration_method
-- ---- -------------------
app_abc123 My App managed
app_def456 Service Bot dcr
  • null values display as -.
  • Arrays display as comma-separated values.
  • Empty result sets display (no rows).

Pass --json to receive 2-space-indented JSON on stdout:

Terminal window
caracal zone list --json | jq '.[].id'

Errors are written to stderr. Exit code 0 indicates success; 1 indicates a CLI or API error.