Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

r2-cliR2 CLI 测试

Agent Skill

r2-cli 用于辅助 Python 项目开发、测试和数据处理,适合在 OpenClaw 中需要阅读 Python 代码、运行测试或整理脚本流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

15,650

周安装

676

GitHub Stars

公开资料未说明

下载量

5,570
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:r2-cli(R2 CLI 测试)
来源仓库:https://github.com/zororaka00/r2-cli
安装命令:
openclaw skills install r2-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install r2-cli

简介

使用 AWS Signature V4 身份验证在 Cloudflare R2 存储上进行安全上传、下载、列出和删除操作的最小 Python CLI。

SKILL.md

Cloudflare R2 CLI Skill

Skill Metadata

name: "r2-cli"
description: "A minimal CLI tool for interacting with Cloudflare R2 storage using Python. Supports upload, download, list, and delete operations via S3-compatible API with AWS Signature V4."
version: "1.0.6"
author:
  username: "@zororaka00"
  name: "Web3 Hungry"
  x_account: "https://x.com/web3hungry"
category: "storage"
tags: ["cloudflare", "python", "r2", "storage"]
source: "r2.py"
credentials:
  required: true
  type: "environment"
  variables:
    - CF_R2_ACCOUNT_ID
    - CF_R2_ACCESS_KEY_ID
    - CF_R2_SECRET_ACCESS_KEY
    - CF_R2_BUCKET
    - CF_R2_REGION
runtime:
  language: "python"
  version: "3.11+"
  dependencies:
    - "defusedxml>=0.7.1"
  env:
    - name: "CF_R2_ACCOUNT_ID"
      required: true
      description: "Cloudflare account ID"
    - name: "CF_R2_ACCESS_KEY_ID"
      required: true
      description: "R2 access key ID"
    - name: "CF_R2_SECRET_ACCESS_KEY"
      required: true
      description: "R2 secret access key"
    - name: "CF_R2_BUCKET"
      required: true
      description: "R2 bucket name"
    - name: "CF_R2_REGION"
      required: false
      description: "Region (default: auto)"

required_env_vars:
  - CF_R2_ACCOUNT_ID
  - CF_R2_ACCESS_KEY_ID
  - CF_R2_SECRET_ACCESS_KEY
  - CF_R2_BUCKET
  - CF_R2_REGION
primaryEnv: CF_R2_ACCESS_KEY_ID
primarySecretEnv: CF_R2_SECRET_ACCESS_KEY

Overview

This skill provides a minimal CLI tool for interacting with Cloudflare R2 storage using Python. The script (r2.py) implements upload, download, list, and delete operations via the Cloudflare R2 S3-compatible API.

It is designed for secure usage in restricted environments with minimal dependencies while following modern security best practices.

Dependencies

  • Python 3.11+
  • Requires: defusedxml (for secure XML parsing)
The tool primarily uses the Python standard library. Only defusedxml is required to harden XML parsing against known attacks.

Installation

No package installation is required for the CLI itself.

If defusedxml is not already available:

pip install defusedxml

Features

  • Upload objects to a bucket
  • Download objects from a bucket
  • List objects in a bucket
  • Delete objects from a bucket
  • AWS Signature V4 compatible authentication (HMAC SHA256)
  • Secure credential handling via environment variables
  • Hardened HTTP client with HTTPS-only enforcement
  • Safe XML parsing using defused XML protections

Prerequisites

  • Python 3.11+
  • Cloudflare account with R2 enabled
  • Bucket created in Cloudflare R2
  • API keys with appropriate permissions (least privilege)
  • Bucket name must be DNS-compliant (lowercase letters, numbers, hyphens, 3–63 characters, no underscores)

Environment Variables

VariableDescriptionExample
CF_R2_ACCOUNT_IDCloudflare account ID123e4567-e89b-12d3-a456-426614174000
CF_R2_ACCESS_KEY_IDR2 access key IDAKIAxxxxxxxxxxxx
CF_R2_SECRET_ACCESS_KEYR2 secret keyxxxxxxxxxxxxxxxxxxxxxxxx
CF_R2_BUCKETBucket namemy-r2-bucket
CF_R2_REGIONRegion (default: auto)auto

CF_R2_REGION behavior:

  • auto (default): automatically selects the appropriate region for Cloudflare R2.
  • Custom value: you may specify a region string if required by your environment (for example us-east-1 for compatibility scenarios).

Environment Setup

This tool reads credentials directly from operating system environment variables. Set the variables globally before running the CLI.

Linux / macOS (bash / zsh)

export CF_R2_ACCOUNT_ID="your_account_id"
export CF_R2_ACCESS_KEY_ID="your_access_key"
export CF_R2_SECRET_ACCESS_KEY="your_secret_key"
export CF_R2_BUCKET="your_bucket_name"
export CF_R2_REGION="auto"

Security Note: These credentials should only be set temporarily in the current session. For production environments, use secure secret management solutions.

Windows (PowerShell)

$env:CF_R2_ACCOUNT_ID="your_account_id"
$env:CF_R2_ACCESS_KEY_ID="your_access_key"
$env:CF_R2_SECRET_ACCESS_KEY="your_secret_key"
$env:CF_R2_BUCKET="your_bucket_name"
$env:CF_R2_REGION="auto"

Security Note: These credentials should only be set temporarily in the current session. For production environments, use secure secret management solutions.

Recommended Secure Credential Management

For production environments, consider using:

  • Cloudflare Workers Secrets (for Cloudflare environments)
  • AWS Secrets Manager (if using AWS)
  • HashiCorp Vault (enterprise secret management)
  • Docker Secrets (for containerized deployments)
  • Kubernetes Secrets (for Kubernetes environments)
  • OS-level keyring (e.g., keyring Python package)

Verify Environment

echo $CF_R2_ACCOUNT_ID

If a value prints, the environment is configured correctly.

Important: Never commit credentials to version control. Use environment variables provided by your operating system or a secure secret management solution.

Usage

# Upload a file
python r2.py upload --file local_file.txt --key remote_file.txt

# Download a file
python r2.py download --key remote_file.txt --file local_file.txt

# List objects
python r2.py list

# Delete an object
python r2.py delete --key remote_file.txt

Security Best Practices

  • Never commit credentials to version control.
  • Use environment variables managed by your operating system, container runtime, or secret manager.
  • Apply least-privilege access when creating API keys.
  • Rotate keys regularly and revoke compromised keys.
  • All credentials are loaded at runtime from environment variables.
  • HTTPS is strictly enforced and hostnames are validated to prevent unexpected network access.
  • XML responses are parsed using the defusedxml library to prevent XXE and entity expansion attacks.
  • Errors are handled without exposing sensitive information such as credentials or secrets.

Credential Security

Never store credentials inside source code or configuration files committed to version control. Use environment variables provided by your operating system or a secure secret management solution.

Future Improvements

  • Multipart uploads for large objects
  • Retry with exponential backoff
  • Progress indicators
  • Bucket management commands
  • Streaming upload/download to reduce memory usage

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

85.4%
按下载量换算4,757

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills