cf-cli

Manage Cloudflare zones, DNS records, and Workers using the cf CLI.

244|101|Updated Jul 5, 2026
Ready to run
npx skills add https://github.com/yan-labs/yan-skills --skill cf-cli-yan-labs
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: cf-cli
Source: https://github.com/yan-labs/yan-skills/tree/main/cf-cli
Command: npx skills add https://github.com/yan-labs/yan-skills --skill cf-cli-yan-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? The cf CLI eliminates manual navigation through Cloudflare's dashboard by enabling command-line zone management, DNS configuration, and Worker deployment. It reduces setup time for new sites and enables reproducible infrastructure workflows without dashboard context-switching. ## Core Features & Use Cases - Zone and DNS Management: Create zones, list DNS records, and validate DNSSEC status without leaving the terminal. - Worker and Pages Deployment: Deploy Workers and bind custom domains to Pages projects using declarative commands. - Authentication and Account Switching: Manage multiple Cloudflare accounts and validate logged-in identity before mutations. - Use Case: You have a new domain shop.example.org to onboard to your company Cloudflare account. Use the cf-cli skill to authenticate to the correct account, create the zone, inspect nameserver requirements, and deploy a Worker to a custom domain—all without the dashboard. ## Quick Start Tell the skill which Cloudflare resource you need to inspect or modify (e.g., "list all D1 databases in my account" or "attach a custom domain to my Pages project"), and it will search for the correct command, authenticate if needed, and execute it safely.

Frequently Asked Questions about cf-cli

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

FAQPage Schema
How do I deploy a Worker to a custom domain using cf CLI?▼

Verify the zone exists and is active, then use `cf schema` to inspect the custom domain attachment command. Check `cloudflare.config.ts` for routing configuration, confirm no conflicting CNAME exists, and finally attach the domain. Verify the deployed Worker responds on the custom domain with `curl`.

Can I migrate a Wrangler project to cf CLI?▼

Yes, use `cf migrate` to convert `wrangler.jsonc` to `cloudflare.config.ts`, then review the generated TypeScript config and test with `cf dev` before deploying. For existing CI/CD pipelines, inspect the generated config to ensure build and deployment paths match your workflow.

How do I add a custom domain to a Pages project with cf CLI?▼

Use `cf pages projects domains create` to attach the domain. If the domain is not in an active Cloudflare zone or requires DNS verification, the command will indicate pending status. Ensure both the DNS record and the Pages domain association are verified before the site becomes accessible.

What happens if I have multiple Cloudflare accounts?▼

Check the currently logged-in account with `cf auth whoami`. Use `--profile` or `--account` flags (discovered via `cf <command> --help`) to target a specific account. List zones before creating or modifying to confirm you are working in the correct account.

Why does my CNAME for a Pages project return 522 error?▼

A DNS CNAME record alone does not attach the Pages project. The domain must also be added to the Pages project via `cf pages projects domains create`. Check both the DNS record and the Pages project association; if either is missing, the site will not resolve.

How do I securely provide my Cloudflare API token to cf CLI?▼

Never paste tokens into commands or logs. Use `cf auth login` to authenticate interactively, or set the `CLOUDFLARE_API_TOKEN` environment variable and pass it securely outside of command arguments. Always use `cf auth whoami` to verify authentication before remote operations.