cloudflare-r2

Manage Cloudflare R2 objects with upload, download, list, delete, and presigned URLs.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/stephanofer/finance-trackerv2 --skill cloudflare-r2-stephanofer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cloudflare-r2
Source: https://github.com/stephanofer/finance-trackerv2/tree/main/.opencode/skill/cloudflare-r2
Command: npx skills add https://github.com/stephanofer/finance-trackerv2 --skill cloudflare-r2-stephanofer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables programmatic management of Cloudflare R2 object storage, providing a unified pattern to upload, download, list, delete files, and generate presigned URLs for secure, time-limited access in serverless and edge deployments.

Core Features & Use Cases

  • Upload files to an R2 bucket using a simple API binding.
  • Download, stream, and serve objects quickly with efficient requests.
  • List objects with prefix filtering and pagination for inventory and media libraries.
  • Delete single or multiple objects as part of cleanup and lifecycle management.
  • Generate presigned URLs to grant temporary access without exposing credentials.
  • Use Case: Build a serverless API that accepts user uploads, stores them in R2, and serves private assets via presigned URLs.

Quick Start

Configure a bucket binding in wrangler.toml (e.g., MY_BUCKET bound to my-bucket), then access the bucket in code via env.MY_BUCKET. To get started:

  • Create the bucket: wrangler r2 bucket create my-bucket
  • Basic usage: upload with env.MY_BUCKET.put(key, data), download with env.MY_BUCKET.get(key), list with env.MY_BUCKET.list(...), delete with env.MY_BUCKET.delete(key).

Frequently Asked Questions about cloudflare-r2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upload files to Cloudflare R2 in a serverless deployment?▼

Upload files to a Cloudflare R2 bucket by binding it in wrangler.toml and calling env.MY_BUCKET.put(key, data). This method enables straightforward file uploads within serverless and edge workloads.

How do I generate a presigned URL for Cloudflare R2 object storage?▼

Generate presigned URLs for Cloudflare R2 object storage to grant temporary, time-limited access to private assets without exposing credentials. This mechanism secures media delivery and user file sharing workflows.

Can I list and delete multiple objects in an R2 bucket programmatically?▼

You can list and delete objects in an R2 bucket programmatically using env.MY_BUCKET.list() with prefix filtering and env.MY_BUCKET.delete(). This supports bucket inventory management and lifecycle cleanup tasks.

What is the best way to manage Cloudflare R2 storage for edge workloads?▼

Managing Cloudflare R2 storage for edge workloads involves configuring bucket bindings in wrangler.toml to perform CRUD operations. This approach provides secure, low-latency access to bucketed assets across serverless workflows.

Do I need to configure wrangler.toml before binding to an R2 bucket?▼

You must configure a bucket binding in wrangler.toml, such as binding MY_BUCKET to my-bucket, before accessing it in code via env.MY_BUCKET. You also need to create the bucket using the wrangler CLI.

Why use presigned URLs instead of direct credentials for R2 object access?▼

Use presigned URLs for R2 object access to grant secure, time-limited access to files without permanently exposing your storage credentials. This approach is essential for serving private assets safely in serverless applications.