cliflare

Crates.iocliflare
lib.rscliflare
version0.4.3
sourcesrc
created_at2023-12-12 02:24:35.259322
updated_at2024-01-08 06:33:55.105409
descriptionA command line tool used to interact with Cloudflare APIs
homepagehttps://github.com/davepmiller/cliflare
repositoryhttps://github.com/davepmiller/cliflare
max_upload_size
id1065772
size279,479
Dave Miller (davepmiller)

documentation

README

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.

Commit count: 104

cargo fmt