Skip to content

feat: --json CLI flag, isAvailable fix, SQLite warning suppression#8

Closed
brg444 wants to merge 3 commits intomasterfrom
feat/json-output-v2
Closed

feat: --json CLI flag, isAvailable fix, SQLite warning suppression#8
brg444 wants to merge 3 commits intomasterfrom
feat/json-output-v2

Conversation

@brg444
Copy link
Copy Markdown
Contributor

@brg444 brg444 commented Feb 12, 2026

Summary

  • Add --json flag to every CLI command for machine-readable agent output
  • Add --version / -v flag
  • Fix isAvailable() returning false due to health check endpoint returning plain text "OK" that the SDK fails to parse as JSON; falls back to getAssetPairs() check
  • Suppress SQLite warning in JSON output mode

Verified

  • swap-pairs --json returns valid JSON (51 pairs)
  • swap-quote 100000 btc usdc_pol --json returns valid JSON quote
  • isAvailable() now returns true
  • All 17 unit tests pass
  • Build and lint clean

Test plan

  • pnpm build && pnpm test passes
  • node cli/arkade.mjs swap-pairs --json outputs JSON array
  • node cli/arkade.mjs swap-quote 100000 btc usdc_pol --json outputs JSON object
  • node cli/arkade.mjs --version prints version

Copy link
Copy Markdown
Member

@tiero tiero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the test script @claude

@tiero
Copy link
Copy Markdown
Member

tiero commented Feb 12, 2026

Remove the test script @claude

brg444 and others added 3 commits February 13, 2026 19:30
Every command now supports --json for machine-readable output,
enabling reliable parsing by AI agents and scripts. The flag can
appear anywhere on the command line.

- Add output(data, formatFn) helper for dual-mode rendering
- JSON mode suppresses progress messages and returns structured data
- Errors output as { "error": "..." } in JSON mode
- Add --version / -v flag (reads from package.json)
- Document --json usage in README and help text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The LendaSwap API health endpoint returns plain text "OK" which
the SDK's OpenAPI JSON parser fails to parse, causing healthCheck()
to throw. Fix by catching the parse error and falling back to
getAssetPairs() as a lightweight reachability check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@brg444 brg444 force-pushed the feat/json-output-v2 branch from dc30ed4 to 1a14dce Compare February 13, 2026 11:30
@tiero tiero closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants