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 (createshome.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.14.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file cfcommander-0.1.14.tar.gz
.
File metadata
- Download URL: cfcommander-0.1.14.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
f4350f7546fb09b1c139ad316f38169d292231b62b9af325cdb2d5f41559a7f5
|
|
MD5 |
833f9d376e6469d9aaf4cebb0076a404
|
|
BLAKE2b-256 |
183f3e011cf69a5ecfb22559dcedc072e94c9213b40edbecb5c2f5c42091ddc0
|
File details
Details for the file cfcommander-0.1.14-py3-none-any.whl
.
File metadata
- Download URL: cfcommander-0.1.14-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4bf28eb20e818f6045d6d9da3a9e6c33fd3d2874f07398e292b98340f439260a
|
|
MD5 |
a8cbf6be8ea67b23a30d3e4cc686bfd1
|
|
BLAKE2b-256 |
d0012a3c4590d9d1a799d39657afade35b5526b7ac51df8e8b5894f971ab1861
|