Manage Google Cloud Platform resources via gcloud CLI. Use for Compute Engine VMs, Cloud Run services, Firebase Hosting, Cloud Storage, and project management. Covers deployment, monitoring, logs, and SSH access.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install gcloud或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install gcloud⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/gcloud/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: gcloud description: Manage Google Cloud Platform resources via gcloud CLI. Use for Compute Engine VMs, Cloud Run services, Firebase Hosting, Cloud Storage, and project management. Covers deployment, monitoring, logs, and SSH access. ---
Manage GCP resources using gcloud, gsutil, and firebase CLIs.
# Download and extract
cd ~ && curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
tar -xzf google-cloud-cli-linux-x86_64.tar.gz
# Install (adds to PATH via .bashrc)
./google-cloud-sdk/install.sh --quiet --path-update true
# Reload shell or source
source ~/.bashrc
# Authenticate
gcloud auth login
npm install -g firebase-tools
firebase login
# List authenticated accounts
gcloud auth list
# Switch active account
gcloud config set account EMAIL
# List projects
gcloud projects list
# Set default project
gcloud config set project PROJECT_ID
# View current config
gcloud config list
---
# All instances across projects
gcloud compute instances list --project PROJECT_ID
# With specific fields
gcloud compute instances list --project PROJECT_ID \
--format="table(name,zone,status,networkInterfaces[0].accessConfigs[0].natIP)"
gcloud compute instances start INSTANCE_NAME --zone ZONE --project PROJECT_ID
gcloud compute instances stop INSTANCE_NAME --zone ZONE --project PROJECT_ID
gcloud compute instances reset INSTANCE_NAME --zone ZONE --project PROJECT_ID
# Interactive SSH
gcloud compute ssh INSTANCE_NAME --zone ZONE --project PROJECT_ID
# Run command remotely
gcloud compute ssh INSTANCE_NAME --zone ZONE --project PROJECT_ID --command "uptime"
# With tunneling (e.g., for local port forwarding)
gcloud compute ssh INSTANCE_NAME --zone ZONE --project PROJECT_ID -- -L 8080:localhost:8080
# Serial port output (boot logs)
gcloud compute instances get-serial-port-output INSTANCE_NAME --zone ZONE --project PROJECT_ID
# Tail logs via SSH
gcloud compute ssh INSTANCE_NAME --zone ZONE --project PROJECT_ID --command "journalctl -f"
---
# List all services in a region
gcloud run services list --region REGION --project PROJECT_ID
# All regions
gcloud run services list --project PROJECT_ID
# Deploy from source (builds container automatically)
gcloud run deploy SERVICE_NAME \
--source . \
--region REGION \
--project PROJECT_ID \
--allow-unauthenticated
# Deploy existing container image
gcloud run deploy SERVICE_NAME \
--image gcr.io/PROJECT_ID/IMAGE:TAG \
--region REGION \
--project PROJECT_ID
gcloud run services describe SERVICE_NAME --region REGION --project PROJECT_ID
# Stream logs
gcloud run services logs read SERVICE_NAME --region REGION --project PROJECT_ID --limit 50
# Or use Cloud Logging
gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=SERVICE_NAME" \
--project PROJECT_ID --limit 20 --format="table(timestamp,textPayload)"
gcloud run services update SERVICE_NAME \
--region REGION \
--project PROJECT_ID \
--set-env-vars "KEY1=value1,KEY2=value2"
# Route 100% traffic to latest
gcloud run services update-traffic SERVICE_NAME --to-latest --region REGION --project PROJECT_ID
# Split traffic (canary)
gcloud run services update-traffic SERVICE_NAME \
--to-revisions=REVISION1=90,REVISION2=10 \
--region REGION --project PROJECT_ID
---
firebase projects:list
# Deploy everything (hosting + functions + rules)
firebase deploy --project PROJECT_ID
# Hosting only
firebase deploy --only hosting --project PROJECT_ID
# Specific site (multi-site setup)
firebase deploy --only hosting:SITE_NAME --project PROJECT_ID
# Create preview channel
firebase hosting:channel:deploy CHANNEL_NAME --project PROJECT_ID
# List channels
firebase hosting:channel:list --project PROJECT_ID
# Delete channel
firebase hosting:channel:delete CHANNEL_NAME --project PROJECT_ID
# List recent deploys
firebase hosting:releases:list --project PROJECT_ID
# Rollback to specific version
firebase hosting:rollback --project PROJECT_ID
---
# List buckets
gsutil ls
# List contents
gsutil ls gs://BUCKET_NAME/
# Copy file
gsutil cp LOCAL_FILE gs://BUCKET_NAME/path/
gsutil cp gs://BUCKET_NAME/path/file LOCAL_PATH
# Sync directory
gsutil -m rsync -r LOCAL_DIR gs://BUCKET_NAME/path/
# Make public
gsutil iam ch allUsers:objectViewer gs://BUCKET_NAME
---
# Read recent logs
gcloud logging read "resource.type=gce_instance" --project PROJECT_ID --limit 20
# Filter by severity
gcloud logging read "severity>=ERROR" --project PROJECT_ID --limit 20
# Specific resource
gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=my-service" \
--project PROJECT_ID --limit 20
# List available metrics
gcloud monitoring metrics list --project PROJECT_ID | head -50
# Describe metric
gcloud monitoring metrics-scopes describe projects/PROJECT_ID
---
# List billing accounts
gcloud billing accounts list
# Get billing account linked to project
gcloud billing projects describe PROJECT_ID
# View cost breakdown (requires billing export to BigQuery or use console)
# Quick estimate via APIs enabled:
gcloud services list --enabled --project PROJECT_ID
# Create budget (via gcloud beta)
gcloud billing budgets create \
--billing-account=BILLING_ACCOUNT_ID \
--display-name="Monthly Budget" \
--budget-amount=50EUR \
--threshold-rule=percent=50 \
--threshold-rule=percent=90 \
--threshold-rule=percent=100
# List budgets
gcloud billing budgets list --billing-account=BILLING_ACCOUNT_ID
# Describe budget
gcloud billing budgets describe BUDGET_ID --billing-account=BILLING_ACCOUNT_ID
# Stop unused VMs (saves $$$)
gcloud compute instances stop INSTANCE_NAME --zone ZONE --project PROJECT_ID
# Schedule auto-start/stop (use Cloud Scheduler + Cloud Functions or cron)
# Check for idle resources
gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=global \
--recommender=google.compute.instance.IdleResourceRecommender
---
# Enable API
gcloud services enable secretmanager.googleapis.com --project PROJECT_ID
# Create a secret
echo -n "my-secret-value" | gcloud secrets create SECRET_NAME \
--data-file=- \
--project PROJECT_ID
# Or from file
gcloud secrets create SECRET_NAME --data-file=./secret.txt --project PROJECT_ID
# Get latest version
gcloud secrets versions access latest --secret=SECRET_NAME --project PROJECT_ID
# Get specific version
gcloud secrets versions access 1 --secret=SECRET_NAME --project PROJECT_ID
# List all secrets
gcloud secrets list --project PROJECT_ID
# List versions of a secret
gcloud secrets versions list SECRET_NAME --project PROJECT_ID
# Add new version
echo -n "new-value" | gcloud secrets versions add SECRET_NAME --data-file=- --project PROJECT_ID
# Disable old version
gcloud secrets versions disable VERSION_ID --secret=SECRET_NAME --project PROJECT_ID
...安装 Google Cloud Platform 后,可以对 AI 说这些话来触发它
Help me get started with Google Cloud Platform
Explains what Google Cloud Platform does, walks through the setup, and runs a quick demo based on your current project
Use Google Cloud Platform to manage Google Cloud Platform resources via gcloud CLI
Invokes Google Cloud Platform with the right parameters and returns the result directly in the conversation
What can I do with Google Cloud Platform in my developer & devops workflow?
Lists the top use cases for Google Cloud Platform, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/gcloud/ 目录(个人级,所有项目可用),或 .claude/skills/gcloud/(项目级)。重启 AI 客户端后,用 /gcloud 主动调用,或让 AI 根据上下文自动发现并使用。
Google Cloud Platform 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Google Cloud Platform 可免费安装使用。请查阅仓库了解许可证信息。
Manage Google Cloud Platform resources via gcloud CLI. Use for Compute Engine VMs, Cloud Run services, Firebase Hosting, Cloud Storage, and project management. Covers deployment, monitoring, logs, and SSH access.
Google Cloud Platform 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Google Cloud Platform
Identifies repetitive steps in your workflow and sets up Google Cloud Platform to handle them automatically