Documentation Index
Fetch the complete documentation index at: https://developer.bron.org/llms.txt
Use this file to discover all available pages before exploring further.
bron tx subscribe opens a persistent WebSocket connection and prints transaction updates as they happen — same filters as bron tx list, JSONL on stdout. The connection survives idle periods, server restarts, and network blips: a transparent auto-reconnect layer keeps the stream alive forever.
Mental model: GET extended
Conceptually,tx subscribe is a long-running tx list. The server keeps the connection open and pushes each transaction state change as a one-element list of the same Transaction shape.
- A
subscribed; Ctrl-C to exitline on stderr (no snapshot — see below). - Each subsequent transaction state change pushed as a separate JSON line on stdout.
--output setting (table/yaml don’t make sense on an open-ended stream). Pipe to jq for any reshaping.
Live-only by default
bron tx subscribe is live-only out of the box: no snapshot replay on connect, just the stream. This is the right default for long-running watchers — most automations only care about new events, not a full replay of the workspace history every reconnect.
If you do want the snapshot (e.g. an audit script that needs “everything currently matching + live tail in one command”), pass --with-history:
Filters
Same vocabulary asbron tx list:
Auto-reconnect contract
Idle WebSocket connections are closed by the server after ~60 seconds of silence. Long-running CLI subscribers would otherwise need to reconnect on their own.bron tx subscribe handles this transparently:
| Trigger | What the CLI does |
|---|---|
| Idle timeout / server restart | Re-dials immediately, sends SUBSCRIBE again with the same Correlation-Id |
| Network drop / abnormal closure (1006) | Re-dials with linear backoff (1s → 2s → … → 10s, capped) |
| Server-initiated logout (close 4000) | Stream ends; Stream.Err() returns the cause |
| Token-refresh request (close 4001) | Re-dials immediately with a fixed 1s delay |
| Stable disconnect after a healthy session (≥30s) | Backoff resets to 0 — first reconnect is instant |
| Flapping connection (drops within 30s) | Backoff escalates per attempt — protects a bouncing server |
Correlation-Id is reused across reconnects so log correlation stays stable for the whole subscription.
The caller never sees these reconnects — frames keep flowing on stdout. The CLI only writes to stderr if the transport is actually flapping (backoff > 0 OR more than one attempt), so the happy path stays silent.
Debugging with --debug
The global --debug flag wires a stderr slog handler at level DEBUG. For tx subscribe that means:
- Each WebSocket frame received (status code + body byte count)
- Each ping sent
- Each dial attempt (URL, correlation ID, success/failure)
- Lifecycle events at INFO/WARN (disconnect, reconnect attempts, reconnect success)
correlationId, uri, attempt, backoff, err. Safe to redirect to a file or pipe to grep.
Recipes
Tail every signed transaction in one workspace
React to new signing-required withdrawals
Wait for a specific transaction to complete
bron tx get <id> polled is also fine — but for a treasury automation that watches dozens, subscribe is cheaper.)
Stream into a tool that doesn’t speak JSONL
SDK equivalent (Go)
If you’re building something more sophisticated than a shell pipe, the Go SDK exposes the same transport directly viaclient.Transactions.Subscribe(ctx, query) returning a typed channel. Same auto-reconnect, same lifecycle, plus a programmatic LifecycleEvent callback for metrics.
JS / Python SDK equivalents are on the roadmap — for now, bron-sdk-go is the canonical implementation.