| Command | What it does |
|---|---|
run | Runs a workflow. |
validate | Checks a workflow without running it, and prints its plan. |
visualize | Draws a workflow’s DAG, as text or Mermaid. |
replay | Runs a workflow against a recording, offline. |
verify-determinism | Replays a recording several times and compares the results. |
resume | Continues a run from its checkpoint. |
runs | Lists saved checkpoints. |
history | Lists the record of every run. |
callback-server | Approves and rejects paused runs over HTTP. |
agent inspect | Prints an agent’s definition as it loads. |
info | Prints the version, dependencies and configured providers. |
Common behaviour
agentloom --versionprints the version, and-his--help, onagentloomand on every command.- Warnings go to stderr, such as a retry or a parse warning.
agentloom --log-level LEVEL COMMAND, orAGENTLOOM_LOG_LEVEL, shows more or less: see Logs. - Paths are checked: a workflow, agent or recording that doesn’t exist is a usage error, exit
2. --jsonprints only JSON on stdout. Lines such asRunning workflow: …go to stderr, andrunsandhistoryprint[]when they find nothing. A command that stops before it has a result, such as on a workflow that doesn’t load, prints nothing on stdout and the error on stderr.
| Exit code | When |
|---|---|
0 | Success, a paused run, a valid workflow, or replays that agree. |
1 | A run that failed, timed out or went over budget; a workflow, recording or config file that doesn’t load; a failed check. |
2 | A usage error: an unknown option, a missing argument, a value out of range, a conflict between options, a --state without =. |
130 | A run interrupted with Ctrl-C or, outside Windows, SIGTERM; with --checkpoint, it saves a checkpoint to resume. |
Every run, replay and resume writes a record to agentloom_runs/<run_id>.json, or under AGENTLOOM_RUNS_DIR: see history.
run
agentloom run [OPTIONS] WORKFLOW_PATH| Option | What it does |
|---|---|
-s, --state KEY=VALUE | Sets a top-level state key, once per key. JSON-looking values, such as [1, 2], 5 or true, are parsed; others stay strings. See The initial state. |
-p, --provider NAME | Sets config.provider: the provider tried first among those that serve the model, unless a config file sets up the providers. See Providers. |
-m, --model NAME | Sets config.model. A step’s own model wins over it. |
-b, --budget USD | Sets config.budget_usd. |
--config FILE | The config file whose providers: block sets up the providers. By default, the file AGENTLOOM_CONFIG names, then ./agentloom.yaml. |
--stream | Prints model replies as they arrive. See Streaming. |
--json | Prints the whole result as JSON. |
--checkpoint | Saves a checkpoint when the run ends, and prints its Run ID. See Checkpoints and resume. |
--checkpoint-dir DIR | Where checkpoints go. .agentloom/checkpoints by default. |
--mock-responses FILE | Answers from a recording with the mock provider; a step it lacks gets Mock response, with a warning. |
--record FILE | Records every provider call to FILE, for replay. An existing file is replaced. |
--record-tools | With --record, records the results of the model’s tool calls too. |
--lite | Runs without OpenTelemetry, even when the observability extra is installed. |
The summary shows the status, duration, tokens and cost of the run and of each step and, with --checkpoint, the commands to resume a paused run. With --json, the result has status, step_results, final_state, total_tokens, total_cost_usd, error and run_id.
--recordneeds a live provider: it refuses a workflow withprovider: mock, and--mock-responses. These conflicts exit with2.--mock-responseswith a file that doesn’t exist is a usage error, exit2.- A missing API key isn’t caught before the run: the first step fails with
No provider registered for model …, after its retries.
validate
agentloom validate WORKFLOW_PATHFor examples/03_router_workflow.yaml:
Workflow 'customer-support-router' is valid. Version: 1.0 Steps: 5 Layers: 3 Provider: openai Model: gpt-4o-mini Budget: $0.05
Execution plan: Layer 0: classify Layer 1: route Layer 2: handle_billing, handle_general, handle_technical (parallel)It loads the file as run does, agent files included, and checks every field, dependency, router target and subworkflow path, and that there is no cycle. Steps that can run in parallel and write the same output key get a warning. An error prints Validation FAILED: and exits with 1.
It doesn’t check what only a run finds: an inline subworkflow’s steps, a Pydantic schema’s import, tool names, prompt templates, keys or recordings. See What validate checks.
visualize
agentloom visualize [--format ascii|mermaid] WORKFLOW_PATHascii, the default, prints one row per layer, with a box per step, such as [IF/ELSE: route]. mermaid prints a Mermaid flowchart inside a ```mermaid fence, ready for a Markdown file. Both go to stdout.
Router edges in the Mermaid output carry the whole condition. For Graphviz DOT or PNML, use the Graph API.
replay
agentloom replay [OPTIONS] WORKFLOW_PATH --recording FILERuns a workflow against a recording made with run --record, without calling any provider. See Testing & replay.
| Option | What it does |
|---|---|
-r, --recording FILE | The recording. Required. |
-s, --state KEY=VALUE | As in run. |
-p, --provider NAME, -m, --model NAME | As in run. A recording made with them replays with them, as its hashes cover the model. |
--json | As in run; with a cut, it also lists each call and where it came from. |
--allow-default-fallback | A step that the recording lacks gets Mock response, instead of failing. |
--tools live|replay|verify | Model tool calls: live runs them (the default), replay serves the results recorded with --record-tools, and verify runs them and fails when a result differs. tool steps always run. |
--live-from STEP | Runs that step, and every step after it, against the live providers. |
--force-live STEP | Runs that step live, once per option. |
--record FILE | With a cut, records this run to a new file. |
--record-tools | With --record, records tool results too. |
--config FILE | As in run, for the live providers of a cut. |
--observability | Turns OpenTelemetry on, which replay leaves off. |
- Replay is strict. A step the recording lacks fails the run. A changed prompt fails too, for entries that carry a
request_hash, asrun --recordwrites them; older recordings without one replay a changed prompt with its recorded answer. - With
--allow-default-fallback, a step in the recording gets its recorded answer, even if its prompt changed, with a warning. - A cut needs a provider and its key only for the steps that run live. Steps before the cut replay until a call misses, and go live from there; one that goes live on a model with no provider fails, naming the model.
- Conflicting options, such as
--recordwithout a cut, and a--live-fromor--force-livestep the workflow doesn’t have, exit with2.
verify-determinism
agentloom verify-determinism [OPTIONS] WORKFLOW_PATH --recording FILEReplays the recording --runs times and compares the runs: the status, each step’s status, output and error, the final state and the event log. When the recording carries an event log, the replayed one must match it too.
| Option | What it does |
|---|---|
-r, --recording FILE | The recording. Required. |
--runs N | How many replays, at least 2. 2 by default. |
-s, --state KEY=VALUE | As in run. |
-p, --provider NAME, -m, --model NAME | As in replay: the provider and model the recording was made with. |
--tools live|replay|verify | As in replay. With live, tools run once per replay. |
--events-out FILE | Writes the first replay’s event log as JSON Lines. |
--allow-failed | Accepts replays that agree without succeeding. |
It prints Deterministic: 2 replays of … give the same result and exits with 0, or prints the first difference as a diff and exits with 1. A replay that doesn’t end in success also exits with 1, unless you pass --allow-failed.
resume
agentloom resume [OPTIONS] RUN_IDContinues a run from its checkpoint. Checkpoints and resume covers what runs again.
| Option | What it does |
|---|---|
--approve, --reject | The decision for the paused approval gate. |
--checkpoint-dir DIR | Where the checkpoint is. .agentloom/checkpoints by default. |
-p, --provider NAME, -m, --model NAME, --config FILE | As in run. |
-s, --state KEY=VALUE | Sets a top-level state key over the checkpoint’s, parsed as in run. It is how the keys redacted from the checkpoint come back. |
-b, --budget USD | Sets config.budget_usd, what the run has already spent included. |
--stream, --json, --lite | As in run. |
- A run whose workflow says
provider: mockresumes against its recording. - A value in
--stateis visible in the shell history and the process list, as any argument is. --statereaches the run’s own state. A subworkflow paused at a gate resumes from its own checkpoint, and its redacted keys stay redacted.- An unknown run, or a decision for a run that isn’t paused, exits with
1.--approvewith--rejectexits with2, and so does a subworkflow’s own checkpoint,<run id>.<step id>: the error names the run to resume. - A decision for a gate that expired is ignored, and
resumesays so: the gate takes itson_timeout.
runs
agentloom runs [--checkpoint-dir DIR] [--json]Lists the checkpoints, with each run’s id, workflow, status and last update, in UTC, and when a paused run’s gate expires. Subworkflows have rows of their own, as <run_id>.<step_id>. --json prints the checkpoints whole, state and definition included.
history
agentloom history [OPTIONS]Lists the record of every run that ended, checkpointed or not, newest first.
| Option | What it does |
|---|---|
--runs-dir DIR | Where the records are. AGENTLOOM_RUNS_DIR, else ./agentloom_runs. |
--workflow NAME | Only that workflow. |
--provider NAME | Only runs that used that provider, by name alone: anthropic, not anthropic/claude-…. |
--since DATE, --until DATE | Only runs from --since, and before --until. A date is midnight UTC, and a time without an offset is UTC too. |
--min-cost USD, --max-cost USD | Only runs within that cost. |
--limit N | At most N runs. 20 by default. |
--json | The records whole. |
A record holds the run’s id, time, workflow, a hash of its definition, status, the providers and models it used, cost, tokens, steps run, duration and error. Records are never deleted, and a resumed run replaces the record of its first part. A replay records the provider of the recording, not mock. Observability covers the record.
callback-server
agentloom callback-server [OPTIONS]An HTTP server that resumes paused runs from their checkpoints, for approvals that come from another system.
| Option | What it does |
|---|---|
--host HOST | The address to listen on. 0.0.0.0 by default. |
--port PORT | The port. 8642 by default; 0 picks a free one. |
--token TOKEN | A shared secret that requests must send in the X-AgentLoom-Token header. |
--checkpoint-dir DIR | Where the checkpoints are. .agentloom/checkpoints by default. |
--config FILE | As in run, for the runs it resumes. The server reads it when it starts, and stops if it doesn’t load. |
--lite | As in run. |
| Endpoint | What it does |
|---|---|
GET /pending | Lists the paused runs, with expires_at for a gate that has timeout_seconds. |
POST /approve/<run_id> | Approves the run’s gate and resumes it. |
POST /reject/<run_id> | Rejects it and resumes it. |
POST /webhook | Receives an approval gate’s notification and prints it. |
/approveand/rejectanswer202and then resume the run. The outcome reaches the checkpoint and the run’s record, not the caller. An unknown run answers404, a run that isn’t paused409, and a config file that stopped loading after the server started500.- A decision for a run the server is already resuming answers
409. - A gate inside a subworkflow is decided on the run at the top. The child’s own run id, the one with a dot, answers
400and names that run; a link whose?gate=<path>isn’t where the run is paused answers409. - A decision for a gate that expired answers
202withexpired_at: the gate takes itson_timeout. - The server resumes each run whose gate expired, without a request: it looks every 30 seconds, and at the next expiry it knows of.
- With
--token, every endpoint but/webhookanswers401without the right header. A server on an address other than loopback, without a token, prints a warning: anyone who reaches it can decide. The token is a command-line argument, visible to other users of the machine in its process list. - Runs with
provider: mockcan’t resume here: the server sets up only live providers. Useagentloom resume. - A gate’s webhook can’t reach a server on
localhostor a private address unless the workflow setssandbox.allow_internal_webhook_targets: true. See The webhook.
agent inspect
agentloom agent inspect [--json] AGENT_PATHPrints an agent’s definition as it loads, without running it: its model and prices, system prompt, tools with their parameters, the agents it calls, its loop policy, output schema and constraints. A file that isn’t a valid agent prints the errors and exits with 1.
info
agentloom infoPrints the AgentLoom version, the Python version and platform, the core dependencies and the observability extra, and the providers: OpenAI, Anthropic and Google as configured when their key is set, and Ollama’s address. It never prints a key.
What’s next
Recordings, replay, cuts and fault injection.
Exit statuses, checkpoints and resuming runs.
The keys and endpoints
runreads.