#dns-records #cloudflare #dns #command-line-tool #web

app cliflare

A command line tool used to interact with Cloudflare APIs

15 unstable releases (3 breaking)

0.4.3 Jan 8, 2024
0.4.2 Jan 8, 2024
0.4.0 Dec 19, 2023
0.3.4 Dec 17, 2023
0.1.5 Dec 14, 2023

#657 in Command line utilities

MIT license

235KB
613 lines

cliffy

build publish Coverage Status crates.io downloads license

  • πŸ›  CLI️ to interact with Cloudflare APIs
  • πŸ₯³ An excuse to write some Rust
  • πŸ‘· Under heavy development

Setup

Install Rust πŸ“

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install

cargo install cliflare

Generate a Cloudflare API token πŸ“

Grab Account And Zone IDs πŸ“

Environment

# add your token value to a startup script
echo CLOUDFLARE_ENDPOINT=https://api.cloudflare.com/client/v4 >> ~/.zshrc
echo CLOUDFLARE_TOKEN=abcd1234**API_TOKEN**4321dcba >> ~/.zshrc
echo CLOUDFLARE_ACCOUNT_ID=abcd1234**ACCOUNT_ID**4321dcba >> ~/.zshrc

Examples

Token Verify πŸ“

cliflare token verify

Zone List πŸ“

# print out all zone info
cliflare zone list
# print only zone "name" field -- i.e. domains
cliflare zone list --domains

Create a Zone πŸ“

cliflare zone create newzone.com

Delete a Zone πŸ“

cliflare zone delete newzone.com

List DNS Records For A Zone πŸ“

cliflare dns list --zone_id <ZONE_ID>
cliflare dns list --zone_name <DOMAIN>

Export DNS Records For A Zone πŸ“

cliflare dns export --zone_id <ZONE_ID>
cliflare dns export --zone_name <DOMAIN>

Import DNS Records For A Zone πŸ“

cliflare dns import --file <PATH> --zone_id <ZONE_ID>
cliflare dns import -file <PATH> --zone_name <DOMAIN>

Delete All DNS Records For A Zone πŸ“

cliflare dns clear --zone_id <ZONE_ID>
cliflare dns clear --zone_name <DOMAIN>

List All Settings For A Zone πŸ“

cliflare settings list --zone_id <ZONE_ID>
cliflare settings list --zone_name <DOMAIN>

Coming Soon

Feature Requests

Fill out this form and I'll get back to you.

Dependencies

~5–21MB
~243K SLoC