/major-ai-skills:gcloud-clifrom major-ai-skills
Operate gcloud with named configurations, ADC vs CLI auth, Workload Identity Federation, and project-scoped GKE/Cloud Run/GCS workflows agents mis-target.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
gcloud authenticates a principal, scopes work to a project (and often region/zone), and drives Cloud APIs for Compute, GKE, Cloud Run, GCS, Artifact Registry, IAM, and logging. CLI auth (gcloud auth login) is distinct from Application Default Credentials (gcloud auth application-default login)—SDKs use ADC; the CLI uses its own login. Agents treat active configuration + project ID as first-class context: most “wrong resource” bugs are wrong config, not wrong YAML.
┌─────────────────────────────────────────────────────────────┐
│ gcloud auth & API path │
│ │
│ Principal │
│ ├── User: gcloud auth login │
│ ├── Impersonation: --impersonate-service-account │
│ ├── WIF: gcloud auth login --cred-file=… (CI / external) │
│ └── Metadata SA (GCE / Cloud Run / Cloud Build) │
│ │
│ Config │
│ ├── Named configurations (account + project + region) │
│ ├── ADC file (apps/SDKs only — not used by gcloud itself) │
│ └── Flags: --project / --region override ambient defaults │
│ │
│ APIs → GKE · Cloud Run · GCS · Artifact Registry · IAM │
└─────────────────────────────────────────────────────────────┘
Use when
Do not use when
@terraform / @pulumi.@kubernetes.@vault.gcloud config list and gcloud auth list before mutates.gcloud config configurations create|activate) over silently mutating default.--project and --region on mutating commands in scripts—never rely on ambient defaults alone.gcloud auth login ≠ ADC. Apps needing ADC need gcloud auth application-default login (or metadata/WIF ADC).--format=json or yaml; never scrape human tables in automation.--dry-run where available; confirm project ID aloud.# Named configuration (staging vs prod)
gcloud config configurations create prod
gcloud config set project my-prod-123
gcloud config set compute/region us-central1
gcloud config set account [email protected]
gcloud auth login
# Remote: gcloud auth login --no-launch-browser
gcloud config list
gcloud auth list
# Cloud Run — private by default; dedicated runtime SA
gcloud run deploy api \
--project=my-prod-123 \
--region=us-central1 \
--source=. \
--allow-unauthenticated=false \
--service-account=api-runtime@my-prod-123.iam.gserviceaccount.com \
--set-env-vars=LOG_LEVEL=info
# GKE credentials → @kubernetes
gcloud container clusters get-credentials prod-gke \
--project=my-prod-123 --region=us-central1
# Ensure gke-gcloud-auth-plugin is installed for modern kubectl
# GCS + Artifact Registry
gcloud storage cp ./dist/* gs://my-prod-123-assets/app/ --project=my-prod-123
gcloud artifacts repositories list --project=my-prod-123 --location=us-central1
# IAM binding (explicit member — no invented emails)
gcloud projects add-iam-policy-binding my-prod-123 \
--member="serviceAccount:[email protected]" \
--role="roles/run.developer" \
--condition=None
CI (Workload Identity Federation sketch — prefer over JSON keys):
# External account credential file from WIF pool/provider (no long-lived SA key)
gcloud auth login --cred-file="${GOOGLE_APPLICATION_CREDENTIALS}"
gcloud config set project my-prod-123
gcloud run services describe api --region=us-central1 --format=json
| Signature | Likely cause | Fix path |
|---|---|---|
| Permission denied / 403 | Missing IAM role on user/SA | gcloud projects get-iam-policy; bind least role; check Org Policy |
| Wrong cluster / bucket | Active project or config mismatch | gcloud config list; pass --project; activate correct configuration |
| Reauthentication required | Expired user session | gcloud auth login; for apps, refresh ADC separately |
SDK works, gcloud fails (or reverse) | CLI auth ≠ ADC | Configure the missing side; do not assume they share tokens |
WIF invalid_grant / stale ID token | Cred file’s token source expired (e.g. K8s SA volume during long terminate) | Refresh external token; shorten grace; recreate pod client |
API UNAUTHENTICATED with federated token | API method rejects federated tokens | Impersonate SA / GenerateAccessToken per WIF docs |
| Cloud Run image pull fail | Artifact Registry IAM on runtime SA | Grant roles/artifactregistry.reader to runtime SA |
| kubectl auth plugin errors | Missing gke-gcloud-auth-plugin | Install component; verify USE_GKE_GCLOUD_AUTH_PLUGIN=True |
gcloud version); document required components (gke-gcloud-auth-plugin).env, owner, service for cost and blast radius.@docker; deploy manifests with @kubernetes.@terraform / @pulumi) for shared networking and IAM topology.gcloud does not replace IaC for drift control across envs.gcloud beta.@kubernetes — GKE workloads and kubectl debugging@docker — build before Artifact Registry push@terraform / @pulumi — declarative GCP infrastructure@vault — secrets vs Secret Manager patterns@aws-cli / @azure-cli — multi-cloud CLI analogs@opentelemetry — tracing/metrics from Cloud Run / GKEMANDATORY: Print
gcloud config list/gcloud auth listbefore mutating. Prefer named configurations and explicit--project/--region. Prefer WIF and impersonation over SA JSON keys. Do not confuse CLI login with ADC. Never invent or commit service account keys. If project or blast radius is unclear, stop and ask.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job