| name | gcloud |
| description | Google Cloud CLI for Compute, Cloud Run, GCS, and BigQuery |
| metadata | {"openclaw":{"always":false,"emoji":"🌐"}} |
Google Cloud CLI
Manage Google Cloud services via gcloud and gsutil.
Setup
-
Check if installed:
command -v gcloud && gcloud --version
-
Install:
brew install google-cloud-sdk
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
-
Auth:
gcloud auth login
gcloud auth activate-service-account --key-file=<key.json>
Compute Engine
gcloud compute instances list
gcloud compute instances describe <name> --zone=<zone>
gcloud compute ssh <name> --zone=<zone>
gcloud compute ssh <name> --zone=<zone> --command="<cmd>"
gcloud compute instances start <name> --zone=<zone>
gcloud compute instances stop <name> --zone=<zone>
gcloud compute scp <local> <name>:<remote> --zone=<zone>
gcloud compute scp <name>:<remote> <local> --zone=<zone>
gcloud compute instances get-serial-port-output <name> --zone=<zone>
Cloud Run
gcloud run services list
gcloud run deploy <service> --image=<image> --region=<region> --allow-unauthenticated
gcloud run deploy <service> --source=. --region=<region>
gcloud run services logs read <service> --region=<region> --limit=50
gcloud run services describe <service> --region=<region>
Cloud Storage (gsutil)
gsutil ls
gsutil ls gs://<bucket>/<prefix>/
gsutil cp <file> gs://<bucket>/<path>
gsutil cp gs://<bucket>/<path> <file>
gsutil -m rsync -r <dir> gs://<bucket>/<prefix>/
gsutil rm gs://<bucket>/<path>
gsutil rm -r gs://<bucket>/<prefix>/
BigQuery
bq ls
bq query --use_legacy_sql=false 'SELECT * FROM `project.dataset.table` LIMIT 10'
bq ls <dataset>
bq show --schema <dataset>.<table>
Configuration
gcloud config get-value project
gcloud config set project <project-id>
gcloud auth list
gcloud config set account <email>
gcloud config set compute/region <region>
gcloud config set compute/zone <zone>
Tips
- Use
--format=json or --format=table for structured output
- Use
--project=<id> to operate on another project
- Use
--quiet to suppress confirmations
- For service account auth:
gcloud auth activate-service-account --key-file=<key.json>