Skip to main content

CLI overview

The warden CLI is a thin HTTP client: every command talks to the engine at ENGINE_URL. There is no direct Postgres access from the CLI. This section walks through install, health check, and the command map in sidebar order — deploy and list, start and monitor, HITL review, then saga recovery.

If you prefer curl or are building your own control plane, the API guides mirror the same flows. For a hands-on runbook that uses every major command, see Demo: GitHub MCP in Getting Started.

Set the engine URL once before any command:

export ENGINE_URL=http://127.0.0.1:8000

If ENGINE_URL is unset, the CLI exits with an explicit error before making any request.

Install

Clone the repository, then install CLI dependencies:

git clone https://github.com/warden-runtime/warden-core.git
cd warden-core
make sync-dev
# or: uv sync --extra dev --extra engine --extra worker --extra cli

That creates .venv/ and installs the warden entry point at .venv/bin/warden. The CLI is not on your global PATH — activate the virtualenv or use uv run:

source .venv/bin/activate # then: warden ping, warden deploy, …
uv run warden ping # no activation; prefix every CLI command with uv run

For the full dev stack (Postgres, engine, worker), see Installation.

Health check

Verify the engine is reachable before running anything else:

warden ping

(With no activated venv, use uv run warden ping.)

A successful response confirms the engine is up and the URL is correct. Add --json for the raw health payload.

Commands

The table below is the operator map. Most day-to-day work uses deploy, start saga, list, and review; recovery commands are for stuck steps after automatic timeouts have had time to run.

CommandWhat it does
warden deployRegister a manifest (worker or saga) with the engine
warden list definitionsInspect deployed worker and saga definitions
warden start sagaStart a saga instance
warden list sagasList saga instances and their status
warden list stepsList step rows for one saga (--trace-id required) — status index only
warden show stepShow one step's inputs, output, prompt ref, and errors (--step-id or step_span_id)
warden reviewApprove, reject, or HITL-retry steps in AWAITING_HUMAN
warden saga retry-stepRe-queue a stuck forward step (IN_PROGRESS on a RUNNING saga)
warden saga retry-compensationRe-run a failed or stalled compensation step
warden pingHealth-check the engine
warden --versionPrint the CLI version

Most list commands and ping support --json for machine-readable output. Use warden list steps --trace-id … --json for timing and error_details on failed steps. Use warden show step for resolved inputs and output_payload.

Operator retry matrix

During an incident, pick the row that matches the step and saga status — do not mix HITL retry with forward or compensation recovery. The same matrix appears in API overview → Operator retry matrix.

ActionHTTPCLIStep statusSaga statusWhen to use
HITL re-runPOST .../retrywarden review retryAWAITING_HUMANAWAITING_HUMANOperator wants the agent to try again with guidance
HITL approve/rejectPOST .../decisionwarden review approve / rejectAWAITING_HUMANAWAITING_HUMANHuman decision to continue or reject
Forward recoveryPOST .../retry-stepwarden saga retry-stepIN_PROGRESS (stuck)RUNNINGWorker/claim/outbox stall after automatic reap window; use --force if a non-stale claim still blocks redelivery
Compensation recoveryPOST .../retry-compensationwarden saga retry-compensationfailed/stuck compCOMPENSATINGUndo step failed or stalled

Not in this matrix: LLM transient backoff (WARDEN_LLM_RETRY_* in Configuration) and saga restart (warden start saga). A bare retry-step returns claim_active when a worker still holds a non-stale claim — wait for automatic reap or pass --force (--allow-destructive on commit steps). Full recovery ladder: Saga recovery.

Enterprise

When WARDEN_PLUGINS is set, warden audit is registered automatically. See Open Core vs Enterprise for details.

Exit codes

CodeMeaning
0Success
1Failure — unreachable engine, local validation error, or HTTP conflict. For automated pipelines, parse stderr or use --json on supported commands.

What's next

You now have the command map and retry matrix. Deploy and list registers manifests and confirms what the engine knows about; from there you start instances, watch them run, handle HITL holds, and recover stuck steps in the pages that follow.