/gcloud-cli-health-check:gcloud-cli-health-checkfrom gcloud-cli-health-check
Verifies gcloud CLI installation, authentication, active project, enabled APIs, billing, IAM bindings, service accounts, and Cloud Run services across primary and secondary GCP projects.
Ships in gcloud-cli-health-check. 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.
None: SKILL.md is the whole skill.
This skill may run in an automated/scheduled context with no user present. Execute all steps autonomously without asking clarifying questions. For write actions (send, post, create, update, delete), only take them if explicitly requested. When in doubt, produce a report of what you found.
All gcloud commands MUST run via mcp__Desktop_Commander__start_process. The Bash tool runs in a sandboxed Linux environment where gcloud is not installed AND the sandbox proxy returns 403 blocked-by-allowlist for every Google endpoint (dl.google.com, sdk.cloud.google.com, oauth2.googleapis.com, www.googleapis.com, accounts.google.com). The user's Mac has Google Cloud SDK installed at /opt/homebrew/bin/gcloud with auth already configured.
✅ mcp__Desktop_Commander__start_process → runs on user's Mac → gcloud found, auth available
❌ Bash tool → runs in Linux sandbox → gcloud not found, Google blocked
If Desktop Commander is unavailable, do NOT try to install gcloud in the sandbox — it is impossible (no network access to Google, no sudo). Write a report documenting the block and stop.
| Thing | Expected value |
|---|---|
| gcloud binary | /opt/homebrew/bin/gcloud (macOS, Homebrew) |
| Active account | [email protected] (primary) |
| Active project | opsagent-prod (project# 523955774086, display: "OpsAgent Production") |
| Compute region | me-west1 (Israeli prod) |
| Secondary project | socialjetopsagent — accessed as [email protected], michal has no IAM on it |
Legacy project (informational, not a failure): opsagent-491114 exists on a different Google account ([email protected] / AI Studio auto-created) and returns PERMISSION_DENIED when queried as michal. Do NOT include it in the primary sweep.
/opt/homebrew/bin/gcloud --version
Fall back to gcloud --version if the explicit path is missing. If both fail → mark Installation ❌ and stop.
/opt/homebrew/bin/gcloud auth list
/opt/homebrew/bin/gcloud auth print-access-token [email protected] | head -c 20
/opt/homebrew/bin/gcloud auth application-default print-access-token | head -c 20
Parse:
*).[email protected] present? User-token OK?If no accounts at all → mark Auth ❌. If wrong account active → mark ⚠️ and note. If ADC missing → mark ⚠️ (some SDKs need it).
/opt/homebrew/bin/gcloud config get-value project
/opt/homebrew/bin/gcloud config get-value compute/region
/opt/homebrew/bin/gcloud projects describe opsagent-prod --format="value(lifecycleState,projectId,name)"
opsagent-prod and lifecycleState=ACTIVE → ✅me-west1 (warn ⚠️ if different, it still works)/opt/homebrew/bin/gcloud billing projects describe opsagent-prod
billingEnabled: true → ✅Do NOT run gcloud alpha billing accounts list — it triggers an interactive prompt to install beta components and hangs in automated runs.
/opt/homebrew/bin/gcloud services list --enabled --project=opsagent-prod --format="value(config.name)"
Critical (must be enabled — flag ❌ if missing):
run.googleapis.comcloudbuild.googleapis.comartifactregistry.googleapis.comsecretmanager.googleapis.comcloudresourcemanager.googleapis.comiam.googleapis.comOptional (flag ⚠️ if missing):
gmail.googleapis.comcalendar-json.googleapis.commonitoring.googleapis.comlogging.googleapis.com/opt/homebrew/bin/gcloud run services list --region=me-west1 --project=opsagent-prod
/opt/homebrew/bin/gcloud run services list --region=us-central1 --project=opsagent-prod
# socialjetopsagent is on a separate account — switch active account first, or skip if not needed:
/opt/homebrew/bin/gcloud run services list --project=socialjetopsagent [email protected]
Record: service name, region, URL, last deployed. If all three return zero services → ⚠️ (not yet deployed / expected in early stage). If any unexpected error → note it.
/opt/homebrew/bin/gcloud projects get-iam-policy opsagent-prod \
--flatten="bindings[].members" \
--format="table(bindings.role)" \
--filter="bindings.members:[email protected]"
Record the roles. If roles/owner or roles/editor is present → ✅. If empty → ❌ (account has no access to project).
/opt/homebrew/bin/gcloud iam service-accounts list --project=opsagent-prod
Record the list. Flag if the default Compute Engine SA still has broad permissions (security best practice: replace with scoped SAs + Workload Identity).
/opt/homebrew/bin/gcloud config configurations list
Record which configuration is active.
Save as gcloud-health-check-YYYY-MM-DD.md in the workspace outputs folder (overwriting any prior BLOCKED report from the same day):
# gcloud CLI Health Check — YYYY-MM-DD HH:MM
**Account:** [email protected]
**Project:** opsagent-prod (+ socialjetopsagent)
**Runner:** Desktop Commander (user's Mac)
**Overall:** ✅ / ⚠️ / ❌
## Summary Table
| Check | Status |
|-------|:------:|
| a. Installation | ✅/❌ |
| b. Authentication (user + ADC) | ✅/⚠️/❌ |
| c. Active Project + Region | ✅/⚠️/❌ |
| d. Billing | ✅/⚠️/❌ |
| e. Critical APIs | ✅/⚠️/❌ |
| f. Optional APIs | ✅/⚠️ |
| g. Cloud Run (me-west1 / us-central1 / socialjetopsagent) | ✅/⚠️/❌ |
| h. IAM roles for michal | ✅/❌ |
| i. Service accounts | ✅/⚠️ |
| j. Configurations | ✅ |
## Details
(Each section with raw output, parsed findings, diffs vs expected state.)
## Notes
(Mismatches, unexpected errors, proposed fixes.)
If any step fails, attempt these fixes via Desktop Commander before giving up (max 3 attempts per step):
/opt/homebrew/bin/gcloud:
which gcloud to find an alternate pathbrew install --cask google-cloud-sdk (may prompt for password — document if it does)gcloud config set account [email protected]gcloud config set project opsagent-prodgcloud config set compute/region me-west1gcloud auth application-default login (requires interactive browser — flag as manual)gcloud services enable <api-name> --project=opsagent-prodAlways save the final report regardless of pass/fail count. Document every fix attempt.
| Account | Project | Role |
|---|---|---|
| [email protected] | opsagent-prod (523955774086) | Primary — OpsAgent core infra, Cloud Run, IAM, billing linked |
| [email protected] | opsagent-491114 (legacy) | Separate project on personal Google account — AI Studio / older signup. michal has NO IAM here. Only inspect by switching active account. |
| [email protected] | socialjetopsagent | SocialJet ops — separate project, separate account. michal has NO IAM here. |
gcloud config set for account/project/region: ✅ allowed in auto-fix loop (reversible)gcloud services enable: ✅ allowed in auto-fix loop (no cost, already-billed project)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub msapps-mobile/claude-plugins --plugin gcloud-cli-health-checkOther plugins' skills for the same job