Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

cf-cli — Claude Code skill: Cloudflare API and Workers

Cloudflare's official CLI for the public API and Workers projects, now available in your editor. Search for commands by task description, manage DNS, storage, and deployments.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add cloudflare/skills --skill cf-cli -a claude-code
Open on GitHub

What cf-cli does

cf-cli is a skill that brings the complete Cloudflare API into your editor's terminal. It includes over 2,900 commands, most generated from API schemas. You describe your task to cf cli search, check the command schema with cf schema, preview with --dry-run, and run once you've verified.

The skill handles DNS records, zones, D1 databases, KV and R2 storage, and Workers deployments. If your project already has wrangler.jsonc or wrangler.toml, the skill coexists fine—resource commands (storage, DNS) work alongside Wrangler. Requires Node.js 22.18 or later. If another tool named cf is already installed, use the cloudflare command instead.

For headless setups (remote machines, containers, or agent-driven development), use --no-browser during login or set the CLOUDFLARE_API_TOKEN environment variable. This matters when an agent rather than a person is at the keyboard.

What it helps with

  • find the right Cloudflare command by describing your task
  • create and manage DNS records and zones from the terminal
  • deploy and preview Workers changes before running them
  • work with D1 databases, KV and R2 storage through CLI
  • migrate a Wrangler project to the new cf-cli

Example prompts for the agent

  • Search for a command to create a DNS record: `cf cli search "create a DNS record"`
  • View the command schema and parameters: `cf schema d1 create`
  • Deploy a Worker with a dry-run check first: `cf deploy --dry-run`, then `cf deploy`

How to install cf-cli

1Skills CLI (Vercel)

npx skills add cloudflare/skills --skill cf-cli -a claude-code

2Manually: put the files in place

~/.claude/skills/cf-cli/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cf-cli/

From the same set18

The whole set →
cloudflare cloudflare Helps coding agents pick the right Cloudflare products for applications, storage, and AI, while routing between cf CLI and Wrangler. Claude Code CX Codex Cursor +1 136,500installs wrangler cloudflare Runs and troubleshoots Wrangler CLI commands for Cloudflare Workers projects that use wrangler configuration files. Claude Code CX Codex Cursor +1 128,500installs workers-best-practices cloudflare Guides coding agents on production Cloudflare Workers standards, Wrangler typing, observability setup, and runtime anti-pattern checks. Claude Code CX Codex Cursor +1 124,900installs durable-objects cloudflare This skill helps build, debug, and review Cloudflare Durable Objects for state, coordination, and persistent connections. Claude Code CX Codex Cursor +1 109,700installs web-perf cloudflare Audit Core Web Vitals, diagnose rendering bottlenecks, and inspect network dependencies directly through your agent. Claude Code CX Codex Cursor +1 109,300installs agents-sdk cloudflare Helps build, debug, and review Cloudflare Agents SDK applications using the agents package and official documentation. Claude Code CX Codex Cursor +1 105,700installs cloudflare-email-service cloudflare A skill for Cloudflare Email Sending and Email Routing: it walks the agent through sending and receiving mail in Workers. Claude Code CX Codex Cursor +1 101,400installs cloudflare-one cloudflare Walks your agent through designing, configuring and troubleshooting Cloudflare One Zero Trust and SASE deployments. Useful when you need Access, Gateway or tunnel work done without digging through docs yourself. Claude Code CX Codex Cursor +1 92,200installs

Similar

google-cloud-filestore-log-troubleshooting official google Diagnoses Google Cloud Filestore mount failures, access errors, and network timeouts. Use it when an NFS share stops mounting from a VM, GKE pod, or another supported workload. Claude Code Gemini CLI CX Codex 1,600installs flowstudio-power-automate-build official github Build, deploy, and test Power Automate cloud flows through the FlowStudio MCP server. Use it when an agent needs to create or edit a workflow without opening the portal. GitHub Copilot 1,900installs database-optimizer https://github.com/Jeffallan Investigates slow PostgreSQL and MySQL queries, breaks down execution plans with EXPLAIN ANALYZE, and drafts indexes without table locks. Claude Code CX Codex Cursor +1 5,900installs senior-architect sickn33 A skill for designing and reviewing system architecture based on explicit requirements, tradeoffs and evidence. Helps you choose an approach by examining current state, alternatives and risks. Claude Code CX Codex Cursor +1 2,200installs cli-health cheaper-inference Checks server health, component statuses, and metrics for OmniRoute via the CLI. It tracks circuit breakers and provider availability directly in the terminal. Claude Code CX Codex Cursor +1 992installs omni-usage-logs cheaper-inference A skill that lets your agent query the OmniRoute usage API for call logs, token spend, latency and budget state across connections. Claude Code CX Codex Cursor +1 990installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. Claude Code 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs

Questions about cf-cli

How do I install cf-cli in Claude Code?

Run npx skills add cloudflare/skills --skill cf-cli -a claude-code in the terminal. After installation, verify with cf --version and log in with cf auth whoami. Requires Node.js 22.18 or later.

What does cf-cli do?

It gives you command-line access to the full Cloudflare API: manage DNS, Workers, D1, KV, and R2 storage. It can search for commands by task description and show you the request schema before you run it.

Can I use cf-cli alongside Wrangler?

Yes, but do not run cf dev, cf build, or cf deploy in a Wrangler project—they can create a conflicting configuration. Resource commands (DNS, storage) work fine. To fully migrate, use cf migrate --dry-run first, then cf migrate.

Source text

SKILL.md · Apache-2.0
---
name: cf-cli
description: Cloudflare's official cf CLI (beta) for the public Cloudflare API and Workers projects. Use for finding and running Cloudflare commands from the terminal — sign-in and profiles, cf cli search, cf schema, cf deploy/dev/build, resource commands for DNS, zones, D1, KV, and R2 — and for choosing between cf and Wrangler in a project.
---

# Cloudflare CLI (`cf`)

`cf` is Cloudflare's command-line interface for the public Cloudflare API (2,900+ commands, most generated from API schemas) and for Workers projects. It is in beta: commands, configuration, and Build Output can change before the stable release.

**Prefer retrieval over pre-trained knowledge.** Describe the task to `cf cli search`, inspect the match with `cf schema` or `--help`, and preview with `--dry-run` before running a command you have not verified.

Docs index: https://developers.cloudflare.com/cf/llms.txt

## Documentation

| Topic | Page |
|-------|------|
| Install, sign in, credential and account selection | https://developers.cloudflare.com/cf/get-started/index.md |
| First Worker with `cf init`, `cf dev`, `cf deploy` | https://developers.cloudflare.com/cf/get-started/first-worker/index.md |
| Find, create, and delete resources from the terminal | https://developers.cloudflare.com/cf/get-started/resources/index.md |
| `cf` for Wrangler users | https://developers.cloudflare.com/cf/wrangler/index.md |
| Migrate a Wrangler project with `cf migrate` | https://developers.cloudflare.com/cf/wrangler/migrate/index.md |
| Wrangler-to-`cf` command and config reference | https://developers.cloudflare.com/cf/wrangler/reference/index.md |
| Develop, build, and deploy; modes and previews | https://developers.cloudflare.com/cf/projects/index.md |
| Typed `cloudflare.config.ts` | https://developers.cloudflare.com/cf/projects/cloudflare-config/index.md |
| Using `cf` with coding agents (safety rules) | https://developers.cloudflare.com/cf/agents/index.md |
| CI, API tokens, unattended authentication | https://developers.cloudflare.com/cf/ci/index.md |
| Environment variables | https://developers.cloudflare.com/cf/environment-variables/index.md |

## FIRST: check installation and sign in

```bash
npm install --global cf   # installs two equivalent commands: `cf` and `cloudflare`
cf --version
cf auth whoami
```

- Requires Node.js 22.18 or later. Bun is not supported.
- If another tool named `cf` is on your `PATH`, use `cloudflare` instead — the package installs both commands.
- `cf auth login` prints a link and a one-time code, then opens the browser. On a remote machine, over SSH, or in a container, add `--no-browser` so `cf` only prints the link; approve it from another device. Add `--force` to sign in again.
- `cf` keeps its own credentials and does not reuse a Wrangler login.
- Unattended agents and CI cannot complete `cf auth login` — set `CLOUDFLARE_API_TOKEN` instead (see https://developers.cloudflare.com/cf/ci/index.md).

To make agents prefer `cf`, add this to the user-level `AGENTS.md`, `CLAUDE.md`, or equivalent:

```md
When interacting with Cloudflare, use the `cf` CLI unless the project has a
Wrangler configuration file.
```

## Find commands

```bash
cf cli search "create a DNS record"   # local, no credentials; quote the whole task; up to 5 JSON matches
cf schema d1 create                   # API request shape: method, path, params, body fields
cf <command> --help                   # arguments and options (e.g. cf deploy --help)
```

`cf cli search` takes the task as one argument — unquoted words after the first are parsed as unknown commands. `cf schema` covers generated API commands; for command arguments and options use `--help`.

## Read output

- Results are JSON on standard output; status messages and errors go to standard error, so piping to `jq` or redirecting needs no extra flags.
- Lists print one JSON array page; paging options differ per command — check `--help`.
- A failed command exits non-zero and prints the error to standard error.

## Run commands safely

- **Preview first.** `--dry-run` prints the request as JSON without sending it, and needs no credentials.
- **Aborted deletes still exit 0.** In a non-interactive session, a destructive command without `--force` prints `Aborted.` to standard error and exits `0` — a zero exit does not mean the resource was deleted.
- **Review `--force` before allowing it.** On some commands `--force` is also an API parameter (for example, `cf workers delete --force` also deletes a Worker that other Workers reference).
- **`--local` is limited.** It works for KV keys, D1 databases (`cf d1 raw`, `cf d1 migrations list|apply`), and R2 objects; other commands (including `cf d1 query`) return an error instead of calling the API.

## Choose the CLI for this project

- `cloudflare.config.ts` exists: use `cf`.
- `wrangler.jsonc`, `wrangler.json`, or `wrangler.toml` exists, and no `cloudflare.config.ts`: keep Wrangler for `dev`, `build`, and `deploy`. Do not run `cf dev`, `cf build`, or `cf deploy` there — they can generate a new configuration that ignores the Wrangler file, or fail. `cf` resource commands (DNS, zones, storage) are fine alongside it. Run `cf migrate` only when the user asks, and follow [Migrate a Wrangler project](https://developers.cloudflare.com/cf/wrangler/migrate/index.md): preview with `cf migrate --dry-run`, run `cf migrate`, then resolve the `TODO(@cloudflare)` comments in the generated `cloudflare.config.ts`.
- Neither exists: use `cf`, as [Use cf with coding agents](https://developers.cloudflare.com/cf/agents/index.md) recommends. Do not install Wrangler or create a Wrangler configuration file.

For Wrangler equivalents, use the [Wrangler to cf reference](https://developers.cloudflare.com/cf/wrangler/reference/index.md) or `cf cli search`. Do not translate Wrangler commands from memory. For the full comparison, refer to [`cf` for Wrangler users](https://developers.cloudflare.com/cf/wrangler/index.md).

## Commands `cf` does not support yet

`cf` does not support every Wrangler command yet. Run these with `npx wrangler` instead of adding Wrangler to the project. Wrangler does not read `cloudflare.config.ts`, so pass the Worker name:

- Live logs: `npx wrangler tail <WORKER_NAME>`.
- A single secret: `npx wrangler secret put <SECRET_NAME> --name <WORKER_NAME>`. Or upload secrets with a new Worker version by passing `--secrets-file <PATH>` to `cf deploy` or `cf workers versions create`.

For the current list, refer to "Commands not yet supported" in the [Wrangler to cf reference](https://developers.cloudflare.com/cf/wrangler/reference/index.md).

© cloudflare · Apache-2.0 · cloudflare/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor