Google Cloud Storage handler for fractary-file plugin
Executes file operations on Google Cloud Storage including upload, download, delete, list, read, and signed URL generation. Used when files need to be stored or retrieved from GCS buckets, supporting both service account keys and Application Default Credentials for secure GCP access.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-file@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/delete.shscripts/download.shscripts/get-url.shscripts/list.shscripts/read.shscripts/upload.sh<CRITICAL_RULES>
With Service Account Key:
{
"handlers": {
"gcs": {
"project_id": "my-project",
"bucket_name": "my-bucket",
"service_account_key": "${GOOGLE_APPLICATION_CREDENTIALS}",
"region": "us-central1"
}
}
}
With Application Default Credentials (Recommended for GCE/GKE):
{
"handlers": {
"gcs": {
"project_id": "my-project",
"bucket_name": "my-bucket",
"region": "us-central1"
}
}
}
Configuration Fields:
project_id: GCP project ID (required)bucket_name: GCS bucket name (required)service_account_key: Path to service account JSON key (optional if using ADC)region: GCS region (optional, default: "us-central1")Security Best Practices:
${GOOGLE_APPLICATION_CREDENTIALS}See docs/gcs-setup-guide.md for detailed setup instructions. </CONFIGURATION>
<WORKFLOW> 1. Load handler configuration from request 2. Validate operation parameters 3. Expand environment variables in key path (if present) 4. Prepare GCS-specific parameters (project, bucket, credentials) 5. Execute gcloud CLI command via script 6. Parse script output 7. Return structured result to agentParameter Flow:
{
"success": true,
"message": "Operation completed successfully",
"url": "https://storage.googleapis.com/my-bucket/path/to/file",
"size_bytes": 1024,
"checksum": "sha256:abc123..."
}
Public File Upload:
{
"success": true,
"message": "File uploaded successfully (public)",
"url": "https://storage.googleapis.com/my-bucket/docs/document.pdf",
"size_bytes": 2048,
"checksum": "sha256:def456..."
}
Signed URL:
{
"success": true,
"message": "Signed URL generated",
"url": "https://storage.googleapis.com/my-bucket/file?X-Goog-Signature=...",
"expires_in": 3600
}
</OUTPUTS>
<ERROR_HANDLING>
<IAM_ROLES> When running in GCP (GCE, GKE, Cloud Functions), use Workload Identity or ADC:
Benefits:
Required IAM Roles:
roles/storage.objectCreator - Upload filesroles/storage.objectViewer - Download/read filesroles/storage.objectAdmin - Full access (if delete needed)Example IAM Policy:
{
"bindings": [
{
"role": "roles/storage.objectAdmin",
"members": [
"serviceAccount:my-service@my-project.iam.gserviceaccount.com"
]
}
]
}
Workload Identity Setup (GKE):
# Bind Kubernetes service account to GCP service account
gcloud iam service-accounts add-iam-policy-binding \
my-service@my-project.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:my-project.svc.id.goog[namespace/ksa-name]"
See docs/workload-identity.md for detailed setup. </IAM_ROLES>