firn-cli

The operational CLI — the operator reference client and the fastest path to verify a broker is doing what you think it's doing.

Global flags

FlagEnvDefaultMeaning
-addrFIRN_ADDRlocalhost:9461Seed gRPC address; cluster mode: metadata fetched here, then routes to the lease holder (2s cache, refresh-on-retry)
-http-addrFIRN_HTTP_ADDRlocalhost:9460Seed HTTP admin address
-peersFIRN_PEERS""Cluster seeds, comma-separated gRPC addrs; round-robin when metadata unavailable
-http-peersFIRN_HTTP_PEERSderivedCluster HTTP seeds; defaults to -peers with each port −1
-api-keyFIRN_API_KEY""Bearer key (required once auth is enforced)
-ca-certFIRN_CA_CERT""PEM CA; switches gRPC to TLS and HTTP to HTTPS
-json—falseMachine-readable output

Topics & produce/fetch

create-topic --name orders --partitions 3 --mode stream
create-queue --name jobs --partitions 1        # mode: queue under the hood
list                                            # topics (JSON with -json)
produce --topic orders --key k1 --value v1      # or --batch-file events.jsonl (≤500/rpc, auto-chunked)
produce --topic orders --value big --batch-file -   # stdin
fetch   --topic orders --partition 0 --offset 0 --max 100

Consumer groups

groups                    # members, assignments, generation, lag hints
# offsets endpoint: GET /groups/{name}/offsets (curl) — see API reference

Queue & DLQ

dlq list --queue jobs              # fetch <queue>.dlq into a table
dlq redrive --queue jobs           # re-produce dlq records back into jobs (gRPC path only)

Records divert to <queue>.dlq after 3 delivery attempts; redrive re-injects them — the DLQ is a normal topic, so nothing is lost by listing it first.

API keys

create-apikey --name ci-deploy --role operator     # role: viewer|operator|admin|federation-ish
create-apikey --name office --role viewer --allowed-ips 203.0.113.0/24
list-apikeys                                        # names/roles/revoked — never key material
revoke-apikey --name ci-deploy                      # kills sessions immediately

Keys are shown exactly once at creation. Mint admin with the bootstrap token (fail-closed boot) or with any existing admin key.

Federation (preview)

federation keys                           # mint a federation-scoped key for this cluster (once)
federation add-peer --name east --addr 192.0.2.11:9471 --direction in --mode passive \
  --topics orders,jobs --key <peer-key>   # repeat keys for multiple peers
federation list-peers
federation remove-peer --name east
federation status                         # cursors: last applied offset per (peer, topic, partition)

Passive = one-way byte-identical import (sink fenced until cutover — see the cutover runbook). Active-active = both sides writable, re-originated offsets with echo filtering. Registration is out-of-band; peers authenticate over mesh mTLS with federation-scoped keys.

Mesh CA (cluster operators)

mesh-ca init -out ./mesh-ca     # writes ca.crt + ca.key; copy both into each node's data-dir/mesh-ca/ (mode 0600)

Bootstrap flow (first key)

firnd -data-dir ./data          # stderr prints BOOTSTRAP TOKEN: <hex>  (once, zero keys)
POST /apikeys -H "Authorization: Bearer <hex>" -d '{"name":"root","role":"admin"}'   # → ev-…
firn-cli -api-key ev-… list

JSON output & scripting

-json works with list, produce, fetch (incl. federation_hwm), groups, dlq list, list-apikeys. Exit codes: 0 ok, non-zero on any API refusal — safe to gate deploy pipelines on.