cloudflare-maintenance-page-cli

Simple CLI using Cloudflare API and Workers to deploy a maintenance page to a domain

npm version

screenshot

setup

Install Bun runtime

Install the CLI globally:

bun i -g cloudflare-maintenance-page-cli

Then use the command cfmp anywhere.

Or run without installing globally:

bunx cloudflare-maintenance-page-cli <command>

commands

configuration

At the first run, it will create ~/.config/cloudflare-maintenance-page-cli/config.json, then prompt for your Cloudflare information:

To edit the config, just run cfmp config.

Your API token is NOT stored in plain text in the config file. It is stored securely using the operating system’s keychain. To delete it, you can run cfmp config --delete.

The config has two sections:

You can also use environment variables (example CLOUDFLARE_ACCOUNT_ID=your_id... cfmp deploy). This doesn’t apply to the token.

worker

The CLI will deploy a Cloudflare Worker on your Cloudflare account named maintenance-<domain>-<start_of_zone_id>.

Cloudflare Workers limits apply according to your plan. See Cloudflare Workers limits.

development

To install dependencies:

bun install

To link globally:

bun link

Then use cfmp anywhere.


This project was created using bun init in bun v1.2.19. Bun is a fast all-in-one JavaScript runtime.