Skip to content
eliwarePublic

About

Cloudflare administration and automation CLI with GitHub CLI-style commands, profiles, safe writes, and direct API access.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

eliware.org

@eliware/cfhub npm License CI

Cloudflare administration and automation CLI with GitHub CLI-style commands, profiles, safe writes, and direct API access.

Table of Contents

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/cfhub

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

Read docs/README.md for user guides. Read specs/README.md for project rules. Read RELEASE_NOTES.md for version history.

Development

Install dependencies before you run repository checks:

npm ci

Read AGENTS.md and the specifications index before you change files.

Testing

Run aggregate checks from the repository root:

npm test

Run 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 provides these routes when the scope picker is enabled:

  • GET / returns the scope picker.
  • POST /oauth/start accepts the selected scopes and redirects to Cloudflare.
  • GET /api/version?project=cfhub returns the package version.
  • GET /oauth-picker.css, /oauth-picker-app.mjs, and /picker/*.mjs return picker files.
  • GET /oauth-web/* returns the picker logos and images.
  • GET /oauth/callback receives 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:

Discordeliware.org

eliware.org on Discord

Links

License

MIT © Eliware

About

Cloudflare administration and automation CLI with GitHub CLI-style commands, profiles, safe writes, and direct API access.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages