name: r2 description: Interact with Cloudflare R2 buckets used by Pagecord. Use when the user wants to list objects, inspect bucket stats, fetch files, or check backup integrity in R2.
R2
Use the Cloudflare API for R2 buckets.
Setup
- Read
CLOUDFLARE_ACCOUNT_IDand the relevant bucket token from/Users/olly/dev/pagecord/.env. - Bucket tokens follow
CLOUDFLARE_R2_{BUCKET}orCLOUDFLARE_R2_{BUCKET}_READ_ONLY. - Map bucket names by uppercasing and replacing hyphens with underscores.
- If more than one bucket token is configured and the user did not specify a bucket, list the candidates and ask.
Base API URL:
https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/r2/buckets/{BUCKET}
Common operations
ls: list objects, optionally under a prefixstat: summarize object count, size, oldest/newest objectscat: fetch a single object, warning first for large objectscheck: surface-level backup integrity check from listingsinspect: deeper backup integrity check including sentinel metadata
Paginate listings until exhausted. Keep output concise and human-readable.