Cloudflare administration and automation CLI with GitHub CLI-style commands, profiles, safe writes, and direct API access.
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- Configuration
- Operations
- Commands
- Exit codes
- Routes
- Assets
- Development server
- Build
- Deployment
- Support
- Links
- License
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.
- 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.
Install the public package:
npm install --global @eliware/cfhubRun cfhub auth login to save an API token. Run cfhub oauth login to use OAuth.
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 rules. Read RELEASE_NOTES.md for version history.
Install dependencies before you run repository checks:
npm ciRead AGENTS.md and the specifications index before you change files.
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.
Read Setup and first use when login fails. Check that the token has the required Cloudflare permissions when a request fails.
Keep API tokens, OAuth credentials, and local configuration files private. cfhub uses the operating system keychain when available.
Read Profiles and settings for environment values, profiles, and storage paths.
Run cfhub auth status to view login status. Read Profiles and settings to control daily update checks.
Run cfhub --help to list commands. Run cfhub <resource> --help for actions. Read the command reference for command groups and global options.
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.
The local OAuth server provides 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-picker-app.mjs, and/picker/*.mjsreturn picker files.GET /oauth-web/*returns the picker logos and images.GET /oauth/callbackreceives the OAuth callback.
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.
Run npm run start:web to start the OAuth picker preview on 127.0.0.1:1120. Read Web preview for browser workflows.
Run npm run build after OAuth page or style changes. Webpack writes bundles to dist/.
cfhub runs as a local CLI. The OAuth server runs on your computer during login.
For help, questions, or to chat with the author and community, visit:


