cloudflare-r2

Manage Cloudflare R2 object storage with S3-compatible APIs and presigned URLs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a robust framework for interacting with Cloudflare R2 object storage, enabling efficient and secure file management for applications.

Core Features & Use Cases

  • Object Storage: Upload, download, delete, and list objects in R2 buckets.
  • S3 Compatibility: Leverage S3-compatible APIs and SDKs for seamless integration.
  • Presigned URLs: Generate secure, time-limited URLs for direct client uploads/downloads.
  • Multipart Uploads: Handle large files efficiently with resumable and parallel uploads.
  • Use Case: An application needs to store user-uploaded profile pictures. This Skill can generate a presigned URL for the client to upload directly to R2, then serve the image via a custom domain.

Quick Start

Use the cloudflare-r2 skill to upload the file 'report.pdf' to the 'my-bucket' bucket.

Frequently Asked Questions about cloudflare-r2

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

FAQPage Schema
How do I generate presigned URLs for direct client uploads to Cloudflare R2?

To generate presigned URLs for Cloudflare R2, you use S3-compatible APIs to create secure, time-limited links allowing clients to upload or download files directly. This enables secure file handling for user-generated content like profile pictures.

What is the best way to handle large file uploads to S3-compatible object storage?

The best way to handle large file uploads to S3-compatible object storage is using multipart uploads. This method breaks files into smaller parts, enabling resumable and parallel transfers to Cloudflare R2. It performs data integrity checks to ensure reliable, efficient large file management.

Can I use the S3 SDK with Cloudflare R2 for object storage operations?

Yes, you can use the S3 SDK with Cloudflare R2 because R2 provides S3-compatible APIs. This allows seamless integration of existing S3 SDKs to upload, download, delete, and list objects in R2 buckets without changing your standard object storage code.

How do I configure CORS and API token permissions for Cloudflare R2?

Configuring CORS and API token permissions for Cloudflare R2 involves setting bucket policies to allow cross-origin requests and scoping API tokens with correct read and write access. Addressing these common issues ensures secure client-side uploads and proper rate limiting.

Why does my presigned URL upload to R2 fail with CORS errors?

Presigned URL uploads to R2 fail with CORS errors when bucket configurations do not permit cross-origin requests from your application domain. You must properly configure CORS settings and verify API token permissions to facilitate secure file handling directly from the client.