You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harden the CLI API so an agent/human can parse any command's result and chain commands together without scraping plain text. Three facets, tracked as one task: a global structured-output flag, a structured error catalog, and a --describe machine-readable schema.
1. Structured output
New global flag:
output=json|default
default — today's default (plain text for most commands, a few existing JSON exceptions).
json — an object with predictable keys representing the same data plus enriched output in some cases (e.g. errors paired with a resolution).
commands return an object with a consistent set of keys.
errors add context along with raw error details to aid users/agents towards remediation of the error.
3. --describe
A projection of the command spec: a machine-readable schema for a command or the tree (args, output schema, errors[], examples). Backed by a command-spec source file feeding the parser / --help / --describe generator.
Build on existing OutputFormat patterns (events.rs, fee_stats.rs, ledger/fetch.rs) and print.rs.
Acceptance criteria
The spec's example envelopes (ok-result and error-with-remediation) reproduce.
A data point for sequencing, from checking HackMeridian 2026 hackathon repos (147 public repos) against 28.1.0: tx sign and tx send look like a natural first pair to move onto the Output system from #2635.
tx sign prints only the signed XDR. The hash is an info line on stderr, and under -q a failure prints nothing at all (--quiet hides the error message when a command fails #2876). Teams that wanted to sign from code read the secret out with keys secret instead (13 repos).
tx send already prints its result as JSON, but a failure is the human error line, so a script can't tell a retryable failure from a real one without parsing text.
Both have one obvious result shape and no human-facing table to keep, so they'd be a small first slice.
Activity
janewang commentedon Jun 29, 2026
@aristidesstaffieri @oceans404 @fnando Does it make sense only for machine-facing CLI API, or should it be for humans too?
aristidesstaffieri commentedon Jun 29, 2026
the summary just focuses on the improvement in a parsable format, but it is useful for humans also, I will update the text.
oceans404 commentedon Nov 1, 2026
A data point for sequencing, from checking HackMeridian 2026 hackathon repos (147 public repos) against 28.1.0:
tx signandtx sendlook like a natural first pair to move onto theOutputsystem from #2635.tx signprints only the signed XDR. The hash is an info line on stderr, and under-qa failure prints nothing at all (--quiet hides the error message when a command fails #2876). Teams that wanted to sign from code read the secret out withkeys secretinstead (13 repos).tx sendalready prints its result as JSON, but a failure is the human error line, so a script can't tell a retryable failure from a real one without parsing text.Related: #2876 (
-qhides errors), #2875 and #2879 (other commands scripts parse today).Generated by Claude Code