Skip to content

Repository files navigation

eliware.org

@eliware/cf-admin npm version license build status

A dependency-injected Cloudflare administration CLI for scripting and inspecting zones, DNS, rulesets, settings, lists, and list items.

Features

  • Zone list, inspect, create, update, and delete
  • DNS record list, inspect, create, update, and delete
  • Zone setting read/update support
  • Ruleset list, inspect, create, and update
  • Cloudflare list and list-item management
  • JSON or human-readable output
  • Dry-run support for writes
  • Force confirmation for destructive operations
  • Testable dependency-injected architecture

Requirements

  • Node.js 18+ recommended
  • Cloudflare API credentials
  • Cloudflare account ID for account-scoped resources
  • Cloudflare zone ID for zone-scoped resources

Installation

cd /opt
git clone git@github.com:eliware/cf-admin.git
cd cf-admin
npm install
npm test
npm run lint
npm install -g .

The global install provides:

cf-admin --help

Configuration

Set credentials in the environment or a local .env file:

CLOUDFLARE_EMAIL=you@example.com
CLOUDFLARE_API_KEY=your_api_key
CLOUDFLARE_ACCOUNT_ID=your_account_id

Never commit .env, credentials, tokens, or generated state.

Usage

cf-admin zones list
cf-admin zones get --zone-id <zone_id>
cf-admin dns-records list --zone-id <zone_id>
cf-admin dns-records create --zone-id <zone_id> \
  --data '{"type":"A","name":"www","content":"1.2.3.4"}'
cf-admin rulesets list --zone-id <zone_id> --json
cf-admin zone-settings get --zone-id <zone_id> --setting development_mode

Use JSON output for automation:

cf-admin zones list --json
cf-admin dns-records get --zone-id <zone_id> --id <record_id> --output json

Preview supported writes:

cf-admin dns-records create --zone-id <zone_id> \
  --data '{"type":"A","name":"test","content":"192.0.2.1"}' \
  --dry-run

Destructive operations require --force:

cf-admin dns-records delete --zone-id <zone_id> --id <record_id> --force

Resources

  • zones
  • zone-settings
  • dns-records
  • rulesets
  • lists
  • list-items

Run <resource> --help for action-specific help.

Development

npm test
npm run lint

The test suite uses injected Cloudflare clients, filesystem adapters, environment loaders, printers, handlers, and process exits. Current source coverage is 100%.

Project Structure

  • bin/ - CLI entry point and compatibility link
  • src/cli.mjs - dependency-injected command runtime
  • src/handlers/ - resource handlers
  • src/ - argument, environment, API, help, and output utilities
  • tests/ - Jest test suite
  • dream.md - long-term product vision
  • dream_sprints.md - staged roadmap

Support

For help or questions, join the community:

Discord
eliware.org on Discord

License

ISC © 2026 Eli Sterling, eliware.org

Links

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages