gcloud

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

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2 --skill gcloud-danilonovaisv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gcloud
Source: https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2/tree/main/agent/skills/gcloud
Command: npx skills add https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2 --skill gcloud-danilonovaisv

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 flood the context window with unbounded command output. This Skill enforces mandatory syntax validation, safety guardrails, and output reduction for every gcloud CLI interaction. ## Core Features & Use Cases - Mandatory Syntax Validation: Requires running gcloud help <leaf_command> before proposing or executing any command, with a strict 4-step plan template including dry-run verification. - Safety Guardrails: Maintains a denylist of prohibited operations (deletes, IAM changes, billing, KMS, org-level changes) that require explicit human authorization before execution. - Data Reduction & Scoping: Enforces --limit, --filter, and --format flags on all list commands, plus explicit --project and location flags to prevent interactive prompts and wrong-project execution. - Use Case: When asked to list running Compute Engine instances, the agent first validates syntax via gcloud help compute instances list, then runs a filtered, project-scoped command like gcloud compute instances list --filter="status:RUNNING" --project=my-project --format=json instead of an unconstrained list. ## Quick Start Ask the agent to list all running Compute Engine instances in your GCP project and it will validate the command syntax, apply filters, and propose a safe scoped command.

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 syntax with `gcloud help <command>` before execution, include `--quiet` for non-interactive runs, and always scope commands with `--project` and explicit region or zone flags. Destructive operations require explicit user authorization.

How do I reduce gcloud command output for AI agents?▼

Use `--format="json(key1,key2)"` for field projection, `--limit=N` to cap results, and `--filter` for server-side narrowing. Never run a list command without at least one of these data reduction flags to avoid context window exhaustion.

What gcloud commands should never run autonomously?▼

Never autonomously execute `gcloud * delete`, IAM policy modifications, `gcloud billing *`, `gcloud organizations *`, `gcloud kms *`, or `gcloud infra-manager deployments apply`. These require explicit human-in-the-loop authorization due to destructive, financial, or security risks.

Can I use gcloud through an MCP server instead of local CLI?▼

Yes, the Cloud CLI remote MCP server at https://cloudcli.googleapis.com/mcp exposes a `run_gcloud_command` tool. It requires the Cloud CLI Execution API enabled, the roles/mcp.toolUser IAM role, and explicit `--project` flags inside the command string.

Why does my gcloud command hang when run by an agent?▼

Commands hang when they trigger interactive confirmation prompts in a headless environment without a TTY. Always pass the `--quiet` (or `-q`) flag and provide explicit location flags like `--region` or `--zone` to prevent selection prompts.