Skip to content

CLI format flag over 'pretty' option #1144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
asonnenschein opened this issue May 20, 2025 · 1 comment
Open

CLI format flag over 'pretty' option #1144

asonnenschein opened this issue May 20, 2025 · 1 comment
Milestone

Comments

@asonnenschein
Copy link
Contributor

Problem
The CLI does not currently support pretty printing JSON outputs from commands. This is annoying because JSON can be difficult to read when it's not pretty printed, and users will need to pipe CLI outputs to custom bash commands to pretty print their JSON. Supporting pretty print as an optional argument in the CLI will be a better UX.

Solution
Enhance the CLI with an optional argument to pretty print JSON outputs to stdout.

A/C

  • CLI supports a new optional argument to pretty print JSON outputs to stdout for all APIs.
@asonnenschein asonnenschein added this to the 3.0.0 Release milestone May 20, 2025
@ischneider
Copy link
Member

Based on the original idea, I think it would be more like:

  • introduce output option (similar to kubectl) that supports various output formats
  • start with json, json-pretty (what pretty does now), ndjson (new-line delimited), flat-json
  • remove --pretty (or maybe alias it to format=json-pretty?)

One question is to make it a "root" option (precedes sub-command), e.g. planet --output=json command --command-option=foo or as a command option. Personally, I prefer the latter...

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

No branches or pull requests

2 participants