gcp-cleanup

Scan Google Cloud Platform projects for terminated VMs, orphaned disks, and unused static IPs.

10|4|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/kubony/openclaw-gcp-setup --skill gcp-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gcp-cleanup
Source: https://github.com/kubony/openclaw-gcp-setup/tree/main/.claude/skills/gcp-cleanup
Command: npx skills add https://github.com/kubony/openclaw-gcp-setup --skill gcp-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill performs a read-only scan of Google Cloud Platform resources to identify unused or orphaned assets, enabling safe cleanup planning without making changes.

Core Features & Use Cases

  • Read-only resource inventory: Lists active projects, terminated VMs, orphaned disks, and unused static IPs to inform remediation decisions.
  • Safety-first guidance: Highlights potentially sensitive or prod-like projects and provides commands for manual cleanup.
  • Use Case: An operator wants to audit a GCP environment to determine candidate resources for cleanup and establish a restore plan if needed.

Quick Start

Run the following commands to start a safe, read-only scan: gcloud projects list --format="table(projectId,name,lifecycleState)" for PROJECT in $(gcloud projects list --format="value(projectId)" --filter="lifecycleState:ACTIVE"); do echo "=== $PROJECT ==="

TERMINATED VM (stopped instances)

echo "TERMINATED VMs:" gcloud compute instances list --project=$PROJECT
--filter="status:TERMINATED"
--format="table(name,zone,status)" 2>/dev/null || echo " (access denied)"

Orphaned disks

echo "Orphaned Disks:" gcloud compute disks list --project=$PROJECT
--filter="-users:*"
--format="table(name,zone,sizeGb,type)" 2>/dev/null || echo " (access denied)"

Unused static IPs

echo "Unused Static IPs:" gcloud compute addresses list --project=$PROJECT
--filter="status:RESERVED"
--format="table(name,region,status)" 2>/dev/null || echo " (access denied)" done

Frequently Asked Questions about gcp-cleanup

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

FAQPage Schema
How do I find unused or orphaned resources in Google Cloud Platform?

To find unused GCP resources, run a read-only scan across active projects to identify terminated VMs, unattached disks, and reserved static IPs. This inventory process surfaces orphaned assets for cleanup planning without modifying your environment.

Can I safely inventory GCP resources without accidentally deleting them?

Yes, you can safely inventory GCP resources using a read-only scan that never deletes anything. It operates across active projects to surface unused assets and provides explicit manual remediation commands, ensuring safe cleanup planning.

What is the best way to identify stopped compute instances and unattached disks in GCP?

The best way to identify stopped instances and unattached disks is filtering gcloud compute instances and disks lists by status. Terminated VMs and orphaned disks are surfaced in a read-only scan across active projects for manual review.

How do I audit a GCP environment for unused static IPs?

You audit a GCP environment for unused static IPs by listing compute addresses filtered by a RESERVED status. A read-only scan identifies these across active projects and provides explicit manual remediation commands for safe cleanup.

Does a GCP resource inventory scan work across all my active projects?

Yes, a GCP resource inventory scan works across all active projects. It iterates through projects returned by gcloud with an ACTIVE lifecycle state, checking for terminated VMs, orphaned disks, and unused IPs while handling access-denied errors gracefully.

What precautions are needed when scanning prod-like GCP projects for cleanup candidates?

When scanning prod-like GCP projects for cleanup candidates, the read-only inventory highlights sensitive projects and provides explicit manual remediation commands rather than automated deletion. This ensures operators review warnings and safely execute cleanup manually.