Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 1.32 KB

getting-started.md

File metadata and controls

58 lines (36 loc) · 1.32 KB

Setup and first use

cfhub is a command line tool for Cloudflare. It runs on Node.js 26 or later.

Install

Install the package from npm:

npm install --global @eliware/cfhub

Check the install:

cfhub --version
cfhub --help

Add access

Use an API token for direct setup:

cfhub auth login

Follow 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.

Run commands

List zones:

cfhub zones list

List 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-run

Use cfhub auth status to check the active identity. Use cfhub auth verify to test the active API token.

Help

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.