One-click install
npx skills add https://github.com/CaptainCrouton89/new-mystica --skill wrangler-r2-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Wrangler R2 Guide
Source: https://github.com/CaptainCrouton89/new-mystica/tree/main/mystica-express/.claude/skills/wrangler-r2
Command: npx skills add https://github.com/CaptainCrouton89/new-mystica --skill wrangler-r2-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires wrangler.

What problem does it solve?

Managing cloud object storage can be a complex, manual process involving intricate CLI commands, public access configurations, and CORS settings. This Skill automates and simplifies all Cloudflare R2 operations, making file hosting straightforward and freeing you from tedious infrastructure management.

Core Features & Use Cases

  • Effortless File Management: Easily upload, download, and delete files from your R2 buckets with simple commands.
  • Automated Public Access: Quickly enable public URLs (r2.dev subdomains) and configure custom domains for your assets.
  • CORS Configuration: Set up Cross-Origin Resource Sharing rules to ensure seamless browser access to your R2 objects.
  • Use Case: Deploy static website assets, host AI reference images, or manage game resources with a few commands, knowing your files are globally distributed with zero egress fees.

Quick Start

Install Wrangler CLI and authenticate

npm install -g wrangler wrangler login

Create a new R2 bucket

wrangler r2 bucket create my-new-bucket

Upload a file to your bucket

wrangler r2 object put my-new-bucket/my-image.png --file=./local-image.png --remote

Frequently Asked Questions about Wrangler R2 Guide

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

FAQPage Schema
How do I upload files to Cloudflare R2 using Wrangler?

Upload files to Cloudflare R2 using the Wrangler CLI with `wrangler r2 object put bucket-name/file-path --file=./local-file`. First install Wrangler globally, authenticate with `wrangler login`, and create a bucket using `wrangler r2 bucket create bucket-name`.

Can I host static assets publicly on R2 with custom domains?

Yes, you can configure public R2 URLs using `r2.dev` subdomains or set up custom domains through Wrangler. Enable public access in your bucket settings, then use the generated public URL or point a custom domain to your R2 bucket for static asset hosting.

What do I need to set up before using Wrangler with R2?

You need Wrangler CLI installed via npm, a Cloudflare account with R2 access, and API token authentication via `wrangler login`. After authentication, you can create buckets and manage objects with `--remote` flag for cloud operations.

How do I configure CORS on R2 buckets for browser access?

Configure Cross-Origin Resource Sharing through Wrangler to allow browsers to access R2 objects across domains. Set CORS rules on your bucket to specify which origins, methods, and headers are permitted for seamless cross-origin requests.

Does R2 charge for data egress when hosting files?

No, Cloudflare R2 has zero egress fees, making it cost-effective for file hosting, static website assets, and game resource distribution. You pay only for storage and API requests, not bandwidth consumed by downloads.