Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

gcloud

БесплатноБез исполняемых скриптовНе проверен

The Google Cloud CLI (gcloud) manages Google Cloud resources from the terminal. Use when the user asks to create a VM, upload to a bucket, deploy a Cloud Run…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Google Cloud CLI

Overview

The gcloud CLI (Google Cloud SDK 590.x in October 2026) manages GCP resources, configurations and deployments. Most commands follow gcloud <service> <resource> <verb>, and gcloud <command> --help is always accurate for the installed version. Billable commands below create real resources: run them in a throwaway project and delete what you create.

Instructions

Install

Use a package manager, not a piped installer script:

sudo snap install google-cloud-cli --classic        # Ubuntu and other snap systems
brew install --cask gcloud-cli                       # macOS

Debian/Ubuntu can also use Google's apt repository (https://cloud.google.com/sdk/docs/install-sdk). For a tarball, verify it against the SHA256 listed at https://cloud.google.com/sdk/docs/downloads-versioned-archives before extracting:

curl -fLO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
sha256sum google-cloud-cli-linux-x86_64.tar.gz       # compare with the published value
tar -xzf google-cloud-cli-linux-x86_64.tar.gz && ./google-cloud-sdk/install.sh

Authenticate and configure

gcloud auth login                              # user login for gcloud itself
gcloud auth application-default login          # separate credentials for client libraries (ADC)
gcloud config set project orders-prod-4821
gcloud config set compute/region us-central1
gcloud config set compute/zone us-central1-a

gcloud config configurations create staging    # named configs for several projects
gcloud config configurations activate staging
gcloud config list

On a machine without a browser use gcloud auth login --no-browser. On CI and servers, attach a service account to the workload or use Workload Identity Federation rather than downloading a key file.

Compute Engine

gcloud compute instances create web-server \
  --zone=us-central1-a \
  --machine-type=e2-medium \
  --image-family=ubuntu-2404-lts-amd64 \
  --image-project=ubuntu-os-cloud \
  --boot-disk-size=30GB \
  --boot-disk-type=pd-balanced \
  --tags=http-server,https-server \
  --service-account=web-sa@orders-prod-4821.iam.gserviceaccount.com

gcloud compute instances list \
  --filter="status=RUNNING AND labels.env=production" \
  --format="table(name,zone,machineType.basename(),networkInterfaces[0].accessConfigs[0].natIP)"

gcloud compute ssh web-server --zone=us-central1-a
gcloud compute instances stop web-server --zone=us-central1-a
gcloud compute instances delete web-server --zone=us-central1-a

gcloud compute firewall-rules create allow-web \
  --network=default --allow=tcp:80,tcp:443 \
  --target-tags=http-server --source-ranges=0.0.0.0/0

Cloud Storage

Use gcloud storage (it replaces gsutil for these tasks).

gcloud storage buckets create gs://orders-prod-4821-exports --location=us-central1
gcloud storage ls gs://orders-prod-4821-exports/
gcloud storage cp report.csv gs://orders-prod-4821-exports/2026/
gcloud storage rsync ./site gs://orders-prod-4821-exports/site --delete-unmatched-destination-objects
gcloud storage buckets update gs://orders-prod-4821-exports --lifecycle-file=lifecycle.json

# Signed URL: needs a key file (--private-key-file) or an impersonated service account
gcloud storage sign-url gs://orders-prod-4821-exports/report.csv --duration=1h \
  --impersonate-service-account=web-sa@orders-prod-4821.iam.gserviceaccount.com

Cloud Run functions (formerly Cloud Functions)

Cloud Functions 2nd gen is now Cloud Run functions. Both gcloud functions deploy and gcloud run deploy --function work.

gcloud functions deploy resize-image \
  --gen2 \
  --runtime=python313 \
  --region=us-central1 \
  --source=. \
  --entry-point=handler \
  --trigger-http \
  --no-allow-unauthenticated \
  --memory=512MiB \
  --timeout=60s \
  --set-env-vars="BUCKET=orders-prod-4821-exports,ENV=production"

gcloud functions call resize-image --region=us-central1 --data='{"key":"banner.png"}'
gcloud functions logs read resize-image --region=us-central1 --limit=50

Pass --allow-unauthenticated only for a function that is meant to be public. Check --runtime against https://cloud.google.com/functions/docs/runtime-support.

IAM

gcloud iam service-accounts create web-sa --display-name="Web app service account"

gcloud projects add-iam-policy-binding orders-prod-4821 \
  --member="serviceAccount:[email protected]" \
  --role="roles/storage.objectViewer"

gcloud projects get-iam-policy orders-prod-4821 \
  --flatten="bindings[].members" \
  --format="table(bindings.role,bindings.members)"

# Short-lived token as a service account (needs roles/iam.serviceAccountTokenCreator)
gcloud auth print-access-token \
  --impersonate-service-account=web-sa@orders-prod-4821.iam.gserviceaccount.com

Prefer impersonation or an attached service account over gcloud iam service-accounts keys create:

Полный SKILL.md на GitHub

Установить gcloud в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл gcloud?

The Google Cloud CLI (gcloud) manages Google Cloud resources from the terminal. Use when the user asks to create a VM, upload to a bucket, deploy a Cloud Run function, grant an IAM role, create a GKE cluster or switch GCP projects, or needs gcloud commands for Compute Engine, Cloud Storage, IAM, Cloud SQL or Pub/Sub.

Как установить скилл gcloud?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл gcloud запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить gcloud с