Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Project ID shows in Cloud Shell CLI instead of Project Name

When using Cloud Shell I noted the unique project ID was in the CLI : (rg1234user@cloudshell:~ (unique-ellipse-280616) :  instead of the simple project name (ex. "service project lab").  Is there a way to change this?  I looked through the Settings and Permissions for the project, the unique ID isn’t editable.  Is there a way for the CLI to recognize the simple name instead of the ID ? 

ie.  rg1234user@cloudshell:~ (service project lab) 

thanks. rg

1 Answers

You can customize your prompt in Google Cloud Shell by editing: ~/.bashrc

You can see your current prompt: echo $PS1

Cloud Shell uses, $DEVSHELLPROJECTID for setting the project id in the prompt.

It’s probably not a good idea to change this as when you’re using gcloud commands you won’t be referring to the project name but the project id. So you could use $DEVSHELL_PROJECT_ID in scripts between projects (for example).

What might be better is to create a project with a unique name, then this will also be the project Id. And so the cloud shell prompt will show you what you want.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?