Gcloud command line get default project_id

前端 未结 5 571
野的像风
野的像风 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:39

    Not exactly the gcloud command you specified, but will return you the currently configured project:

    gcloud info |tr -d '[]' | awk '/project:/ {print $2}'
    

    Works for account, zone and region as well.

提交回复
热议问题