Description:
The ILN CLI currently only outputs human-readable formatted text. This makes it difficult for scripts, automation tools, and other programs to consume CLI output programmatically. Adding a global --json flag would enable machine-readable output for all commands.
The CLI is built using the commander library in cli/src/index.ts. The program already accepts a --profile global option. The --json flag should follow the same pattern.
When --json is set:
- All commands output valid JSON to stdout
- Error messages are structured as
{ "error": "...", "code": "..." }
- Success responses include the full data payload
- No ANSI color codes or formatting
Affected commands (all in cli/src/commands/):
status.ts — invoice status queries
reputation.ts — reputation lookups
submit.ts — invoice submission results
fund.ts — funding results
cancel.ts — cancellation results
marketplace.ts — marketplace queries
Why it matters: JSON output enables CI/CD integration, automated testing, and building higher-level tools on top of the CLI. It's a standard feature for developer tools.
Acceptance Criteria:
Relevant Files: cli/src/index.ts, cli/src/commands/status.ts, cli/src/commands/reputation.ts
Description:
The ILN CLI currently only outputs human-readable formatted text. This makes it difficult for scripts, automation tools, and other programs to consume CLI output programmatically. Adding a global
--jsonflag would enable machine-readable output for all commands.The CLI is built using the
commanderlibrary incli/src/index.ts. The program already accepts a--profileglobal option. The--jsonflag should follow the same pattern.When
--jsonis set:{ "error": "...", "code": "..." }Affected commands (all in
cli/src/commands/):status.ts— invoice status queriesreputation.ts— reputation lookupssubmit.ts— invoice submission resultsfund.ts— funding resultscancel.ts— cancellation resultsmarketplace.ts— marketplace queriesWhy it matters: JSON output enables CI/CD integration, automated testing, and building higher-level tools on top of the CLI. It's a standard feature for developer tools.
Acceptance Criteria:
--jsonglobal flag to the CLI program incli/src/index.tsformatOutput(data, isJson)utility functionRelevant Files:
cli/src/index.ts,cli/src/commands/status.ts,cli/src/commands/reputation.ts