LaunchKit · 2026
Back to Skills

cloudflare-r2

Upload files to Cloudflare R2 storage using wrangler CLI.

3
1.4k downloads
by @xiaoyaner0201

Setup & Installation

openclaw skills install @xiaoyaner0201/cloudflare-r2

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install cloudflare-r2

What This Skill Does

Uploads files to Cloudflare R2 object storage using the wrangler CLI. Supports single-file and batch uploads via a shell script or direct wrangler commands. Uploaded files are served from a public R2 CDN domain.

Cloudflare R2 charges no egress fees, making it cheaper than S3 for files served frequently over the public internet.

When to use it

  • Uploading article images to a CDN before publishing
  • Batch-deploying static assets for a web project
  • Hosting video files without incurring egress fees
  • Replacing local file references with public R2 URLs
  • Managing bucket contents by listing or deleting remote objects

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Upload screenshot.png to R2 under the docs/ folder

AGENT
  1. 1Read bucket name, accountId, and apiToken from ~/.config/cloudflare/r2.json
  2. 2Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables
  3. 3Run: wrangler r2 object put "<bucket>/docs/screenshot.png" --file screenshot.png --remote
  4. 4Construct public URL using publicDomain from config
OUTPUT

https://pub-xxx.r2.dev/docs/screenshot.png

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

Cloudflare accountCloudflare R2 API tokenR2 bucket created in Cloudflare dashboard~/.config/cloudflare/r2.json config file with bucket, accountId, publicDomain, and apiToken