cf-pages-cli

0.3.2 • Public • Published

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

Package Sidebar

Install

npm i cf-pages-cli

Weekly Downloads

11

Version

0.3.2

License

none

Unpacked Size

39.4 kB

Total Files

7

Last publish

Collaborators

  • kevinfiol