feat: --json CLI flag, isAvailable fix, SQLite warning suppression#8
Closed
feat: --json CLI flag, isAvailable fix, SQLite warning suppression#8
Conversation
Member
|
Remove the test script @claude |
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>
dc30ed4 to
1a14dce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--jsonflag to every CLI command for machine-readable agent output--version/-vflagisAvailable()returning false due to health check endpoint returning plain text "OK" that the SDK fails to parse as JSON; falls back togetAssetPairs()checkVerified
swap-pairs --jsonreturns valid JSON (51 pairs)swap-quote 100000 btc usdc_pol --jsonreturns valid JSON quoteisAvailable()now returnstrueTest plan
pnpm build && pnpm testpassesnode cli/arkade.mjs swap-pairs --jsonoutputs JSON arraynode cli/arkade.mjs swap-quote 100000 btc usdc_pol --jsonoutputs JSON objectnode cli/arkade.mjs --versionprints version