Skip to main content
~/tools/cloudflare
$ inspect Cloudflare
repo: https://github.com/cloudflare/cf
language: TypeScript
status: indexed
$ cat ./cloudflare.md

Cloudflare

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.

1,113 stars 88 forks TypeScript Apache License 2.0
cloudflare 736 Oct 5, 2026
Login with GitHub to like and favorite this CLI tool
$ git release --latest

Latest Releases

All releases

Minor Changes
  • 7cbe76a: Reject a CLOUDFLAREACCOUNTID that differs from the Build Output's account

cf deploy, cf workers versions create, cf workers triggers deploy, and cf previews deploy now fail before making any API requests, including with --dry-run, when CLOUDFLAREACCOUNTID is set to a different account from the accountId recorded in the Build Output. Previously the recorded account was used and CLOUDFLAREACCOUNTID was silently ignored, so a deploy could go to a different account from the one the environment named.
This is a breaking change for projects that set both to different values. The error says where CLOUDFLAREACCOUNTID came from, such as .env.staging, and how to resolve it: remove CLOUDFLAREACCOUNTID or set it to the recorded account to deploy there, or change or remove accountId and rebuild.
A CLOUDFLARECOMPLIANCEREGION that differs from the recorded complianceRegion was already rejected. Its error now uses the same cloudflare.config.ts names and also says where the value came from. An invalid CLOUDFLARECOMPLIANCEREGION now gets the same error as other commands, and that error now names the dotenv file the value came from.
  • e27d3e6: Add D1 Insights index recommendations and settings commands

Use cf d1 insights recommendations to retrieve index recommendations and cf d1 insights settings get or cf d1 insights settings update to view or change the account's AI setting. Use cf d1 list --fields to select returned database fields, including the opt-in recommendation_count field.
  • e27d3e6: Add multi-feed filters to Cloudforce One Threat Signals

Repeat --feed-id on cf cloudforce-one threat-signals articles list or cf cloudforce-one threat-signals search to match multiple feeds. Use --feed-category-id on articles list to filter by feed category ID.
  • 4472d3f: Update the generated command surface for Cloudflare API schemas revision
0b6f5865a28c7bb408f8468a173cec59c411345a.
  • e27d3e6: Remove cf zero-trust risk-scoring commands no longer in the API schema

Breaking change: under cf zero-trust risk-scoring, the get, reset, behaviours get, behaviours update, and summary get commands are no longer available. Update scripts that call them before upgrading. Commands under cf zero-trust risk-scoring integrations remain available.
  • 6de4261: Update the generated command surface for Cloudflare API schemas revision
3359e90fa19e8e250ab5a402b0f9dbe65bbe82a3.
Breaking: Replace cf organizations members batch create <organization-id> with cf organizations members bulk-create --organization-id <organization-id>. Update scripts to pass the ID as a required flag instead of a positional argument. The old command has no compatibility alias.
Use cf o11y destinations get <slug> to fetch a Workers Observability Telemetry Destination by its slug.
Patch Changes
  • d4c61ea: Load .env files for the Build Output's mode when --mode is omitted

cf deploy, cf workers versions create, cf workers triggers deploy, and cf previews deploy now load .env.<mode> and .env.<mode>.local for the mode recorded in the Build Output when --mode is not passed. Previously they read only .env and .env.local, so deploying a staging build without repeating --mode staging could use the account and API token from .env instead of .env.staging.
Vite records its default production mode when a build runs without --mode, so these commands now also load .env.production for such builds, matching the files the build itself used. An explicit --mode must still match the recorded mode.

Minor Changes
  • 4b70646: Generate commands from the Cloudflare API schemas repository

The generated command surface now comes from openapi.json in cloudflare/api-schemas, pinned to revision 3caa09607da12e7b79d55b704a20e2cf4ad8af53. cf stream webhooks update accepts --notification-url, and cf url-scanner scans create reflects the current set of supported scan countries.
  • aa0a99c: Detect Google Antigravity as an AI coding agent.

Recognize commands run by Antigravity agents in both the IDE and the agy CLI through the ANTIGRAVITYAGENT and ANTIGRAVITYCONVERSATION_ID environment markers. Capture the agent session ID from ANTIGRAVITYCONVERSATIONID.
  • 5108951: Detect GitHub Copilot CLI, Kiro, Junie, Goose, and Cline as AI coding agents.

Recognize commands run by these agents through the environment markers each one sets for its shell commands, and capture the agent session ID where the harness provides one.
  • b0a8d07: Treat any AI_AGENT value as an AI coding agent.

When AIAGENT names an agent that cf has no detector for, cf now treats the run as agentic and records the agent as unknown, along with the name it gives. Claude Code is also recognised from its AIAGENT value, and its version is recorded in telemetry.
  • 5c22d4c: Update the generated command surface for Cloudflare API schemas revision
2b5897fc2d555d6d7da7fa6a2d99290840d9fdef.
  • 654e83f: Update the generated command surface for Cloudflare API schemas revision
2f687dad103baa5342ddd1532a2463c5f268f37d.
  • addbeb2: Update the generated beta CWS commands for Cloudflare API schemas revision
5aec9e4e3a074fa419d2fe1b7c0894e513c29a3e.
Breaking: cf zero-trust cws tenant-structures nodes batch <structure-id> is now cf zero-trust cws tenant-structures nodes bulk-apply --structure-id <structure-id>. There is no compatibility alias; update scripts to use the new command name and flag.
Breaking: cf zero-trust cws policies delete <policy-id> no longer removes policy-set memberships. Detach the policy from every policy set before deleting it. Likewise, detach a policy set from every deployment before running cf zero-trust cws policy-sets delete <policy-set-id>.
  • 4bb05f0: Update the generated command surface for Cloudflare API schemas revision
997ede33e123e947bb3360019fe15f68ca40575a.
  • c1bfbba: Update the generated command surface for Cloudflare API schemas revision
e644d40187303e434fdf387df24db64f529db6e3.
Patch Changes
  • 39dd31e: Show the actual CLI flag names when validating required fields in renamed optional objects.

  • c84ec6d: Update dependencies published from the Workers SDK repository:

- @cloudflare/deploy-helpers: 0.29.1 → 0.30.0 - @cloudflare/runtime-types: 0.1.33 → 0.1.34 - @cloudflare/workers-auth: 0.18.7 → 0.18.8 - miniflare: 5.20261123.0-beta → 5.20261123.1-beta
  • b184b92: Update dependencies published from the Workers SDK repository:

- @cloudflare/autoconfig: 0.13.3 → 0.13.4 - @cloudflare/build-output-utils: 1.0.0-rc.3 → 1.0.0-rc.4 - @cloudflare/cli-shared-helpers: 0.3.12 → 0.3.13 - @cloudflare/codemods: 0.9.0 → 0.9.1 - @cloudflare/config: 1.0.0-rc.3 → 1.0.0-rc.4 - @cloudflare/containers-shared: 0.27.1 → 0.27.2 - @cloudflare/deploy-helpers: 0.29.0 → 0.29.1 - @cloudflare/runtime-types: 0.1.32 → 0.1.33 - @cloudflare/workers-auth: 0.18.6 → 0.18.7 - @cloudflare/workers-utils: 0.56.0 → 0.57.0 - miniflare: 5.20261119.0-beta → 5.20261123.0-beta

Minor Changes
  • 0848e17: Offer to delete a Worker's Container applications with cf workers delete

The command finds applications owned by the Worker before deleting it. It offers to delete them interactively and warns when it leaves them behind. To opt in without a prompt, run cf workers delete <worker> --delete-containers --force. --force alone still only skips confirmation. Application deletion is asynchronous, so instances may take a while to shut down.
Patch Changes
  • 30bfe56: Name invalid OAuth scopes and re-authenticate when changing scopes

Name the specific invalid OAuth scopes when scope validation fails during cf auth login. When an explicit scope list differs from the existing login's scopes, start a new login flow with the requested scopes without requiring --force, including when requesting fewer scopes.
  • b4c28e8: Update the generated command surface for @cloudflare/forge
0.3.0.

Minor Changes
  • 5f7ebcf: Add cf update to update the current cf installation with its package manager.

Update a project dependency or a global installation, choose a release tag or version, and preview the package manager command with --dry-run.
  • 29442c5: Add --secrets-file to cf previews deploy

Use cf previews deploy --secrets-file .env.preview to upload secrets with a Preview deployment, in the same JSON or .env format that cf deploy --secrets-file accepts. Previously, Preview secrets could only be set in the Cloudflare dashboard or with Wrangler.
  • 1288332: Update the generated command surface for Forge OpenAPI release
1c2a2f19ace2d4c55bfb77ebb17c408a004c40d0.
Breaking: cf user load-balancers pools edit pools pool <pool-id> is now cf user load-balancers pools edit <pool-id>, and cf user load-balancers pools edit pools pools is now cf user load-balancers pools bulk-edit.
  • 34c393f: Update the generated command surface for Forge OpenAPI release
2b2a4d864560ba802f264202316ec9eaf8595dd6.
  • 1dbe7e9: Update the generated command surface for Forge OpenAPI release
4a9d37b27a68d4c7bc23d71600b0b29b61f6c0fd.
Breaking: Several commands are renamed, and some take their identifiers as flags instead of positional arguments. There are no compatibility aliases; update scripts to use the new names and inputs:
- cf vectorize insert, upsert, and query are now cf vectorize vectors insert, upsert, and query. - cf vectorize get-by-ids, delete-by-ids, and list-vectors are now cf vectorize vectors bulk-get, bulk-delete, and list. These take the index as --index-name instead of a positional argument. - cf vectorize metadata-index is now cf vectorize metadata-indexes. - cf dns settings account views is now cf dns views. - cf cloudforce-one requests get-request-list, get-request-read, post-request-create, and put-request-update are now list, get, create, and update. The renamed list command takes the project type as --project-type instead of a positional argument. - cf addressing address-maps accounts update is now create. The ips and zones subgroups rename update to create, update-bulk to bulk-create, and delete-bulk to bulk-delete. The renamed bulk commands take the Address Map ID as --address-map-id instead of a positional argument. - cf cache origin-cloud-regions bulk update and bulk delete are now cf cache origin-cloud-regions bulk-replace and bulk-delete. - cf intel indicator-feeds permissions create and delete are now grant and revoke. - cf resource-sharing recipients update and cf resource-sharing excluded-recipients update are now replace. - cf waiting-rooms rules get is now cf waiting-rooms rules list, which takes the waiting room ID as --waiting-room-id instead of a positional argument.
Breaking: Some existing commands change their flags:
- cf workers deployments create renames --code-update-strategy-mode and --code-update-strategy-max-delay to --durable-objects-code-update-mode and --durable-objects-code-update-max-delay. - cf turnstile widgets update no longer accepts --region. - cf turnstile widgets create no longer accepts the list flags --page, --per-page, --order, --direction, and --filter.
cf o11y telemetry live-tail and cf o11y telemetry heartbeat are removed; use cf observability tail to stream live events.
New commands include cf ai-gateway model-aliases, cf feedback, cf pay-per-use agreements, and cf pay-per-use enabled-publishers list. cf queues subscriptions list accepts an optional --queue-id filter.
  • edd1c14: Update the generated command surface for Forge OpenAPI release
5162716769ddc087f36d6661a879e2082c88ee44.
Breaking: Update scripts that use these renamed commands; there are no compatibility aliases:
- cf realtime kit apps update, cf realtime kit meetings update, cf realtime kit meetings participants update, cf realtime kit presets update, and cf realtime kit webhooks update now use edit instead of update. - cf network subnets initial-resolved-ip edit is now cf network subnets initial-resolved-ip replace. - cf dns dnssec list zsks is now cf dns dnssec zsks list.
cf realtime kit meetings active kick and mute no longer accept --custom-participant-ids. Use --participant-ids with participant IDs instead; it is now required when using individual flags.
Patch Changes
  • eba97c3: Allow null for JSON object-array flags when the API schema permits it. For example, cf mcp servers update <id> --updated-tools null resets the tool overrides to absent rather than setting an empty list.

  • 505ecaf: Update dependencies published from the Workers SDK repository:

- @cloudflare/autoconfig: 0.13.1 → 0.13.2 - @cloudflare/build-output-utils: 1.0.0-rc.1 → 1.0.0-rc.2 - @cloudflare/cli-shared-helpers: 0.3.10 → 0.3.11 - @cloudflare/codemods: 0.8.1 → 0.8.2 - @cloudflare/config: 1.0.0-rc.1 → 1.0.0-rc.2 - @cloudflare/containers-shared: 0.26.3 → 0.27.0 - @cloudflare/deploy-helpers: 0.27.2 → 0.28.0 - @cloudflare/runtime-types: 0.1.30 → 0.1.31 - @cloudflare/workers-auth: 0.18.4 → 0.18.5 - @cloudflare/workers-utils: 0.54.2 → 0.55.0 - miniflare: 5.20261117.0-beta → 5.20261118.0-beta
  • 974dfbb: Update dependencies published from the Workers SDK repository:

- @cloudflare/autoconfig: 0.13.2 → 0.13.3 - @cloudflare/build-output-utils: 1.0.0-rc.2 → 1.0.0-rc.3 - @cloudflare/cli-shared-helpers: 0.3.11 → 0.3.12 - @cloudflare/codemods: 0.8.2 → 0.9.0 - @cloudflare/config: 1.0.0-rc.2 → 1.0.0-rc.3 - @cloudflare/containers-shared: 0.27.0 → 0.27.1 - @cloudflare/deploy-helpers: 0.28.0 → 0.29.0 - @cloudflare/runtime-types: 0.1.31 → 0.1.32 - @cloudflare/workers-auth: 0.18.5 → 0.18.6 - @cloudflare/workers-utils: 0.55.0 → 0.56.0 - miniflare: 5.20261118.0-beta → 5.20261119.0-beta
  • c126d2e: Retain Container images for repeated Build Output uploads

Keep local image tags referenced by saved Build Output after successful deploys and Worker version uploads. Reusing that output with --prebuilt now succeeds for both standard Containers and Durable Object-managed Containers.

Minor Changes
  • abdeb11: Update the generated command surface for Forge OpenAPI release
177948ebb88abee3f73ef695ae2ddadb1d13079b.
  • 8752121: Update the generated command surface for Forge OpenAPI release
25d3d64b6ab8b024a15ea087f4f64dff266559ff.
  • c27b49c: Update the generated command surface for Forge OpenAPI release
2cd0db79834aae45e3eb23a499a20e159ae10155.
  • 1419584: Update the generated command surface for Forge OpenAPI release
3c62cf9a295ce5a87736a7bc202e3184d6fd0d29.
Breaking change: cf hyperdrive update is now cf hyperdrive edit. Update scripts to use cf hyperdrive edit <hyperdrive-id> with the same flags.
  • 777bb28: Update the generated command surface for Forge OpenAPI release
47f30fe3d687230ce60145cea2f8a3e2284a766f.
Breaking: cf dns records batch is now cf dns records bulk-apply. There is no compatibility alias; update scripts to use the new command name.
cf dns records export now supports filters such as --name, --type, and --proxied.
  • aa1d296: Use worker.name from cloudflare.config.ts when --worker is omitted

The API-backed cf workers commands (secrets, versions, deployments, get and delete) now fall back to the project's worker.name, evaluated with the current --mode, when --worker is not passed. The name's source is printed on stderr unless --quiet is set; destructive confirmations still name the resolved Worker. Config load and validation errors are reported when the fallback is needed. Passing --worker works as before.
Patch Changes
  • a3eb61e: Accurately report missing auth profiles

When commands resolve or are given a non-existent auth profile, report that the specified profile was not found and list available profiles instead of emitting a misleading "No authentication token found" error.
  • a36fa5f: Apply large local D1 migrations as a batch of SQL statements

Use Wrangler's shared SQL splitter so cf d1 migrations apply <database-id> --local can apply migration files larger than SQLite's per-statement SQL length limit when their individual statements fit. Keep each migration and its bookkeeping insert in one atomic batch, preserving rollback on failure.
  • 79ecb72: Resolve required input before showing dry-run previews

Read piped secret values and prompt for missing required fields during dry runs, just as during execution. Reject missing required body input instead of showing an incomplete successful preview, while continuing to redact secrets and skip authentication and API requests.
On normal runs, authenticate before prompting for required fields or consuming their piped values.
  • 2eb4b0e: Preserve body account fields independently of path account context

Restore the required --excluded-account-id flag for cf resource-sharing excluded-recipients create. Keep the owning account in the URL and send the excluded account as the JSON account_id, including in dry-run previews. Honor schema names for body account fields independently of their path names.
Also restore --account-id-body on cf cloudforce-one threat-intel datasets access groups members create, cf cloudforce-one threat-intel events create, and cf intel indicator-feeds providers create. The Intel provider command requires this field: pass --account-id-body or include account_id in --body.
  • bdff477: Preserve every distinct variant description in generated flag help

Show alternative descriptions when object union variants share a flag, including non-enum fields and nested objects. Group identical descriptions and label enum alternatives with their values so variant-specific constraints remain clear in help and command metadata. Normalize surrounding whitespace before comparing and rendering variant descriptions.
  • f88b435: Bump the @cloudflare/forge pin to build
f6720c19250f90fe5b395ef2c38d488aaba31641 (Forge 0.2.0, which moved SDK generation under a generate subcommand) and invoke the CLI via forge generate so pnpm generate keeps working.

Installation

npm install --global cf
bun add --global cf
pnpm add --global cf
yarn global add cf
$ tail ./comments.log

Comments (0)

Login with GitHub to post a comment
No comments yet. Be the first to comment!