Skip to content

Cloudflare CLI

Last updated View as MarkdownAgent setup

The Cloudflare CLI, cf, is one command-line interface for the public Cloudflare API and for Workers projects. Use it to manage zones, DNS, storage, and security settings, and to create, develop, and deploy Workers. Coding agents run the same commands you do.

Install cf globally:

npm install --global cf

To sign in and run your first command, refer to Install and sign in.

Choose your path

Deploy a Worker

Create a project with cf init, develop it locally, and deploy it.

Manage resources

Find zones and create, list, and delete DNS records from the command line.

Coding agents

Set up coding agents to find and run Cloudflare commands with cf.

What cf provides

  • Commands for the public API. More than 2,900 commands, most of them generated from the schemas that describe the Cloudflare API.
  • Typed project configuration. Workers projects use cloudflare.config.ts, so editors and agents can autocomplete bindings and triggers.
  • Project commands. cf dev, cf build, and cf deploy run your framework's own command, the Cloudflare Vite plugin, or Wrangler, depending on the project. To learn more, refer to How cf runs your project.
  • Command search. cf cli search finds commands from a plain-language description of a task.

cf and Wrangler

Wrangler is the CLI for Workers projects configured with wrangler.jsonc or wrangler.toml. cf covers the public Cloudflare API and uses cloudflare.config.ts for Workers projects.

You can run cf resource commands alongside an existing Wrangler project without changing it. Before you run cf dev, cf build, or cf deploy in a Wrangler project, convert it with cf migrate. To compare the two tools and plan a move, refer to cf for Wrangler users.

Was this helpful?