To install dependencies:
bun install
To link globally:
bun link
Then use cfmp
anywhere.
cfmp deploy
- deploys the maintenance page worker to Cloudflare at /maintenance on your domaincfmp enable
- enables maintenance mode (routes all traffic to the worker)cfmp disable
- disables maintenance mode (back to normal)At the first run, it will create ~/.config/cloudflare-maintenance-page-cli/config.json
, then prompt for your Cloudflare credentials:
To edit the config, just run cfmp config
.
You can also use environment variables (example
CLOUDFLARE_API_TOKEN=your_token... cfmp deploy
).
The config has two sections:
CLOUDFLARE
- your Cloudflare credentials and worker namePAGE
- customize the maintenance pageThis project was created using bun init
in bun v1.2.19. Bun is a fast all-in-one JavaScript runtime.