From greenative-skills
Interact with the Greenative Platform Storage API to upload, download, list, and delete objects in storage datasources.
How this skill is triggered — by the user, by Claude, or both
Slash command
/greenative-skills:storageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
User request: $ARGUMENTS
User request: $ARGUMENTS
Manage objects in Greenative Platform storage datasources. All requests are POST to $GN_ENDPOINT with a base64-encoded JSON body.
Build the authorization header from the environment variables:
AUTH=$(printf "%s:%s" "$GN_KEY" "$GN_SECRET" | base64 | tr -d '\n')
Every request must include this header: -H "Authorization: Basic $AUTH"
The JSON body must include:
component: "storage"The JSON request body must be base64-encoded before sending. Use printf to build the JSON, pipe through base64, and pass via command substitution to curl -d:
AUTH=$(printf "%s:%s" "$GN_KEY" "$GN_SECRET" | base64 | tr -d '\n')
curl -s -X POST -H 'content-type: application/json' -H "Authorization: Basic $AUTH" \
-d "$(printf '{"component":"storage","action":"..."}' | base64)" \
"$GN_ENDPOINT"
putref)Upload is a two-step process: first get a presigned upload URL, then PUT the file to that URL.
Step 1 — Get presigned upload URL:
Parameters:
datasource (required) — Storage datasource nameobject (required) — Object filenameAUTH=$(printf "%s:%s" "$GN_KEY" "$GN_SECRET" | base64 | tr -d '\n')
curl -s -X POST -H 'content-type: application/json' -H "Authorization: Basic $AUTH" \
-d "$(printf '{"component":"storage","action":"putref","datasource":"ds1","object":"data.csv"}' | base64)" \
"$GN_ENDPOINT"
Response:
{"data": "https://<upload url>", "status": "success"}
Step 2 — Upload the file using the presigned URL:
curl -X PUT --upload-file ./data.csv "https://<upload url>"
getref)Download is a two-step process: first get a presigned download URL, then GET the file from that URL.
Step 1 — Get presigned download URL:
Parameters:
datasource (required) — Storage datasource nameobject (required) — Object filenameAUTH=$(printf "%s:%s" "$GN_KEY" "$GN_SECRET" | base64 | tr -d '\n')
curl -s -X POST -H 'content-type: application/json' -H "Authorization: Basic $AUTH" \
-d "$(printf '{"component":"storage","action":"getref","datasource":"ds1","object":"data.csv"}' | base64)" \
"$GN_ENDPOINT"
Response:
{"data": "https://<download url>", "status": "success"}
Step 2 — Download the file using the presigned URL:
curl -X GET -o ./data.csv "https://<download url>"
list)Parameters:
datasource (required) — Storage datasource nameAUTH=$(printf "%s:%s" "$GN_KEY" "$GN_SECRET" | base64 | tr -d '\n')
curl -s -X POST -H 'content-type: application/json' -H "Authorization: Basic $AUTH" \
-d "$(printf '{"component":"storage","action":"list","datasource":"ds1"}' | base64)" \
"$GN_ENDPOINT"
Response:
{
"data": [
{
"name": "data/file1.txt",
"registeredAt": "2024-04-24T09:42:29.628Z",
"size": 20017,
"updatedAt": "2024-04-24T09:42:29.628Z"
}
],
"status": "success"
}
Response fields per object:
name — Object name/pathregisteredAt — Creation timestamp (ISO 8601)size — File size in bytesupdatedAt — Last update timestamp (ISO 8601)delete)Parameters:
datasource (required) — Storage datasource nameobject (required) — Object name to deleteAUTH=$(printf "%s:%s" "$GN_KEY" "$GN_SECRET" | base64 | tr -d '\n')
curl -s -X POST -H 'content-type: application/json' -H "Authorization: Basic $AUTH" \
-d "$(printf '{"component":"storage","action":"delete","datasource":"ds1","object":"file1.txt"}' | base64)" \
"$GN_ENDPOINT"
Response:
{"data": "Deleted successfully", "status": "success"}
object for all actions.npx claudepluginhub greenative-ai/skills --plugin greenative-skillsManages Cloudflare R2 S3-compatible object storage in Workers: bucket creation, bindings, uploads/downloads, CORS, presigned URLs, multipart uploads. Fixes R2_ERROR and CORS issues.
Guides file storage operations on bkend.ai: upload via presigned URLs, download via CDN, visibility levels, and multipart upload for large files.
Guides file storage and CDN setup with object storage (S3, GCS, Azure Blob), presigned URLs, image/video processing pipelines, lifecycle policies, cost optimization, and backups.