Cloudflare R2 CLI for Openclaw

A minimal Python-based CLI tool for interacting with Cloudflare R2 storage using secure S3-compatible APIs and AWS Signature V4.

zororaka00
v1.0.6
Feb 21, 2026
0
1.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install r2-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install r2-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Cloudflare R2 CLI?

The Cloudflare R2 CLI is a specialized tool designed to provide a lightweight yet secure interface for managing Cloudflare R2 storage. Built with Python 3.11+, it implements essential object storage operations including uploading, downloading, listing, and deleting files through Cloudflare's S3-compatible API. This skill is a vital addition to the Openclaw Skills ecosystem, enabling developers and AI agents to programmatically handle cloud assets with minimal dependencies and a focus on modern security protocols.

By leveraging AWS Signature V4 for authentication and enforcing strict HTTPS communication, the tool ensures that data transfers remain confidential and verified. It is specifically optimized for environments where security and efficiency are paramount, making it an excellent choice for automated workflows and AI-driven infrastructure management.

Cloudflare R2 CLI Use Cases

  • Automating the deployment of static assets to Cloudflare R2 buckets within CI/CD pipelines.
  • Enabling AI coding agents to fetch or store logs and artifacts during development tasks.
  • Managing cloud-based backups for local development environments using simple CLI commands.
  • Integrating secure object storage capabilities into broader Openclaw Skills automation routines.

How Cloudflare R2 CLI Works

  1. The tool authenticates by retrieving Cloudflare R2 credentials from the system environment variables.
  2. When an operation is triggered, the skill generates a secure HMAC-SHA256 signature following the AWS Signature V4 specification.
  3. It initiates a hardened HTTPS request to the Cloudflare R2 endpoint associated with the user's Account ID and Bucket name.
  4. For responses involving data retrieval or listing, the tool utilizes the defusedxml library to safely parse XML data and prevent security vulnerabilities.
  5. The skill completes the lifecycle by outputting the result of the storage operation or providing detailed error handling without exposing sensitive metadata.

Cloudflare R2 CLI Setup

To use this tool within the Openclaw Skills framework, ensure Python 3.11+ is installed. Begin by installing the required security dependency:

pip install defusedxml

Next, configure your Cloudflare R2 credentials as environment variables:

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"

Cloudflare R2 CLI Data Schema & Taxonomy

The skill organizes its operations and metadata around the following schema to ensure compatibility with Cloudflare R2:

Variable Role Requirement
CF_R2_ACCOUNT_ID Identifies the specific Cloudflare account Required
CF_R2_ACCESS_KEY_ID S3-compatible API Access Key Required
CF_R2_BUCKET The target DNS-compliant bucket name Required
CF_R2_REGION Geographic region (defaults to auto) Optional
Object Key The unique path/identifier for files in the bucket Contextual

Cloudflare R2 CLI Advanced Features

  • Full support for AWS Signature V4 compatible authentication (HMAC SHA256).
  • Enhanced security through HTTPS-only enforcement and hostname validation.
  • Protection against XML-based attacks (XXE) using the defusedxml hardening library.
  • Minimal footprint designed for easy integration into Openclaw Skills for AI-driven automation.
  • Flexible region handling with an 'auto' setting to optimize Cloudflare global routing.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*