Automation & CI

The R2Drop CLI is designed to be scriptable. All commands support --json output for reliable parsing in scripts and CI pipelines.


JSON Output

Use --json for machine-readable output:

r2drop status --json
r2drop accounts --json
r2drop queue --json
r2drop history --limit 50 --json
r2drop upload ./release.tar.gz --json

Shell Script Example

Upload a build artifact and capture the URL:

#!/bin/bash
set -e

# Build your project
npm run build

# Upload the dist folder
OUTPUT=$(r2drop upload ./dist --json)

# Extract the public URL (requires jq)
URL=$(echo "$OUTPUT" | jq -r '.url')

echo "Deployed to: $URL"

GitHub Actions Example

Add CLOUDFLARE_API_TOKEN as a GitHub Actions secret, then:


Makefile Example


Environment Variables

Override the config directory for isolated CI environments:

This keeps CI uploads isolated from your personal ~/.r2drop/ state.


Checking Status Before Uploading


Troubleshooting

r2drop: command not found

The binary is not in your PATH. Run:

No account specified or Account not found

has no bucket configured

Configure the bucket in the macOS app's Accounts tab, or edit ~/.r2drop/config.toml directly.

No token for ... / Keychain errors

On macOS, verify Keychain access for service com.superhumancorp.r2drop in Keychain Access.app.

Last updated