gcloud

Validate and execute gcloud CLI commands with safety guardrails and data reduction strategies.

23.7k|2.0k|Updated Mar 31, 2026
Ready to run
npx skills add https://github.com/google/skills --skill gcloud-google
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: gcloud
Source: https://github.com/google/skills/tree/main/plugins/cloud/google-cloud-developer/skills/gcloud
Command: npx skills add https://github.com/google/skills --skill gcloud-google

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? This Skill eliminates hallucinated or incorrect gcloud syntax, prevents destructive operations without authorization, and optimizes command output to conserve context window space during agentic workflows. ## Core Features & Use Cases - Mandatory Syntax Validation: Enforces gcloud help <command> checks before execution to prevent stale or incorrect flag/parameter usage. - Safety Guardrails: Maintains a denylist of prohibited operations (IAM, billing, KMS, organization-level changes) requiring explicit user authorization. - Data Reduction: Applies projection, filtering, and limiting strategies (--format, --filter, --limit) to minimize redundant output. - Multi-Execution Mode Support: Handles both direct CLI execution and Model Context Protocol (MCP) remote server invocation. - Use Case: You want to list Compute Engine instances across 10 regions, but you only need the name and internal IP. Use this Skill to construct a filtered, projected command that returns only those fields, avoiding context bloat from full resource details. ## Quick Start Before executing any gcloud command, ask the Skill to validate the syntax using gcloud help, confirm the required and optional flags, and propose a dry-run if the operation supports it.

Frequently Asked Questions about gcloud

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent hallucinated gcloud command flags?▼

Always run `gcloud help <leaf_command>` before proposing or executing any gcloud command. This retrieves the authoritative flag list for that specific subcommand, avoiding stale or incorrect syntax from training data.

What gcloud operations require explicit user authorization?▼

Destructive and privileged operations require authorization: any IAM policy modification, billing commands, KMS encryption operations, organization-level changes, resource deletion, and Infrastructure Manager deployments. All others may proceed after syntax validation.

How do I reduce gcloud list output to save context?▼

Use `--format="json(field1, field2)"` for column projection, `--filter="expression"` for server-side filtering, and `--limit=N` to cap results. Discover field names first with `--limit=1 --format=json` on the resource list.

Can I use gcloud commands in the Model Context Protocol (MCP)?▼

Yes. The Cloud CLI remote MCP server at `https://cloudcli.googleapis.com/mcp` accepts `run_gcloud_command` tool calls. Requires the Cloud CLI Execution API enabled and the `roles/mcp.toolUser` IAM role on the target project.

What should I include in every gcloud command for attribution?▼

Prefix CLI commands with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gcloud; plugin:google-cloud-developer)"` and append the same string to HTTP User-Agent headers. Omit this in generated scripts or code provided to users.

Why must gcloud commands include --quiet flag?▼

AI agents run in non-interactive headless environments without TTY input. Without `--quiet`, confirmation prompts block indefinitely. Include `--quiet` (or `-q`) on all state-changing commands to force non-interactive mode.