Gcloud command line get default project_id

前端 未结 5 591
野的像风
野的像风 2021-02-01 13:13

I\'m looking for a one-liner to get the default project id

with gcloud config list core/project give me

Your active configuration is: [defau         


        
5条回答
  •  时光说笑
    2021-02-01 13:43

    The easiest way to do this is to use the --format flag on gcloud.

    gcloud config list --format 'value(core.project)' 2>/dev/null

    The --format flag is available on all commands and gives you full control over what is printed, and how it is formatted.

    You can see this help page for full info: gcloud topic formats

提交回复
热议问题