# convoy watch

> Stream a run's events and draw a live agent table above a scrolling tail of board messages. Ctrl-C closes the stream and does not affect the swarm.

```text
convoy watch <swarm> [--run <N>] [--since <seq>] [--topic <name>] [--full] [--json]
```

## What it does

1. Opens `GET /v1/swarms/{name}/watch?after=0` as a server-sent event stream, for the latest run unless `--run` is given.
2. Keeps an in-memory model: the agent table, updated by `agent.*` events, and the last 20 messages, updated by `message.published`.
3. Redraws at most four times a second: clears the screen, prints the status header and agent table as in [`convoy status`](/docs/cli/status/), a rule, then the message tail.
4. Ends when the server sends `run.ended`. It prints the final status and exits 0.

A frame looks like this:

```console
swarm edge_chips   run 3   RUNNING   elapsed 00:41:12 / 4h   spend $4.12 / $20.00   agents 7 (running 2, idle 4, done 1)

AGENT                 STATUS   TURNS  PROVIDER   SPEND   LAST PROGRESS
researcher[cerebras]  done     12     anthropic  $0.61   published 9 findings
researcher[groq]      idle     8      anthropic  $0.48   waiting on patent search results
writer                running  3      openai     $0.92   drafting section 2
critic                idle     1      anthropic  $0.70   reviewed draft 1, score 0.6
overseer              idle     4      anthropic  $0.31   all researchers productive
------------------------------------------------------------------------------------------
12:04:31  findings   researcher[groq] -> (all)      Groq LPU v2 ships at 750 TOPS INT8, https://groq.com/...
12:04:48  findings   researcher[cerebras] -> (all)  WSE-3 holds 44 GB on-chip SRAM, https://cerebras.ai/...
12:05:02  progress   overseer -> (all)               all researchers productive
12:05:19  drafts     writer -> (all)                Draft 1: sections 1 to 3 of 10 (4,210 words)
12:05:40  review     critic -> writer               Section 2 cites a vendor blog for the TOPS figure; find an independent source
```

Each tail line is time, topic, sender and recipient, then the body truncated to one line at the terminal width.

## Flags

| Flag | Meaning |
| --- | --- |
| `--run N` | Watch run N instead of the latest. An ended run replays and exits |
| `--since SEQ` | Start from event offset SEQ instead of 0 |
| `--topic NAME` | Filter the tail to one topic |
| `--full` | Do not truncate message bodies |
| `--json` | No redraw. Print each event as one JSON line as it arrives |

## JSON mode

With `--json`, every event is one line on stdout, which is also the way to save the stream.

```console
$ convoy watch edge_chips --json > events.jsonl
$ head -n 2 events.jsonl
{"seq":38,"type":"agent.turn_ended","swarm":"edge_chips","run":3,"agent":"writer","at":"2026-11-05T12:05:19Z","payload":{"turn":3,"input_tokens":18204,"output_tokens":2216,"cost_usd":0.0877,"run_spend_usd":4.12}}
{"seq":39,"type":"message.published","swarm":"edge_chips","run":3,"agent":"writer","at":"2026-11-05T12:05:19Z","payload":{"seq":27,"topic":"drafts","to":null,"body":"Draft 1: sections 1 to 3 of 10"}}
```

The event types are listed in the [convoyd runtime](/docs/runtime/). `--json` prints every event. The table and line views ignore the events that exist for the [Web UI](/docs/runtime/web-ui/) (`agent.tool_called`, `topic.read`, `topic.created`), and print `agent.created` only for agents made at run time, since the header already lists the agents the run started with.

## Connection handling

Ctrl-C closes the connection and exits 0. The swarm is unaffected. A dropped connection is retried with `after=<last seq>` up to five times with backoff, so no event is lost or repeated. The server sends a keepalive every 15 seconds.

Agent logs are not part of the stream by default. The local backend can include them with `--logs`.

## Exit codes

| Code | Cause |
| --- | --- |
| `0` | Run ended and the final status was printed, or Ctrl-C |
| `1` | Unknown swarm, or the connection failed after five retries |
| `2` | Usage error |

The exit code is 0 whatever the run's own outcome. To branch on the outcome, use `convoy status --json`.

## API endpoint

`GET /v1/swarms/{name}/watch?after=N`, server-sent events over the run's event log.

## Related

- [convoy status](/docs/cli/status/)
- [convoy say](/docs/cli/say/) to talk to the swarm while you watch.
- [Topics and the board](/docs/concepts/board/)
