REPOMATIC-CLOUDFLARE-R2(1) REPOMATIC-CLOUDFLARE-R2(1)

repomatic cloudflare-r2 - Serve site files over the Pages size limit from Cloudflare R2

repomatic cloudflare-r2 [OPTIONS]

Serve a static site's files over the Pages size limit from Cloudflare R2.

Cloudflare Pages Direct Upload rejects any file over 25 MiB. --offload moves each such file from the built site to the bucket that [tool.repomatic] site.cloudflare-r2-bucket declares, and redirects its path to the copy. Without a bucket, or when a file cannot move, the file is dropped with an error annotation and the command exits 1. The rest of the tree stays ready to deploy, so everything else can still publish.

Uploads use a key pair limited to the bucket, from CLOUDFLARE_R2_ACCESS_KEY_ID and CLOUDFLARE_R2_SECRET_ACCESS_KEY. --create and --check manage the bucket through the REST API, with CLOUDFLARE_API_TOKEN or a local `wrangler login`. The account resolves from the credential, never from a declared identifier.

Cloudflare Pages project of the site, which resolves the account. Defaults to [tool.repomatic] site.cloudflare-project, then to the repository name.
Move every file over 25 MiB out of the built site in DIRECTORY, to the bucket, and redirect its path there in DIRECTORY/_redirects. Without a bucket, drop the file with an error. Exits 1 when it drops a file, with the rest of DIRECTORY still ready to deploy.
Create the bucket when missing, attach the domain with TLS 1.2 at least, and turn the r2.dev URL off. Re-running is safe.
Compare the live bucket against the declared state; exit 1 on drift.
Show this message and exit.

Cloudflare Pages project of the site, which resolves the account. Defaults to [tool.repomatic] site.cloudflare-project, then to the repository name.
Move every file over 25 MiB out of the built site in DIRECTORY, to the bucket, and redirect its path there in DIRECTORY/_redirects. Without a bucket, drop the file with an error. Exits 1 when it drops a file, with the rest of DIRECTORY still ready to deploy.
Create the bucket when missing, attach the domain with TLS 1.2 at least, and turn the r2.dev URL off. Re-running is safe.
Compare the live bucket against the declared state; exit 1 on drift.
Show this message and exit.

0
Success.
1
A runtime error, an aborted prompt (Ctrl-D), or a declined confirmation.
2
A usage error: unknown option, invalid value, missing operand, or an unparsable configuration file.
130
Interrupted with Ctrl-C: the process ends by SIGINT, reported as 130.

In CI, between the build and `wrangler pages deploy`

repomatic cloudflare\-r2 \-\-offload ./docs/_build

Create the bucket and attach its domain, or converge an existing one

repomatic cloudflare\-r2 \-\-create

Compare the live bucket against the declared state

repomatic cloudflare\-r2 \-\-check

Kevin Deldycke

2026-10-13 7.18.1.dev0