`listen-fire --json`

Add --json to a command an agent inspects or drives and stdout is one JSON document (one line). Human output without the flag is unchanged. Exit codes are the same either way (check: 1 on any error; runs: 1 when any run failed). A failure of the command itself is {"error": "<message>"} on stdout, exit 1. Usage mistakes (a missing argument) still print to stderr, exit 2.

Keys are camelCase. A value that does not apply is null, never absent.

listen-fire check --json #

{ "ok": true, "files": 1, "errors": 0,
  "diagnostics": [{ "code": "MOV_PARSE", "severity": "error", "file": "/abs/movements/a.mvt",
    "span": { "line": 1, "column": 1, "endLine": 1, "endColumn": 9 },
    "message": "…", "fixes": [] }] }

listen-fire catalog --json #

The catalog snapshot ({ "contractVersion", "adapters", … }) the files are checked against, with a schema for every connection the project holds (each installed module, each credential bound to it), whether a movement connects it or not. Without --json, listen-fire catalog prints text: each of those connections, in the notation of listen-fire modules show. When credentials are missing: { "error", "missingCredentials": [diagnostic…] }, exit 1. When a connection cannot be described (its server is down, its credential refused): the snapshot of every other connection on stdout, one line connection <name>: could not be described: <why> per such connection on stderr, exit 1.

listen-fire run <movement>, run --event, run --poll, run --webhook, resume [<run-id>] #

{ "ok": true, "redelivered": ["…"],
  "runs": [{ "runId": "…", "file": "hello", "movement": "hello", "entry": "fired",
    "status": "completed", "writes": 0, "writeRecords": [], "dryRunWrites": null, "traceEntries": 0, "error": null,
    "returned": { "value": "Hello, Ada!" } }] }

listen-fire cancel <run-id> [--reason t] #

{ "ok": true, "runId": "…", "result": "cancelled" }; result is cancelRequested when another listen-fire process is stepping the run. A run that is neither running nor parked is an {"error"}.

listen-fire runs --json #

{ "runs": [{ "runId", "file", "movement", "status", "startedAt", "finishedAt", "attempt", "stranded" }] }, most recent first (50). finishedAt is when the run completed or failed, null while it runs or is parked. status, startedAt and finishedAt are the latest attempt's; attempt is its number, 1 unless the run was rerun. stranded is true for a parked run waiting on a record that was deleted (stranded waits); without --json its status reads parked (stranded).

listen-fire runs show <run-id> --json #

{ "run": { "runId", "file", "movement", "status", "startedAt", "finishedAt", "deliveryId", "firedAt", "languageVersion",
  "event": {…}, "chain": [ "…" ], "writes": 0, "writeRecords": [ … ], "error": null, "returned": { "value": … }, "outcome": {…},
  "costMicrodollars": 0.0, "traceEntries": 0, "trace": [ … ],
  "parked": [{ "address": "…", "reason": "timer", "wakeAt": "…" }],
  "stranded": [{ "waitId": "…", "adapterType": "slack", "edge": "Interactions", "key": "C1:…", "at": "…", "says": "waiting on Interactions of slack C1:… — its record was deleted, so nothing will arrive; a race with a sleep is the way out" }],
  "attempt": 1, "attempts": [{ "attempt": 1, "status", "startedAt", "finishedAt", "writes", "writeRecords", "error" }],
  "cancelRequested": false, "cancelReason": null } }

listen-fire runs rerun <run-id> [--force] --json #

A failed run run again as its next attempt: { "ok", "runs": [<run>], "redelivered": [], "attempt": 2 }, the run as under listen-fire run (entry: rerun). Exit 1 when the attempt failed.

Refused: { "ok": false, "runId", "refused", "error", "status", "attempt", "committedWrites" }, exit 1. refused is:

An unknown run, or a movement that no listen fires now or that does not check, is an {"error"}, exit 1.

listen-fire deliveries --json #

{ "deliveries": [{ "id", "subscriptionId", "externalId", "receivedAt", "source", "inline", "replayOf", "eventCount", "runs": [{ "id", "status" }] }] }, most recent first (50). --subscription <id> keeps one subscription's; --since is an ISO instant, or <n>h or <n>d before now, and keeps those received at or after it. source is webhook, hook, emit or cli; externalId is the provider's delivery id, or null; inline is true when the events ran inside the request; replayOf names the delivery a listens replay repeats.

listen-fire deliveries show <id> --json #

{ "delivery": { …the listing's fields, "events": [{ "external", "event" }], "requestKept" } }. runs is empty for a delivery no listen took. requestKept says whether it keeps the request it was received as (a replay keeps none; past deliveries.retainDays it is forgotten). With --request the document also carries "request": { "method", "path", "query", "headers", "body", "checkpoint"?, "arrivalIds" } (body base64; only the headers its module declares it reads, never a signature; body and query without the fields its module declares may hold a credential, otherwise as received; arrivalIds the arrivals it brought, all a replay judges again), or for a poll's delivery, the page the poll read, "request": { "adapter", "install"?, "credential"?, "arrivals" }: it may hold personal data, and is never printed without the flag. Without --json it prints the same document, indented. An unknown id is {"error": "no delivery <id>"}, exit 1.

listen-fire modules --json and listen-fire connect --json #

{ "modules": [{ "name", "kind", … }] }. kind is external (state, how, installSetUp, install, credentials: names), core (slot, state, setUp, setupNote) or package (state: not installed, bundled). A module the release bundles also has description, the first sentence of its package's. Names only; no secrets. A bare connect prints the same document.

listen-fire modules show <module> --json #

{ "module", "kind", "description", "installedAs", "readOnly", "schema": { "source", "why"? }, "collections", "records", "writes", "listens", "credentials", "settings", "plugins", "connectNeeds", "protocolMinor" }. kind is adapter, plugin or <slot> slot. schema.source is module (read from the module, no account needed), account (it comes from the connected account, so collections, records and writes are empty) or unread (with why). records are { name, description, fields: [{ name, type }], edges: [{ name, target }] }; writes are { along, target, fields: [{ name, required }] }; listens is { triggers, pollSeconds }: the triggers the module supports and its poll interval in seconds (null when it declares none). connectNeeds are the flags connect --yes cannot choose a default for. protocolMinor is the minor of adapter protocol 2 the module needs its host to speak (null for a slot module).

listen-fire credential list --json #

{ "credentials": [{ "name", "module", "binding", "declaredCredential", "kept", "expiresAt" }] }. binding: install, credential or legacy; declaredCredential is set for credential. kept: the secrets file path and/or environment. expiresAt: a token's expiry or null. Never a value.