← 返回
开发者工具 Key 中文

R2 Storage

Manage Cloudflare R2 object storage (upload, download, list, delete, presigned URLs) using boto3 S3-compatible API. Supports CLI usage and importable Python...
使用 boto3 S3 兼容 API 管理 Cloudflare R2 对象存储(上传、下载、列表、删除、预签名 URL)。支持命令行及 Python 导入。
mrnsmh
开发者工具 clawhub v0.1.0 1 版本 99887.4 Key: 需要
★ 0
Stars
📥 887
下载
💾 7
安装
1
版本
#latest

概述

r2-storage Skill

Manage Cloudflare R2 buckets and objects via the S3-compatible API. Uses boto3 under the hood.

When to Use This Skill

Use this skill whenever Marouane needs to:

  • Upload files to R2 (backups, assets, media)
  • Download files from R2
  • List bucket contents
  • Delete objects
  • Generate temporary pre-signed URLs for sharing

Credentials

Set via environment variables (defaults are pre-configured for Marouane's account):

VariableDescription
------
R2_ACCESS_KEY_IDR2 Access Key ID
R2_SECRET_ACCESS_KEYR2 Secret Access Key
R2_ENDPOINTR2 endpoint URL
R2_ACCOUNT_IDCloudflare Account ID

CLI Usage

# Upload
python3 scripts/r2.py upload myfile.txt my-bucket
python3 scripts/r2.py upload myfile.txt my-bucket --key folder/myfile.txt

# Download
python3 scripts/r2.py download my-bucket/folder/myfile.txt ./local-copy.txt

# List
python3 scripts/r2.py list my-bucket
python3 scripts/r2.py list my-bucket --prefix folder/

# Delete
python3 scripts/r2.py delete my-bucket/folder/myfile.txt

# Pre-signed URL (default 1h)
python3 scripts/r2.py presign my-bucket/folder/myfile.txt
python3 scripts/r2.py presign my-bucket/folder/myfile.txt --expires 86400

Python Import Usage

from scripts.r2 import upload, download, list_objects, delete, presign

# Upload
upload("local.txt", "my-bucket", key="optional/key.txt")

# List
objects = list_objects("my-bucket", prefix="folder/")
for obj in objects:
    print(obj["key"], obj["size"])

# Pre-signed URL
url = presign("my-bucket", "folder/file.txt", expires=3600)

Requirements

  • Python 3.8+
  • boto3 (python3-boto3 on Ubuntu — already installed on vps118558)

Notes

  • Cloudflare R2 is S3-compatible; standard boto3 patterns apply.
  • Pre-signed URLs work for GET requests only (public download links).
  • The region_name="auto" is required for R2 compatibility.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 17:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,973
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,767
productivity

Nexus Sentinel

mrnsmh
自主监控服务器健康状况,优化资源,执行上下文感知恢复,生成状态报告,并在关键文件变更时触发备份。
★ 0 📥 973