https://github.com/axeelz/cloudflare-maintenance-page-cli
Easy to use CLI using Cloudflare API and Workers to deploy a customizable maintenance page to a domain — made with Effect/cli
https://github.com/axeelz/cloudflare-maintenance-page-cli
cloudflare cloudflare-api effect-ts maintenance maintenance-page workers
Last synced: 5 months ago
JSON representation
Easy to use CLI using Cloudflare API and Workers to deploy a customizable maintenance page to a domain — made with Effect/cli
- Host: GitHub
- URL: https://github.com/axeelz/cloudflare-maintenance-page-cli
- Owner: axeelz
- Created: 2025-07-27T22:43:23.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-08-30T17:31:34.000Z (6 months ago)
- Last Synced: 2025-08-30T18:25:58.875Z (6 months ago)
- Topics: cloudflare, cloudflare-api, effect-ts, maintenance, maintenance-page, workers
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/cloudflare-maintenance-page-cli
- Size: 119 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cloudflare-maintenance-page-cli
Simple CLI using Cloudflare API and Workers to deploy a maintenance page to a domain
[](https://www.npmjs.com/package/cloudflare-maintenance-page-cli)

## setup
Install [Bun](https://bun.sh/) runtime
Install the CLI globally:
```bash
bun i -g cloudflare-maintenance-page-cli
```
Then use the command `cfmp` anywhere.
Or run without installing globally:
```bash
bunx cloudflare-maintenance-page-cli
```
## commands
- `cfmp deploy` - deploys the maintenance page worker to Cloudflare at /maintenance on your domain
- `cfmp enable` - enables maintenance mode (routes all traffic to the worker)
- `cfmp disable` - disables maintenance mode (back to normal)
## configuration
At the first run, it will create `~/.config/cloudflare-maintenance-page-cli/config.json`, then prompt for your Cloudflare information:
- **Account** and **Zone**: [what is this?](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/)
- **API token**: [how to create one?](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) (needs Edit Workers permissions)
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:
- `CLOUDFLARE` - your Cloudflare information
- `PAGE` - customize the maintenance page
> 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--`.
Cloudflare Workers limits apply according to your plan. See [Cloudflare Workers limits](https://developers.cloudflare.com/workers/platform/limits/#worker-limits).
## development
To install dependencies:
```bash
bun install
```
To link globally:
```bash
bun link
```
Then use `cfmp` anywhere.
---
This project was created using `bun init` in bun v1.2.19. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.