cloudflare

Automate Cloudflare configuration and troubleshooting via REST API and wrangler CLI.

1|Updated Mar 18, 2024
One-click install
npx skills add https://github.com/erfianugrah/dotfiles --skill cloudflare-erfianugrah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare
Source: https://github.com/erfianugrah/dotfiles/tree/main/.pi/agent/skills/cloudflare
Command: npx skills add https://github.com/erfianugrah/dotfiles --skill cloudflare-erfianugrah

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of manually operating Cloudflare across many products (DNS, rulesets/WAF, Workers/Pages, R2, and Zero Trust) by providing a practical, API-first workflow that keeps authentication, scoping, and automation patterns consistent.

Core Features & Use Cases

  • API token + scoped access guidance: ensures you use modern scoped API tokens (account vs zone) and validates access via token verification.
  • Operational Cloudflare management patterns: covers common REST API workflows for DNS records, cache purge, rulesets/rules, Workers/Pages secrets, and Zero Trust (Access and Tunnels).
  • Bulk automation and IaC migration: provides a bulk Python automation pattern with rate-limit safety and documents importing existing resources into Terraform via cf-terraforming.

Use Case: You need to debug unexpected DNS/WAF/cache behavior, update records safely across multiple zones, and then bring the resulting state under Terraform without drift.

Quick Start

Use the cloudflare skill to generate a rate-limit-safe plan for listing DNS records and purging cache for a specific zone using your scoped Cloudflare API token.

Frequently Asked Questions about cloudflare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Cloudflare DNS record management across multiple zones safely?

You can automate Cloudflare DNS record management by using the REST API with scoped tokens and bulk Python automation patterns. This approach applies rate-limit safety and backoff handling to update records across multiple zones without hitting API limits.

What is the best way to import existing Cloudflare resources into Terraform?

The best way to import existing Cloudflare resources into Terraform is using the cf-terraforming tool. This process migrates your current DNS, rulesets, and Zero Trust configurations into Terraform state to prevent configuration drift.

Can I use scoped API tokens for both Cloudflare account and zone level operations?

Yes, you can use scoped API tokens for Cloudflare operations, but they require correct token scoping for account versus zone resources. This ensures proper authentication and validates access via token verification for specific operational workflows.

How do I update Cloudflare WAF rulesets using the REST API?

You update Cloudflare WAF rulesets by driving the REST API to modify rulesets, rules, and expressions. This workflow supports the full Cloudflare resource taxonomy, allowing you to apply changes to WAF configurations programmatically.

Does the wrangler CLI support managing Workers secrets and R2 operations?

Yes, the wrangler CLI supports managing Workers and Pages secrets alongside R2 operations. This workflow is integrated with REST API automation to handle secret and configuration management consistently across your Cloudflare environment.

Why are my Cloudflare REST API requests failing during bulk cache purges?

Cloudflare REST API requests fail during bulk cache purges if you do not implement robust rate-limit and backoff handling. Applying bulk Python automation patterns with proper rate-limit safety ensures your cache purge workflows execute without API throttling.