A stripped down version of CloudFlare Wrangler's pages CLI.
An installation of wrangler (CloudFlare's official CLI) is nearly ~150MB with all dependencies.
In comparison, cf-pages-cli
is less than 40KB.
smaller download sizes == shorter download times == faster CI.
Create an API Token in your CloudFlare dashboard, and set the CLOUDFLARE_API_TOKEN
environment variable.
Then run the CLI. projectName
is required.
npx cf-pages-cli --projectName=$PROJECT_NAME ./path/to/site
If you already know your accountId, you can provide it to save an extra lookup.
npx cf-pages-cli --projectName=$PROJECT_NAME --accountId=$ACCOUNT_ID ./path/to/site
By default, the CLI has a timeout of 5 minutes before bailing out. This can be customized by passing the desired timeout in ms
.
npx cf-pages-cli --projectName=$PROJECT_NAME --timeout=20000 ./path/to/site
Note: These examples were based on a Drone CI deployment using a Alpine-based Node container and an Alpine-based Bun container, respectively (wrangler is incompatible with Bun).
Here is a deployment of a simple two-file static site using the official CloudFlare CLI, wrangler:
Here is a deployment of that same site using cf-pages-cli
: