- π 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_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>
Coming Soon
- Create DNS Record For A Zone
- Parameterize Pagination Options
Feature Requests
Fill out this form and I'll get back to you.