gcloud

Validates and constrains gcloud CLI commands with safety guardrails and data reduction rules.

Updated May 11, 2026
One-click install
npx skills add https://github.com/alon3153/upe-social-publisher --skill gcloud-alon3153
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gcloud
Source: https://github.com/alon3153/upe-social-publisher/tree/main/.agents/skills/gcloud
Command: npx skills add https://github.com/alon3153/upe-social-publisher --skill gcloud-alon3153

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI agents frequently hallucinate gcloud command syntax, flags, and arguments, and can accidentally execute destructive operations or dump unbounded output that exhausts the context window. This Skill enforces mandatory leaf-level syntax validation, destructive-operation guardrails, and output reduction for every gcloud interaction. ## Core Features & Use Cases - Mandatory Syntax Validation: Requires running gcloud help <leaf_command> before proposing or executing any command, with a fixed 4-step plan template covering validation, parameter verification, dry-run, and authorization. - Safety Guardrails: Maintains a denylist of prohibited operations (IAM changes, deletes, billing, KMS, org-level commands) that require explicit human authorization, plus non-interactive --quiet and explicit --project/location scoping rules. - Data Reduction: Enforces --limit, --filter, and --format on all list commands, with schema discovery via single-item JSON inspection to protect the context window. - Use Case: When asked to plan the creation of a Cloud SQL instance, the agent first runs gcloud help sql instances create, verifies flags, proposes a --dry-run invocation, and only then presents the final command for approval. ## Quick Start Ask the agent to plan and safely execute a gcloud command, such as listing running Compute Engine instances in a specific project with filtered output.

Frequently Asked Questions about gcloud

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

FAQPage Schema
How do I safely run gcloud commands with an AI agent?▼

Validate the exact leaf command with `gcloud help <command>` before execution, include `--quiet` for non-interactive runs, and scope every command with `--project` and explicit region or zone flags. Destructive operations require explicit user authorization.

How do I prevent gcloud list commands from returning too much output?▼

Always include at least one data reduction flag: `--limit` to cap results, `--filter` for server-side narrowing, or `--format` to project only needed fields. Run `list --limit=1 --format=json` first to discover the resource schema.

Can AI agents execute gcloud delete or IAM commands autonomously?▼

No. The denylist prohibits autonomous execution of `gcloud * delete`, IAM policy changes, billing commands, organization changes, and KMS operations. These require explicit human-in-the-loop authorization before proceeding.

Does gcloud support dry-run validation before executing commands?▼

Many gcloud commands support `--dry-run` or `--validate-only` flags, which must be checked in the leaf command's help output. When available, a dry-run invocation is mandatory before the real execution step.

How do I use gcloud through the MCP server instead of local CLI?▼

Configure the Cloud CLI remote MCP server at `https://cloudcli.googleapis.com/mcp` with `google_credentials` auth, then call the `run_gcloud_command` tool. The target project must have the Cloud CLI Execution API enabled and the caller needs the `roles/mcp.toolUser` role.

Why does a gcloud command hang without producing output?▼

The command is likely waiting for interactive confirmation or a region/zone selection prompt. Always pass `--quiet` (or `-q`) and explicit location flags so gcloud runs non-interactively in headless environments.