Skip to main content

A simple Cloudflare DNS CLI tool

Project description

cfcommander

cfcommander is a simple CLI tool for managing DNS records in Cloudflare. After installing via pip, you can use it with the cf command.

Installation

pip install cfcommander

Configuration

Before using the tool, configure your Cloudflare API credentials:

cf config your_email@example.com your_api_key

This saves your credentials to ~/.cfcli_config.json.

Usage

Add a DNS record

cf add example.com A home 192.0.2.1 yes 120
  • example.com – The zone name (your domain).
  • A – Record type (A, CNAME, etc.).
  • home – Subdomain (creates home.example.com).
  • 192.0.2.1 – The record value (e.g., an IP address).
  • yes – Whether the record is proxied through Cloudflare (yes/no).
  • 120 – TTL (Time-To-Live in seconds).

Edit a DNS record

cf edit example.com A home 198.51.100.42 no 300

Delete a DNS record

cf del example.com A home

List all DNS records for a domain

cf list example.com

List all manageable domains

cf domains

Examples

# Configure API credentials
cf config user@example.com my_api_key

# Add an A record for home.example.com
cf add example.com A home 203.0.113.10 no 3600

# Modify an existing record
cf edit example.com A home 198.51.100.42 yes 1800

# Delete a record
cf del example.com A home

# List all DNS records for a domain
cf list example.com

# List all domains under your Cloudflare account
cf domains

Dependencies

  • Python 3.6+
  • Required libraries: requests, argparse, tabulate, json, sys, os, textwrap

License

MIT License © Jakub Jim Zacek

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfcommander-0.1.13.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

cfcommander-0.1.13-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file cfcommander-0.1.13.tar.gz.

File metadata

  • Download URL: cfcommander-0.1.13.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.12

File hashes

Hashes for cfcommander-0.1.13.tar.gz
Algorithm Hash digest
SHA256 a485612a4c99faf8d8eb85c6d0a809fec2f1ef08140b04b3f046db79bc52709c
MD5 32d608b67e18e5c825a2ed24f8e15a04
BLAKE2b-256 4f9daaf0a1b3c52a595b23f2e8385bab377a20f43bf5f089d7fc64eb925bf8b7

See more details on using hashes here.

File details

Details for the file cfcommander-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for cfcommander-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 ad20f7e0555c99966a4bf9b4693c44501ca2f5b9ecc3be4fdbc255ccc0257444
MD5 d43642f6ae440802976648bc4c68e593
BLAKE2b-256 5429497178f343138d7dbd13cdbfc3f6e7e18e62183ba6583d117fb23ad21ede

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page