astro-cli icon indicating copy to clipboard operation
astro-cli copied to clipboard

Allow the option to return results in json format

Open paulg-mscience opened this issue 2 years ago • 3 comments

  • [x] I have checked that a similar feature request does not already exist.

✍️ Is your feature request related to a problem? Please describe.

It would be easier to programmatically use the cli if there were an option to return results in json format.

Describe the solution you'd like

Add --output param that can be either text (default) or json

💡 Additional context I realize that the houston graphql api will return json, however the simplicity of the astro cli is a nice alternative.

paulg-mscience avatar Jun 02 '22 17:06 paulg-mscience

Are you an Astro Cloud or Astronomer Software user? Return results of any command?

sunkickr avatar Jun 10 '22 22:06 sunkickr

Bumping this.

I have the need for machine-readable outputs for all commands, either JSON or YAML. Deployment inspect is not sufficient.

Here are my ugly hacks:

astro organization team delete $(astro organization team list | grep ${team_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 6 | rev)

astro organization team user remove --team-id $(astro organization team list | grep ${team_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 6 | rev) --user-id $(astro organization user list | grep ${astro_user_email} | rev | xargs | tr -s ' ' | cut -d ' ' -f 4 | rev)"

astro workspace delete $(astro workspace list | grep ${workspace_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 1 | rev)

astro workspace team add --workspace-id=$(astro workspace list | grep ${workspace_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 1 | rev) --team-id=$(astro organization team list | grep ${team_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 6 | rev)

astro deployment delete $(astro deployment list | grep ${deployment_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 1 | rev)

astro deployment service-account create --deployment-id=$(astro deployment list | grep ${deployment_name} | rev | xargs | tr -s ' ' | cut -d ' ' -f 1 | rev) --label=${label}`

odaneau-astro avatar Sep 25 '23 14:09 odaneau-astro

+1 for this, got another request for supporting output format consistently.

Customer specifically mentioned astro deployment list, but would ultimately like to have it in all commands.

BasPH avatar Oct 02 '23 10:10 BasPH