# /gcloud: Run gcloud commands safely with checked syntax and small output

Source: https://trendhub.net/skills/google-skills/gcloud
Skill folder: https://github.com/google/skills/tree/main/plugins/cloud/google-cloud-developer/skills/gcloud
Pack: Google Agent Skills (https://trendhub.net/skills/google-skills)
Works with: Any agent supported by the skills CLI, Claude Code (plugins), Codex (plugins), Antigravity CLI

The gcloud skill treats the agent's memory of gcloud flags as unreliable. Before proposing or running a command it reads help for that exact subcommand, checks for a dry-run option, and keeps output small with limits, filters and field projections. Risky categories such as deletes, IAM changes, billing, organisation settings and KMS are never run without your explicit go-ahead.

## When to use it

- You want the agent to inspect or change Google Cloud resources from the terminal.
- You keep getting gcloud commands with flags that do not exist.
- Large list commands are filling the agent's context window.

## How it works

1. **Validate the leaf command**: The agent runs gcloud help on the specific subcommand it intends to use, since help for a parent group does not count.
2. **Check for a dry run**: It confirms required flags and, when a dry-run or validate-only flag exists, previews the change with it first.
3. **Scope every call**: Each command names the project and region or zone explicitly and adds --quiet so it never stalls on a prompt.
4. **Keep output small**: List calls always carry a limit, filter or format projection, and unknown schemas are read from a single returned item.
5. **Ask before risky actions**: Commands on the denylist, including enabling APIs or installing the CLI, are proposed for your approval instead of run.

## What it steers the agent away from

- Hallucinated flags and positional arguments.
- Commands that hit the wrong project because they relied on the active configuration.
- Unbounded list output and chained shell pipelines that are hard to review.

## What it can touch

It runs gcloud commands with your credentials, read-only by default, and proposes write or destructive commands for you to approve.

## Pairs well with

- `/google-cloud-recipe-auth`
- `/cloud-run-basics`
- `/compute-vm-creation`

## Questions

### Can it use the gcloud MCP server instead of a shell?

Yes. The skill covers both direct CLI execution and the Cloud CLI remote MCP server's run_gcloud_command tool.

### Why can't it pipe or chain commands?

The skill limits the agent to one gcloud command at a time without pipes, substitution or redirection so each step stays easy for you to review.
