cfhub is a command line tool for Cloudflare. It runs on Node.js 26 or later.
Install the package from npm:
npm install --global @eliware/cfhubCheck the install:
cfhub --version
cfhub --helpUse an API token for direct setup:
cfhub auth loginFollow the prompts. Give the token only the Cloudflare permissions that your commands require. Use cfhub oauth login for OAuth access.
Use cfhub auth login --profile work to save access under a different profile. Use cfhub auth login --token-stdin to read a token from standard input in automation.
List zones:
cfhub zones listList DNS records for a zone:
cfhub dns-records list --zone-id <zone_id>Preview a write before you apply it:
cfhub dns-records create --zone-id <zone_id> --data '{"type":"A","name":"www","content":"192.0.2.1"}' --dry-runUse cfhub auth status to check the active identity. Use cfhub auth verify to test the active API token.
Run cfhub --help to list command groups. Run cfhub <resource> --help for actions. Run cfhub <resource> <action> --help for action options.
See Profiles and settings for access values. See Output and safe writes before you change Cloudflare data.