Search code examples
google-cloud-platformgcloud

Gcloud List Output Format Not Columnar


Any list command in gcloud shell is returning in an unexpected, harder to read format. Example: From doc: https://cloud.google.com/blog/products/it-ops/filtering-and-formatting-fun-with

Let's start off by formatting a simple command that you are already familiar with that lists the projects to which you have access: gcloud projects list

    PROJECT_ID            NAME          PROJECT_NUMBER
    canvas-syntax-130823  scesproject2  346904393285
    windy-bearing-129522  scesproject1  222844913538 

When I try this I always get format:

    PROJECT_ID: anvas-syntax-130823
    NAME: scesproject2
    PROJECT_NUMBER: 346904393285

    PROJECT_ID: windy-bearing-129522
    NAME: scesproject1
    PROJECT_NUMBER: 222844913538

This format is harder to read and navigate especially for longer outputs. Any idea why I am getting output in this format? I tried with different instances, different accounts, it is not tied to any config I would have.

I know about the --format options, I would just like to understand why and where is the "tabular" default view gone?


Solution

  • The CLI has an option to make output easier for screen readers to process.

    To disable that feature:

    gcloud config set accessibility/screen_reader false
    

    To enable that feature:

    gcloud config set accessibility/screen_reader true
    

    This link provides more information:

    gcloud config set