Observed since 20 Oct, 22:37 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A simple CLI tool to manage Cloudflare R2 buckets
A simple CLI tool to manage Cloudflare R2 buckets
This CLI tool helps manage files from a Cloudflare R2 bucket. It can download, upload, list, and delete files from the specified bucket. It also automatically copies the link to download the file to the clipboard upon successful upload.
Install via npm
npm install -g @0x5b62656e5d/r2-files
This tool requires a Cloudflare account, as well as an active Cloudflare R2 plan. API tokens can be created by heading to Cloudflare's R2 Object Storage Overview page, then heading to the Manage API Tokens page.

Create a token that has Object Read and Write permissions, and note down the Access Key ID, Secret Access Key, and the Endpoint URL for S3 clients. Make sure you already have a bucket created to store files.
Create a .env file under the following directory: ~/.config/r2-files/.
Configuration template:
R2_ACCESS_KEY_ID=<Your-R2-Access-Key>
R2_SECRET_ACCESS_KEY=<Your-R2-Secret-Access-Key>
R2_ENDPOINT=<Your-R2-Endpoint>
R2_BUCKET=<Your-R2-Bucket-Name>
DOWNLOAD_URL=<Your-R2-Bucket-URL>
You can link a custom domain to the bucket for the DOWNLOAD_URL. If you don't own a domain, use the Public Development
URL for DOWNLOAD_URL. Make sure that the URL does not end with a /.
NAME
r2-files - Manage files for a R2 bucket
COMMANDS:
download <file-key> <download-path> [<download-name>]
Download a file given the file-key and download-path. Specify download-name to customize the downloaded file's name.
upload <file-path> [<desired-file-name>]
Upload a file given the file-path. Specify desired-file-name to customize the uploaded filename in the bucket. Will default to UUID if not desired-file-name is not specified or already exists in the bucket.
delete <object-key>
Delete a file given the file-key.
delete-all -y
Delete all files in the bucket
list
List all the files in the bucket
Downloads somefile.txt into ~/Downlaods/text.txt
r2-files download somefile.txt ~/Downloads/text.txt
Uploads ~/Downloads/folder/text.txt as text.txt
r2-files upload ~/Downloads/folder/text.txt text.txt
Deletes text.txt from the bucket
r2-files delete text.txt
Deletes all files from the bucket
r2-files delete-all -y
Lists all the files from the bucket
r2-files list
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:37 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:d10b9c583c25934f58522313ad9b27ab4e20c3b6f9d03deba7f2e3ce42c75a10