跳到正文
TakoAPI
返回技能列表

cloudflare-r2

由 xiaoyaner0201 提供

Coding Agents & IDEs
1.4k下载量由 clawskills.sh 提供
3星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Upload files to Cloudflare R2 storage using wrangler CLI.

描述

该技能的功能

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.

何时使用

  • 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

示例工作流

输入

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

智能体
  1. 1

    Read bucket name, accountId, and apiToken from ~/.config/cloudflare/r2.json

  2. 2

    Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables

  3. 3

    Run: wrangler r2 object put "<bucket>/docs/screenshot.png" --file screenshot.png --remote

  4. 4

    Construct public URL using publicDomain from config

输出

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

前置要求

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

安装

clawhub install xiaoyaner0201/cloudflare-r2

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接