Cloud Shell comes with Cloud SDK pre-installed. This means you can run gcloud
commands without additional setup. You can run gcloud command-line tool
commands, like gcloud help
straight away after
activating a Cloud Shell session.
Additionally, any time you manage resources using the interactive interface from
the Console, you can generate the equivalent gcloud
command and run it in
Cloud Shell. If you fill in the details of your required resource
during tasks like the creation of an instance group or a Kubernetes cluster,
the generated command will contain the correct flags and their values.
Example: Creating a Compute Engine instance with a generated gcloud command
- Go to the Compute Engine > VM instances page.
- Click Create.
- Fill in the required and optional fields to configure the new instance to suit your needs.
- Below the Create button, you'll find the option to generate the equivalent
REST or gcloud command. Click on command line to see the suggested
gcloud command.
- Click Run in Cloud Shell.
- Press Enter to execute the command once you see it at the prompt.
- Going back to the VM instances page, you'll see the newly created and running VM instance.
- Delete the instance either from the command line or the VM instances page, if you no longer need it, to avoid incurring unnecessary charges.