cloudflare-cli
Skill4 starsChanged 20 days agoMITView on GitHub
Operate Cloudflare from the shell with `cf`, Cloudflare's agent-oriented CLI (npm package `cf`, open beta) covering the whole Cloudflare API and Workers projects. Use to sign in and select an account or zone, find the command for a Cloudflare task, inspect or change resources such as DNS records, zones, Workers, D1, KV, R2, queues, and cache, and develop, build, or deploy a Workers project, including choosing between `cf` and Wrangler.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- genlayerlabs/genlayer-studiotheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- genlayerlabs/genlayer-studio★ 180same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- authoringSkill
- chrome-devtoolsSkill
- gamificationSkill
- imagegenSkill
- improve-architectureSkill
- instructionsSkill
- monorepoSkill
- reverse-engineerSkill
- runbookSkill
- security-reviewSkill
- setup-harnessSkill
- skillsSkill
- unslopSkill
- video-reportSkill
- youtube-transcriptSkill
- code-reviewSkill
- debugSkill
- interviewSkill
- prototypeSkill
- researchSkill
- workSkill
- adsenseSkill
- astryxSkill
- dokploy-best-practicesSkill
- extract-themeSkill
- nextjsSkill
- payload-cmsSkill
- shadersSkill
- swrSkill
- tanstack-querySkill
- tanstack-routerSkill
- tanstack-startSkill
- tanstack-storeSkill
- tauriSkill
- vite-plusSkill
- web-assets-optimizationSkill
- web-extensionSkill
- zodSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 2 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Run Cloudflare operations through cf.
- Very specific: line 23
Run cf --version. The package installs two equivalent commands, cf and cloudflare.
- Very specific: line 26
If both commands are missing, report it and propose npm i -g cf.
- Very specific: line 29
Run cf auth whoami and read its authenticated field: the command exits 0 even when nobody is signed in.
- Distinctive: line 32
When it is not authenticated, the user chooses the method:
- Very specific: line 70
Run cf migrate only when the user asks, on a clean Git worktree:
- Very specific: line 78
Run cf migrate. It creates cloudflare.config.ts next to the Wrangler file, sometimes wrangler.config.ts, and leaves the Wrangler file …
- Very specific: line 97
Run cf cli search "<task in plain words>".
- Very specific: line 120
Blocked: no command matches after search, schema, and cf docs search.
- Very specific: line 125
Run reads (get, list, whoami, schema) directly.
- Very specific: line 126
Before a change to remote resources, run the same command with --dry-run, which needs no credentials.
- Very specific: line 151
Use --local for development data: it covers KV keys, D1 (cf d1 raw, cf d1 migrations list|apply), and R2 objects, and keeps its state …
- Distinctive: line 190
Pending: if a command failed, report it with its stderr block and the next action instead of claiming the result.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare CLI
Run Cloudflare operations through cf. Inputs: the task, the target account and
zone, and the project directory when the task concerns a Workers project. Output:
the result of each command, backed by its output, and the identifiers of the
resources read or changed. Side effects: resource commands call the Cloudflare
API on the selected account unless run with --dry-run or --local; workflow
commands (init, build, deploy, migrate) also write project files.
cf is in beta and changes between releases. The installed --help, cf schema,
and cf cli search results win over this skill and over remembered Wrangler or
cf syntax. For a topic this skill does not cover, retrieve the documentation
index at https://developers.cloudflare.com/cf/llms.txt, or run
cf docs search "<question>".
1. Check the CLI and the identity
- Run
cf --version. The package installs two equivalent commands,cfandcloudflare; ifcfresolves to another tool (the Cloud Foundry CLI uses the same name), usecloudflarefor the whole task. - If both commands are missing, report it and propose
npm i -g cf. Install only with the user's approval. If npm warns that the Node.js version does not match the package'sengines, report the supported versions it names. - Run
cf auth whoamiand read itsauthenticatedfield: the command exits 0 even when nobody is signed in. A signed-in result also givesauthSource,tokenValid,email, andaccounts. - When it is not authenticated, the user chooses the method:
cf auth loginopens a browser approval that the user must complete. Add--no-browseron a remote machine or in a container so it only prints the link.- Otherwise the user sets
CLOUDFLARE_API_TOKENin the environment or in a Git-ignored.envor.env.localof the project. The token takes priority over a stored login. Ask the user to set it themselves; never request, echo, or write a token value. --temporary-accountcreates or reuses a temporary account when no credentials exist, and missing-credential errors recommend it. Use it only when the user asks for a temporary account.
- Select the account. Most account-scoped commands take
CLOUDFLARE_ACCOUNT_ID, thenaccountIdincloudflare.config.ts, then a cached choice, then a prompt. In an agent shell the prompt cannot appear, so credentials with several accounts fail withMore than one account available: ask the user which account to use, then setCLOUDFLARE_ACCOUNT_ID. Commands whose--helplists--account-idread only that flag, such ascf zones create, which needs it to place the zone, andcf zones list, which otherwise lists the zones of every account the credentials reach. - Select the zone, when the task needs one, with
--zone/-z(zone ID or domain) orCLOUDFLARE_ZONE_ID.
Done: the CLI responds, and the account (and zone) the commands will act on are known and confirmed by the user when more than one was possible. Blocked: CLI absent and installation declined, or no credentials; report the blocker and the commands the user can run.
2. Choose the CLI for a Workers project
Apply this only to dev, build, deploy, and project configuration. Resource
commands (DNS, zones, storage, cache, secrets) use cf in every project.
| Project contains | Use |
cloudflare.config.ts | cf |
wrangler.jsonc, wrangler.json, or wrangler.toml, and no cloudflare.config.ts | The project's Wrangler for dev, build, and deploy; cf dev, cf build, and cf deploy can ignore the Wrangler file or fail |
| Neither | cf (cf init to start a project); do not add Wrangler |
Run cf migrate only when the user asks, on a clean Git worktree:
- Preview with
cf migrate --dry-run, which lists the files it would change. By default it also installs packages from the network (cfas a development dependency, and the Vite plugin or Wrangler when the project needs them), which changespackage.jsonand the lockfile. Install only with the user's approval; otherwise pass--no-install, which leaves required installation items for the user. - Run
cf migrate. It createscloudflare.config.tsnext to the Wrangler file, sometimeswrangler.config.ts, and leaves the Wrangler file unchanged. - Both runs exit 1 while
[required]items remain; that status lists work left, not a failed migration. Resolve each item and delete itsTODO(@cloudflare)comment, then delete thethrowstatement it added at the top ofcloudflare.config.ts: until thencf dev,cf build, andcf deployfail withMigration incomplete.
Live Worker logs still need Wrangler: npx wrangler tail <worker>. Wrangler does
not read cloudflare.config.ts, so pass the Worker name. npx downloads Wrangler
when the project does not install it; that download needs the user's approval.
Done: the CLI for each project command is chosen from the files present. Blocked: the task needs Wrangler and its download is declined, or a migration item needs an installation the user has not approved; report what remains and the command the user can run.
3. Find the command
- Run
cf cli search "<task in plain words>". It searches locally without credentials and returns up to 5{command, summary}matches. Quote the whole task: unquoted words are parsed as commands. Describe only the action and the resource type, here and incf docs search: no names, domains, emails, account or resource IDs, or tokens. - Inspect the match with
cf schema <command words>(HTTP method, URL path, and the path, query, and body parameters) andcf <command> --help(flags, pagination, destructive behavior).
Generated commands follow cf <product> [group...] <operation>:
- The last path parameter is positional, except the zone, which always comes from
--zoneorCLOUDFLARE_ZONE_ID; earlier path parameters are required flags. - Query parameters are kebab-case flags, such as
--per-page. - A body is passed through the per-field flags that
--helplists, or whole with--body '<json>'or--body @file.json. Some commands, such ascf dns records create, have no per-field flags and accept only--body. Any text flag accepts@pathto read a file. Binary and multipart uploads use--file. - A list returns one page; follow the paging flags its
--helpshows.
Done: the command and its arguments are taken from search, schema, or help
output, not from memory.
Blocked: no command matches after search, schema, and cf docs search;
report the gap instead of guessing a syntax.
4. Run it
- Run reads (
get,list,whoami,schema) directly. - Before a change to remote resources, run the same command with
--dry-run, which needs no credentials. A generated command prints the method, URL, parameters, and body; it resolves neither a domain given to--zonenorCLOUDFLARE_ZONE_ID, so pass the zone ID with--zonewhen the preview must show the exact URL. Show the preview with the target account and zone, and run the change only when the user has authorized that operation. This covers deployments, DNS and configuration edits, cache purges, secrets, tokens, members, and anything that buys or bills (registrar, subscriptions, invoices). - Deletes and other confirmed operations prompt. In an agent shell the prompt
cannot be answered: without
--forcethe command printsAborted.and exits 1.--forceonly skips the prompt; pass it once the deletion is authorized. Read--helpfor options that widen the deletion, such ascf workers delete --delete-with-references, which also deletes a Worker that other Workers reference. - Workflow commands (
init,build,deploy,migrate) answer their own confirmation prompts with a fallback value when no terminal is attached, yes or no depending on the prompt; stderr shows each one asUsing fallback value in non-interactive context. In a project without configuration,cf deploydetects the framework and writescloudflare.config.ts, sometimeswrangler.config.ts, and can edit other project files, such aspackage.json, the lockfile,.gitignore,tsconfig.json, or the framework configuration. Runcf deploy --dry-runfirst: it lists the detected settings and the files it would create, and in a configured project it builds without deploying, which writes the build output. Pass the options that make the run explicit (--mode,--worker,--message), and check the files it changed afterwards. - Use
--localfor development data: it covers KV keys, D1 (cf d1 raw,cf d1 migrations list|apply), and R2 objects, and keeps its state outside the account. Other commands reject it rather than call the API.
Secrets
- Pass a secret value from a file the user controls, never as a literal argument:
cf workers secrets update <name> --worker <worker> --type secret_text --text @<file>for one secret, or--secrets-file <path>oncf deployorcf workers versions createto upload secrets with a new version.@<file>sends the file byte for byte, so it must hold the value without a trailing newline (for example, written withprintf '%s'). --dry-runmasks only the fields the API schema marks as sensitive.cf workers secrets updatemasks the value;cf workers secrets bulkprints the values of its body file in clear. Preview a command that carries secrets with a file of placeholder values, and never print secret values back.
Read the result
- stdout carries only the result: JSON, or the raw content for downloads such as
R2 objects. Notices, prompts, and errors go to stderr. Filter JSON with
jq, or withnodewhenjqis not installed; there is no--formator--fieldsflag.--quiethides notices. - A failure exits 1 and prints a text block on stderr with the API error code, message, HTTP status, and path. Exit 130 means the command was cancelled.
Done: each command's exit status and output are read, and every change is
confirmed by a later get or list.
Waiting: a change is previewed and awaits the user's authorization; report
its dry-run and run nothing else that depends on it.
5. Report
Report the account and zone used, the commands run, the dry-run shown before each change, the identifiers created, changed, or deleted, and the reads that confirm them. State what was not run, such as a change awaiting authorization or a task that needed Wrangler.
Done: requested result delivered and verified on the account. Pending: if a command failed, report it with its stderr block and the next action instead of claiming the result.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

