gcloud
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.
What this skill does
# Google Cloud Platform Skill Manage GCP resources using `gcloud`, `gsutil`, and `firebase` CLIs. ## Installation ### gcloud CLI (one-time setup) ```bash # 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 ``` ### Firebase CLI ```bash npm install -g firebase-tools firebase login ``` ## Quick Reference ### Authentication & Config ```bash # 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 ``` --- ## Compute Engine (VMs) ### List Instances ```bash # 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)" ``` ### Start/Stop/Restart ```bash 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 ``` ### SSH Access ```bash # 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 ``` ### View Logs ```bash # 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" ``` --- ## Cloud Run ### List Services ```bash # 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 ```bash # 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 ``` ### View Service Details ```bash gcloud run services describe SERVICE_NAME --region REGION --project PROJECT_ID ``` ### View Logs ```bash # 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)" ``` ### Update Environment Variables ```bash gcloud run services update SERVICE_NAME \ --region REGION \ --project PROJECT_ID \ --set-env-vars "KEY1=value1,KEY2=value2" ``` ### Traffic Management ```bash # 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 Hosting ### List Projects ```bash firebase projects:list ``` ### Deploy ```bash # 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 ``` ### Preview Channels ```bash # 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 ``` ### Rollback ```bash # List recent deploys firebase hosting:releases:list --project PROJECT_ID # Rollback to specific version firebase hosting:rollback --project PROJECT_ID ``` --- ## Cloud Storage (gsutil) ```bash # 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 ``` --- ## Logs & Monitoring ### Cloud Logging ```bash # 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 ``` ### Monitoring Metrics ```bash # List available metrics gcloud monitoring metrics list --project PROJECT_ID | head -50 # Describe metric gcloud monitoring metrics-scopes describe projects/PROJECT_ID ``` --- ## Billing & Cost Monitoring ### View Current Costs ```bash # 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 ``` ### Set Budget Alerts ```bash # 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 ``` ### Cost-Saving Tips ```bash # 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 ``` --- ## Secret Manager ### Create & Manage Secrets ```bash # 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 ``` ### Access Secrets ```bash # 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 ``` ### Update Secrets ```bash # 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 # Delete version (permanent!) gcloud secrets versions destroy VERSION_ID --secret=SECRET_NAME --project PROJECT_ID ``` ### Use in Cloud Run ```bash # Deploy with secret as env var gcloud run deploy SERVICE_NAME \ --image IMAGE \ --region REGION \ --project PROJECT_ID \ --set-secrets="ENV_VAR_NAME=SECRET_NAME:latest" # Moun
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.