Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

gcp-cloud-storage

БесплатноБез исполняемых скриптовНе проверен

Manage Google Cloud Storage for scalable object storage. Create and configure buckets, upload and organize objects, generate signed URLs for secure temporary…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

GCP Cloud Storage

Overview

Google Cloud Storage is a unified object storage service with global edge caching. It offers multiple storage classes (Standard, Nearline, Coldline, Archive) for cost optimization, strong consistency, and integration with all GCP services.

Instructions

Core concepts

  • Bucket — globally unique container, scoped to a project and location
  • Object — a file with metadata, identified by name (path) within a bucket
  • Storage Class — Standard, Nearline (30d), Coldline (90d), Archive (365d)
  • Signed URL — time-limited URL for authenticated access without credentials
  • Lifecycle Rule — automatic actions based on age, class, or conditions
  • IAM / ACL — access control at bucket and object level; with uniform bucket-level access only IAM applies
  • Soft delete — enabled by default on buckets with a 7-day retention: deleted objects can be restored during that window (and are billed meanwhile)

Bucket Operations

# Create a bucket with location and default storage class
gcloud storage buckets create gs://northwind-assets-prod \
  --location=us-central1 \
  --default-storage-class=STANDARD \
  --uniform-bucket-level-access
# List buckets
gcloud storage ls
# Make every object publicly readable (static hosting only; skip for private data)
# First check the bucket's public access prevention setting; it blocks allUsers bindings
gcloud storage buckets add-iam-policy-binding gs://northwind-assets-prod \
  --member=allUsers \
  --role=roles/storage.objectViewer
# Enable versioning
gcloud storage buckets update gs://northwind-assets-prod --versioning

Object Operations

# Upload a file
gcloud storage cp ./build/app.zip gs://northwind-assets-prod/releases/v1.2.0/app.zip
# Sync a directory (-r is required to include subdirectories)
gcloud storage rsync -r ./dist gs://northwind-assets-prod/static/ \
  --delete-unmatched-destination-objects \
  --cache-control="public, max-age=86400"
# Copy between buckets
gcloud storage cp gs://northwind-staging/data.csv gs://northwind-archive/data.csv
# List objects with prefix
gcloud storage ls gs://northwind-assets-prod/releases/ --recursive
# Python client: upload and download
from google.cloud import storage

client = storage.Client()  # uses Application Default Credentials
blob = client.bucket("northwind-assets-prod").blob("reports/q4.pdf")
blob.upload_from_filename("q4.pdf", content_type="application/pdf")
blob.download_to_filename("q4-copy.pdf")
# Remove objects
gcloud storage rm gs://northwind-assets-prod/old-file.txt

Signed URLs

A V4 signed URL needs a credential that can sign. A service-account key file works (Client.from_service_account_json). Keys are a liability; on Cloud Run, GCE or with user credentials, impersonate a service account that has roles/iam.serviceAccountTokenCreator on itself instead, and pass its email and a fresh access token:

# Keyless signing through the IAM signBlob API (not run here: needs a real project)
from datetime import timedelta

import google.auth
from google.auth.transport.requests import Request
from google.cloud import storage

blob = storage.Client().bucket("northwind-assets-prod").blob("reports/q4.pdf")
creds, _ = google.auth.default()
creds.refresh(Request())
url = blob.generate_signed_url(
    version="v4", expiration=timedelta(hours=1), method="GET",
    service_account_email="[email protected]",
    access_token=creds.token,
)
# Signed URL for download with a key-based credential (1 hour)
from google.cloud import storage
from datetime import timedelta

client = storage.Client()
bucket = client.bucket('northwind-assets-prod')
blob = bucket.blob('reports/q4.pdf')

url = blob.generate_signed_url(
    version='v4',
    expiration=timedelta(hours=1),
    method='GET'
)
print(f"Download URL: {url}")
# Signed URL for upload (the client must send the same Content-Type)
url = blob.generate_signed_url(
    version='v4',
    expiration=timedelta(minutes=15),
    method='PUT',
    content_type='application/octet-stream'
)
print(f"Upload URL: {url}")
# Client uploads with: curl -X PUT -H "Content-Type: application/octet-stream" --data-binary @file "$url"
# Signed URL from the CLI, impersonating a service account (no key file)
gcloud storage sign-url gs://northwind-assets-prod/reports/q4.pdf \
  --duration=1h \
  --impersonate-service-account=signer@northwind-prod.iam.gserviceaccount.com

Lifecycle Rules

lifecycle-config.json moves log objects to colder classes and expires them:

{
  "rule": [
    {
      "action": {"type": "SetStorageClass", "storageClass": "NEARLINE"},
      "condition": {"age": 30, "matchesPrefix": ["logs/"]}
    },
    {
      "action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
      "condition": {"age": 90, "mat
Полный SKILL.md на GitHub

Установить gcp-cloud-storage в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл gcp-cloud-storage?

Manage Google Cloud Storage for scalable object storage. Create and configure buckets, upload and organize objects, generate signed URLs for secure temporary access, set lifecycle rules for cost optimization, and configure access control.

Как установить скилл gcp-cloud-storage?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл gcp-cloud-storage запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить gcp-cloud-storage с