Software DevelopmentOfficial · cloudflare

Cf Cli skill for Claude

Cloudflare's official cf CLI (beta) for the public Cloudflare API and Workers projects.

When Claude uses it

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.

Cf Cli SKILL.md

The full skill file from cloudflare/skills (Apache-2.0).

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

TopicPage
Install, sign in, credential and account selectionhttps://developers.cloudflare.com/cf/get-started/index.md
First Worker with cf init, cf dev, cf deployhttps://developers.cloudflare.com/cf/get-started/first-worker/index.md
Find, create, and delete resources from the terminalhttps://developers.cloudflare.com/cf/get-started/resources/index.md
cf for Wrangler usershttps://developers.cloudflare.com/cf/wrangler/index.md
Migrate a Wrangler project with cf migratehttps://developers.cloudflare.com/cf/wrangler/migrate/index.md
Wrangler-to-cf command and config referencehttps://developers.cloudflare.com/cf/wrangler/reference/index.md
Develop, build, and deploy; modes and previewshttps://developers.cloudflare.com/cf/projects/index.md
Typed cloudflare.config.tshttps://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 authenticationhttps://developers.cloudflare.com/cf/ci/index.md
Environment variableshttps://developers.cloudflare.com/cf/environment-variables/index.md
Find slow or expensive D1 databases and queries with cf sql queryhttps://developers.cloudflare.com/d1/observability/find-expensive-queries/index.md

FIRST: check installation and sign in

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:

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

Find commands

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: 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 recommends. Do not install Wrangler or create a Wrangler configuration file.

Product documentation often shows only Wrangler commands and wrangler.jsonc configuration. In a cf project, treat those as tasks to translate, not commands to run, and do not add a Wrangler configuration file. Use one CLI per project; the only exceptions are the commands under Commands cf does not support yet. For Wrangler equivalents, use the Wrangler to cf reference or cf cli search. Do not translate Wrangler commands from memory. For the full comparison, refer to cf for Wrangler users.

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.

Skill feedback

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.

How to install Cf Cli

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit cloudflare/skills/skills/cf-cli#main ~/.claude/skills/cf-cli

Codex

npx degit cloudflare/skills/skills/cf-cli#main ~/.codex/skills/cf-cli

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Cf Cli skill do?

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.

+How do I install Cf Cli in Claude Code?

Copy the skill folder into ~/.claude/skills/cf-cli, for example with "npx degit cloudflare/skills/skills/cf-cli#main ~/.claude/skills/cf-cli". Claude Code loads it automatically and uses it when a task matches.

+Does Cf Cli work with ChatGPT or Codex?

Yes. Cf Cli uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/cf-cli. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Cf Cli free?

Cf Cli is published on GitHub by cloudflare under the Apache-2.0 license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Durable Objects

    Official

    Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

    cloudflare/skills★ 3.4k
  5. Frameworks On Cloudflare

    Official

    Build, migrate, and deploy web-framework applications on Cloudflare Workers.

    cloudflare/skills★ 3.4k
  6. Gateway Workers

    Official

    Build, debug, or review Cloudflare Workers invoked by the Forward action in Gateway HTTP policies, including the GatewayMiddleware…

    cloudflare/skills★ 3.4k
  7. Workers Development

    Official

    Run, inspect, and debug Cloudflare Workers during local development with cf dev, wrangler dev, or the Cloudflare Vite plugin, using Local…

    cloudflare/skills★ 3.4k
  8. Workers Profiling

    Official

    Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects.

    cloudflare/skills★ 3.4k
  9. Wrangler

    Official

    Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local…

    cloudflare/skills★ 3.4k

See all software development skills →

More skills from cloudflare

  1. Cloudflare App Bootstrap

    Official

    Get a Cloudflare Workers app to a working local request by connecting its bindings, secrets, and initial data, then verifying real…

    cloudflare/skills★ 3.4k
  2. Cloudflare Email Service

    Official

    Implement or troubleshoot Cloudflare Email Sending and Email Routing integrations and their delivery configuration.

    cloudflare/skills★ 3.4k
  3. Cloudflare One

    Official

    Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments.

    cloudflare/skills★ 3.4k

All skills by cloudflare →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.