Background
All current commands output formatted tables (using rich). Users running automated pipelines, cron jobs, or shell scripts need machine-readable output.
Requirements
- Global flag
--json for all subcommands
- Example:
young indices --json outputs JSON array instead of table
- Should be pipe-friendly:
young a --zt --json | jq '.[] | .code'
Suggested implementation
- Add
--json to the root group in cli.py
- When set, skip
rich Table rendering and call json.dumps() on the raw data dict
- Each subcommand should already have structured data before rendering, so this is mostly a render-layer fork
Acceptance
For
- Python users who like click
- Anyone using A-share data in shell pipelines
Easy first PR!
Background
All current commands output formatted tables (using
rich). Users running automated pipelines, cron jobs, or shell scripts need machine-readable output.Requirements
--jsonfor all subcommandsyoung indices --jsonoutputs JSON array instead of tableyoung a --zt --json | jq '.[] | .code'Suggested implementation
--jsonto the root group incli.pyrichTable rendering and calljson.dumps()on the raw data dictAcceptance
young indices --jsonoutputs valid JSONyoung a --zt --jsonoutputs valid JSONyoung global --jsonoutputs valid JSONFor
Easy first PR!