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).
- License 许可
- Apache-2.0
- 最近更新
- 2026-08-23
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- google-cloud-storage-basics
- license
- Apache-2.0
- metadata
- { "tags": [ "gcs", "storage", "cloud-storage", "buckets", "objects" ], "version": "v1", "category": "storage", "publisher": "google", "support_tier": "primary" }
- description
- 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).
02 资源文件 10
- 参考文档references/cli-api-usage.md7.8 KB
- 参考文档references/client-library-usage.md4.8 KB
- 参考文档references/core-concepts.md7.5 KB
- 参考文档references/data-management.md20.8 KB
- 参考文档references/data-transfer.md11.8 KB
- 参考文档references/gcsfuse.md21.1 KB
- 参考文档references/high-performance-storage.md11.2 KB
- 参考文档references/iac-usage.md9.4 KB
- 参考文档references/mcp-usage.md11.3 KB
- 参考文档references/storage-intelligence.md15.3 KB
03 SKILL.md 正文
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
gcloudinvocation, 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 setfor 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) or HTTP requests to the Cloud Storage MCP server (https://storage.googleapis.com/storage/mcp), set this exact User-Agent header, verbatim — the collection pipeline parses thegcs-skills/<version>andskill:<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.
-
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 -
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
USmulti-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-central1Using 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)" -
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-bucketUsing 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" -
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 storageand 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.
04 同仓库更多 Skills
skill-repair
Use this to fix and re-install agent skills that have failed installation. This skill provides the necessary context and permissions to surgically update the `manifest.json` after a fix has been applied.
notebook-guidance
This skill guides the use of Jupyter notebooks for data analysis, exploration, and visualization, particularly with BigQuery. It outlines best practices for notebook execution and validation (supporting both cell-by-cell execution and full notebook generation depending on tool availability), library installation, and structuring notebooks for clarity. It also covers specific rules for data cleaning, plotting, and integrating with BigQuery SQL and machine learning workflows. Relevant when any of the following conditions are true: 1. The user request involves a data analysis, data exploration, data visualization, or data insights task that requires multiple steps, queries, or visualizations to answer. 2. The user explicitly requests a notebook (.ipynb). 3. You are creating, editing, or executing cells in a Jupyter notebook. 4. You need to query BigQuery from within a notebook. DO NOT use the Python BigQuery client library; instead, you MUST use the `%%bqsql` magics explained in this skill.
ml-best-practices
CRITICAL RULE: You MUST use this skill whenever the task involves any machine learning tasks or data analysis. Use this skill if the user's prompt or requirements mention any of the following: * Clustering * Classification * Regression * Time series forecasting * Statistical testing * Model comparison * ML * Data analysis SQL/BigQuery ML HANDOFF: If the user requires a SQL solution, use this skill to dictate the ANALYSIS STEPS (e.g., markdown analysis cells, visualization logic), but defer to `bigquery` for all SQL syntax.
managing-python-dependencies
Ensures proper Python dependency management, avoiding global `pip install` and adhering to project-specific tooling. Use this skill if any of the following are true: 1. Attempting to run `pip install {package_name}`. 2. Python packages or dependencies need to be added or modified. 3. Initiating a new Python project. 4. Creating a new notebook, even if just using BigQuery cells. 5. Generating Python code that includes `import` statements for third-party libraries. 6. Before executing Python scripts via the terminal to ensure the correct virtual environment is active.
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).
gcs-security-assessment
Assesses security posture, evaluates risks, and checks SAIF compliance for Google Cloud Storage buckets or projects. Use when the user requests security scans, vulnerability checks, or SAIF assessments. Don't use when: The user is asking about non-GCS resources (Compute Engine, GKE, etc.), investigating a live production outage, or asking general security questions not tied to a specific project or bucket.