cf
AGENTS.md1k starsChanged 9 days agoApache-2.0View on GitHub
This repository contains the public cf npm CLI and its command generator. cf is an agent-first CLI for the whole Cloudflare API. Shared Forge code is installed from a commit-pinned pkg.pr.new build until it is available on npm. - CLI instructions: command, generator, dotenv, child-process, and runtime conventions when working in packages/cli/. - Wrangler test instructions: parity classification and generated test inventory rules. - Architecture reference: detailed layout, library map, generator behavior, UX, flags, dependency updates, and publishing. Read the…
- Installs packages
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about cloudflare/cf
- cloudflare/workers-sdk“[autoconfig] prepare cf for the Vite plugin beta”GitHub · Sep 23, 2026 · 2 reactions
- cloudflare/workers-sdk“[autoconfig] Resolve native Vite fallback commands for cf”GitHub · Nov 9, 2026 · 1 reactions
- Themis128/cloudless.gr“build(deps-dev): Bump cf from 1.0.0-beta.26 to 1.0.0-beta.28”GitHub · Nov 9, 2026 · 1 reactions
- cloudflare/workers-sdk“[autoconfig] Support cf workspace application detection”GitHub · Nov 8, 2026 · 1 reactions
- cloudflare/workers-sdk“[wrangler] Support forwarded dev options in cf-wrangler”GitHub · Nov 6, 2026 · 1 reactions
The biggest 5 of 25 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 25
Talked about on GitHub and Bluesky (25 times).
On GitHub · 24
- Sep 23, 2026[autoconfig] prepare cf for the Vite plugin beta — cloudflare/workers-sdk2 reactions · 4 comments
- Nov 9, 2026[autoconfig] Resolve native Vite fallback commands for cf — cloudflare/workers-sdk1 reaction · 4 comments
- Nov 9, 2026build(deps-dev): Bump cf from 1.0.0-beta.26 to 1.0.0-beta.28 — Themis128/cloudless.gr1 reaction · 2 comments
- Nov 8, 2026[autoconfig] Support cf workspace application detection — cloudflare/workers-sdk1 reaction · 4 comments
- Nov 6, 2026[wrangler] Support forwarded dev options in cf-wrangler — cloudflare/workers-sdk1 reaction · 4 comments
19 more on GitHub
- Nov 6, 2026[vite-plugin] Remove the cf-vite delegate — cloudflare/workers-sdk1 reaction · 3 comments
- Nov 1, 2026[runtime-types] Load runtime dependencies on demand — cloudflare/workers-sdk1 reaction · 5 comments
- Nov 1, 2026[deploy-helpers] Expose dedicated workflow entry points — cloudflare/workers-sdk1 reaction · 4 comments
- Oct 30, 2026[workers-auth] Support CLOUDFLARE_AUTH_PROFILE — cloudflare/workers-sdk1 reaction · 5 comments
- Oct 29, 2026[autoconfig] Use Vite+ commands for Vite+ projects — cloudflare/workers-sdk1 reaction · 5 comments
- Oct 20, 2026[workers-auth] Use client-specific temporary-account guidance and structured auth errors — cloudflare/workers-sdk1 reaction · 5 comments
- Oct 19, 2026Bump cf from 1.0.0-beta.16 to 1.0.0-beta.18 — yoiailabs/anone-jump-maker1 reaction · 1 comment
- Oct 13, 2026Add migration guidance for dependencies instrumentation opt outs — cloudflare/workers-sdk1 reaction · 4 comments
- Oct 12, 2026De-centralize CLI specific messaging — cloudflare/workers-sdk1 reaction · 5 comments
- Oct 12, 2026build(deps-dev): Bump cf from 1.0.0-beta.12 to 1.0.0-beta.13 — Themis128/cloudless.gr1 reaction · 4 comments
- Oct 9, 2026cf: init at 1.0.0-beta.13 — NixOS/nixpkgs1 reaction · 4 comments
- Oct 5, 2026Bump cf from 1.0.0-beta.5 to 1.0.0-beta.16 — yoiailabs/anone-jump-maker1 reaction · 2 comments
- Sep 30, 2026Preserve existing secret bindings during Worker deployments — cloudflare/workers-sdk1 reaction · 4 comments
- Sep 29, 2026fix(codemods): upgrade Vite plugin during Wrangler-to-cf migration — cloudflare/workers-sdk1 reaction · 4 comments
- Sep 12, 2026[workers-auth] Update cf OAuth device flow and scopes — cloudflare/workers-sdk1 reaction · 7 comments
- Sep 11, 2026[deploy-helpers] Extract Worker startup profiling from Wrangler — cloudflare/workers-sdk1 reaction · 4 comments
- Sep 9, 2026[autoconfig] Remove Nitro from TanStack Start projects — cloudflare/workers-sdk1 reaction · 4 comments
- Sep 2, 2026[workers-utils] Share named tunnel resolution — cloudflare/workers-sdk1 reaction · 6 comments
- Aug 17, 2026[autoconfig] Add cf configuration target — cloudflare/workers-sdk1 reaction · 8 comments
On Bluesky · 1
- Sep 28, 2026Cloudflareの全APIを網羅したエージェント向けCLIツールらしい API操作を自動化したりデプロイするのに使えそうかも yug1224 starred cloudflare/cf https://github.com/cloudflare/cf — @yug1224.com1 likes and repost
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- packages/cli/AGENTS.mdAGENTS.md
- packages/wrangler-tests/AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Keep this file focused on working rules.
- Distinctive: line 41
Use platform-specific implementations and tests where semantics differ.
- Very specific: line 72
Use one API request path: Use #api with operations imported from #operations/<path>.js.
- Very specific: line 88
Respect runtime ownership: Keep OAuth flows in @cloudflare/workers-auth, with cf supplying adapters.
- Very specific: line 100
Use pnpm 12, Vite+ for tasks/lint/format/test/Pack, and tsrs for type checking.
- Distinctive: line 102
Never use relative imports across package boundaries.
- Very specific: line 105
Keep comments sparse and explain why.
- Very specific: line 107
Keep generated metadata deterministic: use fixed strings such as "build-time", never new Date().
- Very specific: line 110
Keep the hand-written registry import-free plain data.
- Very specific: line 120
Only --force bypasses destructive confirmation.
- Distinctive: line 126
Run from the repository root unless specified:
- Very specific: line 152
Before pushing any code change, run the exact root command pnpm check and require it to pass.
- Very specific: line 160
Commit each logical change as it is made using conventional commits (feat, fix, refactor, chore, docs, test).
- Very specific: line 163
Add a changeset for every user-facing cf change.
- Distinctive: line 171
Keep bug fixes independently releasable rather than batching for a release window.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
cf repo — AGENTS.md
This repository contains the public cf npm CLI and its command generator.
cf is an agent-first CLI for the whole Cloudflare API. Shared Forge code is
installed from a commit-pinned pkg.pr.new build until it is available on npm.
Read as needed
- CLI instructions: command, generator, dotenv,
child-process, and runtime conventions when working in
packages/cli/. - Wrangler test instructions: parity classification and generated test inventory rules.
- Architecture reference: detailed layout, library map, generator behavior, UX, flags, dependency updates, and publishing. Read the relevant sections when changing those areas.
- Design history: product rationale, superseded proposals, distribution estimates, and recorded follow-ups. Consult when revisiting a design; implementation and tests determine current status.
Keep this file focused on working rules. Put detailed reference and historical context in the linked documents.
Repository map
| Area | Location |
| CLI entry, request runtime, generic helpers | packages/cli/src/{index.ts,api/,lib/} |
| Hand-written commands and central registry | packages/cli/src/commands/, especially hand-written.ts |
| Generator plugin and OpenAPI preparation | packages/cli/generator/, packages/cli/generate.ts |
| Tracked generated commands, operations, metadata | packages/cli/src/commands/_generated/ |
| CLI unit and command tests (Vitest + MSW) | packages/cli/src/__tests__/ |
| Imported Wrangler compatibility tests | packages/wrangler-tests/ |
| Project fixtures and usage scenarios | fixtures/, usecases/ |
| Dependency patches and automation | patches/, scripts/, .github/workflows/ |
Cross-platform support
Support Windows, Linux, and macOS in every feature. Account for differences in process spawning, signals and exit codes, shells and argument quoting, filesystem paths and permissions, environment variables, and terminal behavior. Use platform-specific implementations and tests where semantics differ.
Design boundaries
In the rules below, src/ means packages/cli/src/.
- Keep API knowledge upstream. Generic
src/index.tsandsrc/lib/code must remain product-agnostic. API coverage and product-specific behavior belong in Forge overlays or OpenAPI; generic command-emission rules belong inpackages/cli/generator/plugin/. Do not modify the installed Forge package; change the Forge source repository and consume its next build. - Choose the shared boundary first. Capabilities useful to API callers belong at the platform/API layer; reusable CLI affordances belong in Forge annotations. Truly CLI-only local or multi-endpoint workflows may use a bounded hand-written command. Share code only when a real second consumer has matching semantics; keep cf UX and thin adapters local.
- Contain exceptions. Register hand-written commands once in
src/commands/hand-written.ts, keep product wiring in its command directory, and retain drift guards for overridden leaves. Keep universal zone-name resolution incontext.ts/resolve.tsand Worker-name derivation in its existing generator helper. The registry and architecture reference describe the permitted exceptions. Revisit a Forge annotation when runtime-schema lookup reaches four examples; unrelated workflows do not count. - Never hand-edit generated output.
pnpm generateclears and rewrites_generated/. Change Forge/OpenAPI or the plugin, regenerate, and commit the resulting artifacts. Review every changed generated file even when GitHub collapses it. - Preserve lazy startup. Register every root through
lazyCommandand preserve dynamic root imports. Do not eagerly import_generated/index.tsoutside the lazy shell insrc/index.ts. Vite+ Pack emits chunked ESM; do not reintroducetsup. - Use one API request path. Use
#apiwith operations imported from#operations/<path>.js;lib/api-operations.tsholds operations without a generated caller. UserequestApiwhen a typed call cannot express the request, andlib/raw-fetch.tsfor raw responses. Do not add ad-hoc platform API fetches. Derive HTTP verbs from finalizedopInfo.method, never from command names. Keep per-API-code error hints upstream;errors.tsonly supplies status-level hints. - Keep source config access scoped. Normal startup and API commands read
only account/compliance settings from
cloudflare.config.ts. Worker validation belongs tocf workers types, the type generation reused bycf init, and the assets-only[directory]artifact producer shared by Worker upload workflows, which rejects server-side entrypoints and Containers. Other project workflows consume Build Output throughreadBuildOutput()from@cloudflare/build-output-utils; do not compose output paths by hand. Invalid Worker bindings must not break unrelated API commands. cf supports ES module Workers only, not service-worker format. - Respect runtime ownership. Keep OAuth flows in
@cloudflare/workers-auth, with cf supplying adapters. Dev/build delegate to project tooling. Local mode owns a Miniflare instance over persisted state. Never use Miniflare'sgetWorkerRegistryfor read-only discovery: it deletes entries older than five minutes; use a read-only walk. - Preserve delegation compatibility. Global cf can re-exec a locally pinned cf. Do not assume there is only one cf process; keep auth, cache, and CLI state cross-version compatible, with migrations for schema changes. Be deliberate about heavy dependencies and preserve lazy loading.
Implementation conventions
- Use pnpm 12, Vite+ for tasks/lint/format/test/Pack, and
tsrsfor type checking. Do not reintroducetscfor this repository's type checks. - Never use relative imports across package boundaries. For cross-directory
Git operations, set the command's working directory rather than using
git -C. - Keep comments sparse and explain why. Never add JSDoc
@paramor@returnstags beside typed signatures. - Keep generated metadata deterministic: use fixed strings such as
"build-time", nevernew Date(). Format generated TS after generation with Vite+; do not restoreformatTypeScript()/ Biome WASM inside Forge. - Keep the hand-written registry import-free plain data; root lazy loaders
and telemetry belong in
root-commands.ts. Keep each command'smeta.tssidecar and the typedhand-written-meta.tslist in sync. - Let strict yargs own unknown-option validation. Keep emitter options and
metadata synchronized. Reserve a new cross-cutting flag in
src/lib/global-options.tsbefore introducing it; generation fails on any API field that would take a flag cf owns. - stdout carries command output (JSON for structured results, raw payloads
for raw endpoints). Prompts, progress, notices, warnings, and success lines
go to stderr. Reuse
lib/ui/theme.ts,lib/ui/log.ts, andprintSuccess. - Only
--forcebypasses destructive confirmation;--quietnever confirms an action or hides warnings, fixes, or prompts. Derive secret handling from explicit sensitivity metadata, never flag-name heuristics.
Commands and verification
Run from the repository root unless specified:
pnpm install # install pinned dependencies
pnpm generate # pinned OpenAPI + Forge plugin → tracked commands
pnpm build # generation + Vite+ Pack → dist/
pnpm dev # source entry; no generation or bundling
pnpm check # generation + builds + workspace type checks + lint/format
pnpm check:lint # type-aware lint
pnpm check:type # workspace type checks with prerequisites
pnpm check:format # formatting check
pnpm fix # lint fixes + format
pnpm --filter cf test
pnpm --filter @cloudflare/wrangler-tests testBuild, type-check, and test tasks declare prerequisites in package
vite.config.ts files; package-scoped commands prepare what they need. Use
shared task:build / task:check:type names for new workspace tasks, direct
task references in dependsOn, and dependency selectors for dependency builds.
For a focused CLI test, run pnpm test src/__tests__/lib/local-e2e.test.ts
from packages/cli/. Pass the path directly: inserting -- runs the full
suite. Real-account smoke tests under packages/cli/e2e/ are out-of-band;
see the architecture reference for invocation.
Before pushing any code change, run the exact root command pnpm check and
require it to pass. Narrower checks and builds do not replace it. If it cannot
start or finish because of the environment or dependencies, report the blocker
and which checks did run before pushing. After fixing a check failure, rerun
the complete root command.
Commits and changesets
Commit each logical change as it is made using conventional commits
(feat, fix, refactor, chore, docs, test). Do not push unless asked.
Add a changeset for every user-facing cf change. Use pnpm changeset or
write .changeset/<name>.md with "cf": <patch|minor> frontmatter, an
imperative title, and a short body. Fixes use patch; features, new
commands/flags, and pre-1.0 behavior changes use minor. Purely internal
refactors, tests, docs, and CI changes need none. See
the changeset rules.
Prereleases use pkg.pr.new; versioned beta/stable releases use Changesets. Keep bug fixes independently releasable rather than batching for a release window. See publishing details.
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.

