0.3.2 • Published 25 days ago

cf-pages-cli v0.3.2

Weekly downloads
-
License
-
Repository
-
Last release
25 days ago

cf-pages-cli

A stripped down version of CloudFlare Wrangler's pages CLI.

Why?

An installation of wrangler (CloudFlare's official CLI) is nearly ~150MB with all dependencies.

wrangler install size with dust

In comparison, cf-pages-cli is less than 40KB.

smaller download sizes == shorter download times == faster CI.

Usage

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

Speed Comparison

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:

before with wrangler cli

Here is a deployment of that same site using cf-pages-cli:

after with cf-pages-cli

0.3.0

25 days ago

0.3.2

25 days ago

0.3.1

25 days ago

0.2.0

27 days ago

0.1.4

27 days ago

0.1.3

27 days ago

0.1.2

27 days ago

0.1.1

27 days ago

0.1.0

27 days ago