Skip to content

Add option for JSON output to (specific) CLI commands #550

Open
@hslatman

Description

@hslatman

What would you like to be added

Add a flag (e.g. --json) to make the CLI print its output in JSON format.

Why this is needed

Supporting JSON output provides for easier composability of command invocations. The CLI could be used with jq, for example, to filter or extract certain parts from the output.

Some things to take into account:

  • Some commands already print JSON by default
  • Error cases should be handled nicely (i.e. exit codes vs. printed errors)
  • Calling the APIs directly is of course also an option
  • ...

Also see: #512 (comment), which was the reason for creating the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions