cf-cli

软件研发 云服务与部署 CLIwrangler 1 文件 EN 原文

Cloudflare 命令行

用 wrangler 部署、查看日志与管理资源。

说明语言:中英混合

原文描述EN

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.

来源cloudflareskills ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/cloudflare/skills --skill cf-cli

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

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

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

FIRST: check installation and sign in

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

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

Run commands safely

Choose the CLI for this project

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:

For the current list, refer to "Commands not yet supported" in the Wrangler to cf reference.

同类技能
agents-sdkbasincloudflarecloudflare-email-servicecloudflare-onecloudflare-one-migrationsdurable-objectsfirebase-auth-basics
本页内容来自开源项目 cloudflare, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。