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
235KB
613 lines
- π 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
- Create DNS Record For A Zone
- Parameterize Pagination Options
Feature Requests
Fill out this form and I'll get back to you.
Dependencies
~5β21MB
~243K SLoC