@eliware/cfhub
v15.1.0
Published
Cloudflare administration and automation CLI with GitHub CLI-style commands, profiles, safe writes, and direct API access.
Maintainers
Readme
@eliware/cfhub

Cloudflare administration and automation CLI with GitHub CLI-style commands, profiles, safe writes, and direct API access.
Table of Contents
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- Configuration
- Operations
- Commands
- Exit codes
- Routes
- Assets
- Development server
- Build
- Deployment
- Support
- Links
- License
Features
Use cfhub to manage Cloudflare resources, inspect account state, and call API endpoints.
Use API-token or OAuth profiles. Preview supported writes with --dry-run and confirm destructive actions with --force.
Requirements
- Install Node.js 26 or later.
- Use a Cloudflare account and a scoped API token or OAuth access.
- Set account or zone IDs when a command needs them.
Setup
Install the public package:
npm install --global @eliware/cfhubRun cfhub auth login to save an API token. Run cfhub oauth login to use OAuth.
Usage
List zones and DNS records:
cfhub zones list
cfhub zones get --zone-id <zone_id>
cfhub dns-records list --zone-id <zone_id>Preview a DNS write:
cfhub dns-records create --zone-id <zone_id> --data '{"type":"A","name":"www","content":"192.0.2.1"}' --dry-runRead docs/README.md for user guides. Read specs/README.md for project specifications. Read RELEASE_NOTES.md for version history.
Development
Install dependencies before you run repository checks:
npm ciTesting
Run aggregate checks from the repository root:
npm testRun npm run test:e2e:web for OAuth browser checks. Read Web preview for browser setup, ports, and output files.
Troubleshooting
Read Setup and first use when login fails. Check that the token has the required Cloudflare permissions when a request fails.
Security
Keep API tokens, OAuth credentials, and local configuration files private. cfhub uses the operating system keychain when available.
Configuration
Read Profiles and settings for environment values, profiles, and storage paths.
Operations
Run cfhub auth status to view login status. Read Profiles and settings to control daily update checks.
Commands
Run cfhub --help to list commands. Run cfhub <resource> --help for actions. Read the command reference for command groups and global options.
Exit codes
cfhub returns 0 after success. It returns 1 after a command or API error. After SIGINT, cfhub exits with code 130. After SIGTERM, it exits with code 143.
Routes
The local OAuth server owns these routes when the scope picker is enabled:
GET /returns the scope picker.POST /oauth/startaccepts the selected scopes and redirects to Cloudflare.GET /api/version?project=cfhubreturns the package version.GET /oauth-picker.css,/oauth-result.css,/oauth-picker.mjs, and/oauth-picker-app.mjsreturn picker files.GET /picker/*.mjs,/escape-picker-markup.mjs, and/collect-picker-scope-boxes.mjsreturn picker modules.GET /oauth-web/cf-logo.svg,/oauth-web/cloudflare-115x53.png, and/oauth-web/eliware-58x58.pngreturn picker images.GET /oauth/callbackreceives the OAuth callback.
Assets
The picker uses bundled files from src/oauth-web/ and these images from public/oauth-web/:
cf-logo.svg, cloudflare-115x53.png, and eliware-58x58.png.
Development server
Run npm run start:web to start the OAuth picker preview on 127.0.0.1:1120. Read Web preview for browser workflows.
Build
Run npm run build after OAuth page or style changes. Webpack writes bundles to dist/.
Deployment
cfhub runs as a local CLI. The OAuth server runs on your computer during login.
Support
For help, questions, or to chat with the author and community, visit:



