r2-setup
Quickly create R2 bucket and configure binding in wrangler.jsonc
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 c127fff14cafbf72… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
r2-setup.md
R2 Quick Setup
Create an R2 bucket and configure Worker binding for instant file storage.
Required Information
- Bucket name (3-63 chars, lowercase, numbers, hyphens only):
{{bucket_name}} - Binding name (uppercase, used in code like
env.MY_BUCKET):{{binding_name}} - Preview bucket (optional, for dev environment):
{{preview_bucket_name}}
What This Command Does
- Creates R2 bucket via
wrangler r2 bucket create - Adds binding to wrangler.jsonc in r2_buckets array
- Generates TypeScript types in env.d.ts
- Shows example usage code for uploads/downloads
Example Execution
# Create bucket
bunx wrangler r2 bucket create my-uploads
# Configure wrangler.jsonc
{
"r2_buckets": [
{
"binding": "MY_UPLOADS",
"bucket_name": "my-uploads",
"preview_bucket_name": "my-uploads-preview"
}
]
}
# Add TypeScript types
type Bindings = {
MY_UPLOADS: R2Bucket;
};
# Example upload/download code
app.put('/upload/:filename', async (c) => {
const data = await c.req.arrayBuffer();
await c.env.MY_UPLOADS.put(c.req.param('filename'), data, {
httpMetadata: {
contentType: c.req.header('content-type') || 'application/octet-stream',
},
});
return c.json({ success: true });
});
app.get('/download/:filename', async (c) => {
const object = await c.env.MY_UPLOADS.get(c.req.param('filename'));
if (!object) return c.json({ error: 'Not found' }, 404);
return new Response(object.body);
});
Next Steps
- Test with
bunx wrangler dev - Upload a test file
- Verify download works
- Deploy with
bunx wrangler deploy
Files
1- r2-setup.md
8dadeccea01.7 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from secondsky/claude-skills8
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
Run a focused blindspot pass for unfamiliar, ambiguous, or high-risk work
Debug Bun applications and diagnose common issues
Deploy Bun applications to various platforms
Initialize a new Bun project with optional framework selection
Migrate existing Node.js/npm projects to Bun
Optimize Bun application performance and bundle size
Related devops skillsscan passed
Synchronize environment variables between local development and Vercel deployments
Generate a Node.js build script that converts the VitePress wiki to Azure DevOps Wiki-compatible markdown in dist/ado-wiki/. Transforms Mermaid syntax, strips front matter, fixes links.
Deploy Sanity schema to the Content Lake with verification.
Analyze and resolve errors across the full application lifecycle — from stack traces to distributed tracing — using systematic root-cause analysis and observability tools.