r2
is a library and command line interface for working with Cloudflare's
R2 Storage.
Cloudflare's R2 implements the S3 API, attempting to allow users and their applications to migrate easily, but importantly lacks the key, simple-to-use features provided by the AWS CLI's s3 subcommand, as opposed to the more complex and verbose API calls of the s3api subcommand. This CLI fills that gap.
To install the r2
CLI, simply run the following command:
go install github.com/erdos-one/r2@latest
For more installation options, see INSTALL.md.
To view the CLI's help message, run:
r2 help
r2 configure
— Configure R2 accessr2 cp
— Copy an object from one R2 path to anotherr2 help
— Help about any commandr2 ls
— List either all buckets or all objects in a bucketr2 mb
— Create an R2 bucketr2 mv
— Moves a local file or R2 object to another location locally or in R2.r2 presign
— Generate a pre-signed URL for a Cloudflare R2 objectr2 rb
— Remove an R2 bucketr2 rm
— Remove an object from an R2 bucketr2 sync
— Syncs directories and R2 prefixes.
To view the help message for a specific command, run:
r2 help <command>
For more usage information — including library usage — see USAGE.md.
We're working to implement all the functionality of the AWS CLI's s3 subcommand. As of v0.1.0-alpha, we have all the commands implemented, but not all the options. We're working on it, but if you'd like to lend a helping hand, we'd much appreciate your help!
To view the latest changes, see CHANGELOG.md.
Our expected workflow is: Fork → Patch → Push → Pull Request.
Another helpful way to contribute is to report bugs or request features by opening an issue. We appreciate contributions of all kinds!
To understand the codebase, we recommend reading the ARCHITECTURE.md file.