Skip to content

Conversation

@romainneutron
Copy link
Contributor

This address CLI-72
It adds supports for JSON output to metrics commands

@pjcdawkins
Copy link
Collaborator

pjcdawkins commented Nov 24, 2025

This PR is not limited to the metrics commands but instead adds a json format to all commands that output tables. The code's fine but it raises some questions:

  • Would you expect "tabular" JSON data for all the other commands, such as environments --format json, or would you expect the output to match the OpenAPI documentation for the /environments endpoint?
  • Does JSON output make sense for all those other commands? Why not call the API directly?
  • I think the same question applies to the metrics commands. Could some uses be outlined?
  • Does JSON make sense in a Table class?

here's the current output for environments --format json, assuming one environment:

{
  "data": [
    {
      "ID": "main",
      "Title": "main",
      "Status": "Active",
      "Type": "production"
    }
  ]
}

the current way to get JSON output, project:curl /environments, returns a lot more information and it matches the OpenAPI docs

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.

3 participants