Catalog
google/google-cloud-storage-basics

google

google-cloud-storage-basics

Stores, retrieves, and manages data as objects in Cloud Storage (Google Cloud Storage, or GCS) buckets. Use when you need to interact with Cloud Storage — create or configure buckets, upload, download, stream, or transfer data, organize objects with folders, generate signed URLs, control access (IAM, ACLs, public access prevention), set storage classes and tiering (Standard, Nearline, Coldline, Archive), manage cost and lifecycle, protect data (versioning, encryption/CMEK, retention and Bucket Lock, object holds, soft delete), host static websites, trigger Pub/Sub notifications on object changes, mount buckets as a file system (gcsfuse), or optimize storage performance at any scale. Covers the gcloud storage / gsutil CLI, JSON and XML APIs, client libraries, Terraform, and Cloud Storage MCP servers. Don't use for block storage (Persistent Disk), data warehousing/analytics (BigQuery), or databases (Cloud SQL, Spanner, Bigtable, Firestore).

global
category:Storage
New~1.9k
v1.0Saved Jul 23, 2026

Google Cloud Storage Basics

Google Cloud Storage (GCS) is a managed service for storing data as objects at any scale. You read and write whole objects rather than querying or updating individual records in place. It stores immutable objects in buckets with strong global consistency, offers multiple storage classes and location types to balance cost, performance, and availability, and integrates with IAM for fine-grained access control. GCS serves workloads ranging from website content and backups to data lakes and high-throughput AI/ML training.

Attribution

Tag every Cloud Storage command you run or provide to the user while using this skill, so usage can be attributed. The tag identifies only the skill and its version; it carries no user data.

  • Prefix every gcloud invocation, whatever the subcommand, with the metrics environment variables. Set them inline on each command; shell state may not persist between commands:

    CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud <command> [flags]
    

    Do not use gcloud config set for this: it would persist beyond the current task and mislabel unrelated usage.

  • On direct HTTP calls to the Cloud Storage APIs (for example with curl), set this exact User-Agent header, verbatim — the collection pipeline parses the gcs-skills/<version> and skill:<name> tokens, so any rewording breaks attribution:

    User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)
    
  • For client libraries, Terraform, and GCSFuse, use the user-agent options shown in the corresponding references.

Quick Start

If a Cloud Storage MCP server is connected, prefer its structured tools (such as create_bucket, list_objects, read_object, and upload_object) over the CLI and API commands below — see MCP Usage. Fall back to gcloud storage and the JSON API when no MCP server is available.

  1. Enable the Cloud Storage API:

    CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud services enable storage.googleapis.com --quiet
    
  2. Create a Bucket:

    Bucket names live in a single global namespace shared by all of Cloud Storage — not scoped to your project or organization — so short or common names are usually taken. If the location is omitted, the bucket defaults to the US multi-region.

    Using the gcloud CLI:

    CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud storage buckets create gs://my-bucket --location=us-central1
    

    Using the JSON API:

    curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
      -H "Content-Type: application/json" \
      -d '{"name": "my-bucket", "location": "US-CENTRAL1"}' \
      "https://storage.googleapis.com/storage/v1/b?project=$(gcloud config get-value project)"
    
  3. Upload an Object:

    Using the gcloud CLI:

    CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud storage cp ./my-file.txt gs://my-bucket
    

    Using the JSON API:

    curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
      -H "Content-Type: text/plain" \
      --data-binary @my-file.txt \
      "https://storage.googleapis.com/upload/storage/v1/b/my-bucket/o?uploadType=media&name=my-file.txt"
    
  4. Download an Object:

    Using the gcloud CLI:

    CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud storage cp gs://my-bucket/my-file.txt .
    

    Using the JSON API:

    curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
      "https://storage.googleapis.com/storage/v1/b/my-bucket/o/my-file.txt?alt=media"
    

Reference Directory

  • Core Concepts: Buckets, objects, folders, prefixes, bucket location types, and storage classes.

  • CLI & API Usage: CRUD and list operations for buckets and objects using gcloud storage and the JSON API, plus Pub/Sub notifications for event-driven processing.

  • Client Libraries: Using Google Cloud client libraries for Python, Java, Node.js, and Go, with pointers to all other supported languages.

  • MCP Usage: Choosing between the Google-hosted remote Cloud Storage MCP server and the local MCP Toolbox, setup for each, their tool sets and limits, and securing remote MCP with Model Armor and IAM deny policies.

  • Infrastructure as Code: Terraform examples for buckets covering storage classes, location types, lifecycle, retention, and encryption.

  • Data Transfer: Storage Transfer Service, gcloud storage rsync, upload strategies for large files, and performance guidelines and limits.

  • Data Management: IAM roles, authentication (including signed URLs and HMAC), access control, network security, automated security assessment, data protection, and pricing and cost optimization (lifecycle rules, Autoclass).

  • Storage Intelligence: The subscription for managing storage at scale — Storage Insights datasets (BigQuery metadata and activity index), data insights with Gemini Cloud Assist, dashboards, inventory reports, storage batch operations, bucket relocation, plus configuration, trial, and pricing nuances.

  • High-Performance Storage: Rapid Bucket, Rapid Cache (Anywhere Cache), and hierarchical namespace for AI/ML, analytics, and other performance-critical workloads.

  • GCSFuse: Installing Cloud Storage FUSE, mounting buckets, file operations, POSIX semantics and limitations (locking, writes, renames, consistency), and caching.

If you need product information not found in these references, use the Developer Knowledge MCP server search_documents tool.

Files11
11 files · 132.0 KB

Select a file to preview

Grade adjusted by static analysis guardrails

AI scored this skill as grade A, but static analysis findings capped it to B:

  • Recursive deletion pattern (rm -rf) (max: B)

Overall Score

87/100

Grade

B

Good

Safety

85

Quality

89

Clarity

88

Completeness

84

Summary

The Google Cloud Storage Basics skill provides comprehensive guidance for interacting with Cloud Storage through multiple interfaces (CLI, JSON API, client libraries, Terraform, and MCP servers). It covers bucket and object operations, data management, security, performance optimization, and specialized features like GCSFuse mounting and Storage Intelligence. The skill includes 10 detailed reference documents organized by operational domain, with clear examples and attribution requirements for usage tracking.

Static Analysis Findings

3 findings

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Destructive Operation
SEC-001Recursive DeletionMax: B

Recursive deletion pattern (rm -rf)

references/gcsfuse.mdrm -rf
SEC-002Privilege Escalation7x in 1 file

Privilege escalation (sudo)

references/gcsfuse.mdsudo asudo tsudo u7x
Network Access
SEC-060Outbound Network Request

Outbound network request (curl/wget/fetch)

references/gcsfuse.mdcurl https://

Detected Capabilities

file readshell executionHTTP requestscurl commandsenvironment variable accessGoogle Cloud CLI invocationAPI documentation referencecode examples (Python, Java, Node.js, Go)Terraform configurationbash script execution

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

cloud storage operationsgcs bucket managementdata transfer gcsgcsfuse mountcloud storage securitystorage lifecycle rulesstorage intelligence analysissigned url generationbatch storage operationshierarchical namespace setup

Risk Signals

WARNING

Recursive deletion (rm -rf)

references/gcsfuse.md
INFO

Privilege escalation (sudo) in context of system administration

references/gcsfuse.md
INFO

curl with Authorization Bearer token

SKILL.md and references/cli-api-usage.md
INFO

Network requests to Google Cloud and external APIs

Multiple references
INFO

Environment variable usage (gcloud config, ADC)

Throughout skill

Referenced Domains

External domains referenced in skill content, detected by static analysis.

cloud.google.comdocs.cloud.google.comgithub.comlookerstudio.google.commyazurestorageaccount.blob.core.windows.netpackages.cloud.google.comregistry.terraform.iostorage.googleapis.comwww.apache.org

Use Cases

  • Create and manage GCS buckets with specific storage classes and location types
  • Upload, download, and transfer data at scale using CLI, API, and transfer services
  • Configure data protection (versioning, soft delete, retention, encryption, holds)
  • Implement IAM policies and access controls for secure bucket and object management
  • Mount GCS buckets as filesystems using GCSFuse for AI/ML and analytics workloads
  • Set up and optimize Cloud Storage FUSE for high-throughput sequential reads/writes
  • Use Storage Intelligence for multi-bucket analysis, batch operations, and relocation
  • Generate signed URLs and HMAC keys for temporary or delegated access
  • Configure lifecycle rules and Autoclass for cost optimization
  • Analyze bucket metadata and activity via BigQuery datasets with Storage Insights

Quality Notes

  • Comprehensive coverage of GCS features across multiple operational domains with well-organized reference structure
  • Clear attribution requirements for usage tracking (CLOUDSDK_METRICS_ENVIRONMENT variables and User-Agent headers)
  • Strong emphasis on security best practices: explicit permission requests before destructive operations (bucket/object delete), UBLA, PAP, data protection options
  • Excellent documentation of limitations and constraints (GCSFuse POSIX semantics, Rapid Bucket compatibility, feature incompatibilities)
  • Detailed examples across multiple languages (Python, Java, Node.js, Go) and tools (CLI, API, Terraform, MCP)
  • Good error-handling guidance for edge cases (soft delete recovery, Parallel Composite Uploads compatibility, sliced download fallbacks)
  • Strong separation of concerns: MCP servers, CLI, APIs, and client libraries with clear decision trees and guidance on when to use each
  • Manages complexity well: High-Performance Storage, Storage Intelligence, and GCSFuse are documented with practical workflows and decision guides
  • Multiple caution/critical blocks for destructive operations (bucket delete, retention lock, object retention)
  • User-agent and metrics attribution implemented consistently across all command examples
Model: claude-haiku-4-5-20251001Analyzed: Jul 23, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use google/google-cloud-storage-basics in your dev environment

Command Palette

Search for a command to run...