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
Thanks to comment from Tim Swast above, I was able to use export PROJECT_ID=$(gcloud config get-value project)
to get the project ID.
Running gcloud config get-value project
prints the following on screen:
Your active configuration is: [default]
my-project-id
You can also run gcloud config get-value project 2> /dev/null
to print just the project ID and suppress other warnings/errors.