agentleFS
thisromanHQthisromanHQ/agent-skills/skills/cloudflare-cli/SKILL.md

cloudflare-cli

Skill2 starsChanged 4 months agoMITView on GitHub

Use when operating Cloudflare through the technical-preview `cf` CLI, including authentication, account or zone context, API resources, local resources, command discovery, and JSON output.

  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. genlayerlabs/genlayer-studio★ 180same name
    2. Firzus/agent-skills★ 4same 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 repository7 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

27 rules. About 0 are common, 6 are distinctive, and 21 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 21

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when the user explicitly requests the cf command or wants to manage Cloudflare resources with Cloudflare's unified CLI.

    line 13
  2. Very specific:

    Use cf for Cloudflare-wide API resource management, authentication profiles, account and zone context, local resource access, and tasks …

    line 19
  3. Very specific:

    Use Wrangler guidance when the user explicitly requests wrangler or needs its established Workers development and configuration workflows.

    line 20
  4. Very specific:

    Do not silently translate between cf and wrangler.

    line 21
  5. Very specific:

    Do not confuse Cloudflare's cf with the Cloud Foundry CLI, which uses the same executable name.

    line 22
  6. Very specific:

    Never print, log, or expose CLOUDFLARE_API_TOKEN, OAuth credentials, token values, or other secrets.

    line 26
  7. Very specific:

    Do not inspect environment variable values.

    line 27
  8. Distinctive:

    Prefer read-only discovery before making changes.

    line 28
  9. Very specific:

    Before a write, retrieve the exact command help and schema.

    line 29
  10. Distinctive:

    Ask for confirmation before destructive, irreversible, security-sensitive, billing-related, token-management, or production-impacting …

    line 30
  11. Distinctive:

    Prefer least-privilege API tokens and the intended named profile.

    line 31
  12. Very specific:

    Verify account and zone context before writes.

    line 32
  13. Very specific:

    After a write, verify the result with an appropriate read-only get, list, or status command.

    line 33
  14. Very specific:

    Run cf --version. The npm package requires Node.js 22 or newer.

    line 37
  15. Very specific:

    If cf is unavailable, ask before installing it.

    line 38
  16. Very specific:

    Run cf --help because top-level commands and global flags may have changed.

    line 39
  17. Very specific:

    Check authentication with cf auth whoami.

    line 40
  18. Distinctive:

    Use these sources in order:

    line 45
  19. Very specific:

    Run cf agent-context --list if the product name is uncertain.

    line 58
  20. Very specific:

    Run cf agent-context <product> and select the exact command path from its output.

    line 59
  21. Very specific:

    Run cf <command-path> --help before supplying flags.

    line 60
  22. Distinctive:

    Run read-only discovery needed to obtain exact resource IDs rather than guessing.

    line 63
  23. Very specific:

    Do not treat examples from another product as proof that a flag is accepted.

    line 74
  24. Very specific:

    Use --profile <name> when the user identifies a profile explicitly.

    line 89
  25. Distinctive:

    Do not display stored configuration files or credential material to diagnose authentication.

    line 91
  26. Very specific:

    Prefer an explicit --zone <zone-id-or-domain> for a one-off command instead of changing persistent context.

    line 112
  27. Very specific:

    Use --quiet only when suppressed context and status information is safe for the task.

    line 120

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cloudflare CLI

Use this skill when the user explicitly requests the cf command or wants to manage Cloudflare resources with Cloudflare's unified CLI.

cf is a technical preview and its command surface changes quickly. Retrieve syntax from the installed CLI before composing commands. Do not rely on a memorized command catalog.

Scope

  • Use cf for Cloudflare-wide API resource management, authentication profiles, account and zone context, local resource access, and tasks that explicitly name the cf CLI.
  • Use Wrangler guidance when the user explicitly requests wrangler or needs its established Workers development and configuration workflows.
  • Do not silently translate between cf and wrangler; their command names and behavior can differ.
  • Do not confuse Cloudflare's cf with the Cloud Foundry CLI, which uses the same executable name.

Safety

  • Never print, log, or expose CLOUDFLARE_API_TOKEN, OAuth credentials, token values, or other secrets.
  • Do not inspect environment variable values. Check authentication with cf auth whoami and report sanitized errors.
  • Prefer read-only discovery before making changes.
  • Before a write, retrieve the exact command help and schema. Use --dry-run first when the command supports it.
  • Ask for confirmation before destructive, irreversible, security-sensitive, billing-related, token-management, or production-impacting commands unless the user already explicitly requested that exact action.
  • Prefer least-privilege API tokens and the intended named profile. Never create, rotate, or delete credentials as an incidental setup step.
  • Verify account and zone context before writes. Keep --quiet disabled when context resolution matters.
  • After a write, verify the result with an appropriate read-only get, list, or status command.

Setup

  1. Run cf --version. The npm package requires Node.js 22 or newer.
  2. If cf is unavailable, ask before installing it. Upstream supports npm install -g cf; npx cf can run the preview without a global install.
  3. Run cf --help because top-level commands and global flags may have changed.
  4. Check authentication with cf auth whoami. If authentication is missing, use cf auth login for OAuth or ask the user to configure CLOUDFLARE_API_TOKEN without revealing its value.
  5. Inspect active defaults with cf context show before account- or zone-scoped work.

Source Of Truth

Use these sources in order:

  1. cf agent-context --list to discover current product names.
  2. cf agent-context <product> for the product's current command inventory and operational notes.
  3. cf <command-path> --help for exact arguments, options, defaults, and enum values.
  4. cf schema <command-path> for API path, request fields, and parameter requirements.
  5. Cloudflare's API and product documentation at https://developers.cloudflare.com/ for product semantics, permissions, limits, and behavior not explained by the CLI.

The npm package also bundles generated command and schema metadata, but use the public introspection commands instead of reading package internals. The announcement blog post explains preview status and design intent; it is not a command reference.

Discovery Workflow

  1. Identify the Cloudflare product and whether the operation is local or remote.
  2. Run cf agent-context --list if the product name is uncertain.
  3. Run cf agent-context <product> and select the exact command path from its output.
  4. Run cf <command-path> --help before supplying flags.
  5. For request bodies or ambiguous fields, run cf schema <command-path>.
  6. Resolve the intended profile, account, and zone.
  7. Run read-only discovery needed to obtain exact resource IDs rather than guessing.
  8. For writes, dry-run when supported, execute the approved command, then verify with a read-only command.

Example discovery sequence:

cf agent-context dns
cf dns records create --help
cf schema dns records create

Do not treat examples from another product as proof that a flag is accepted. Confirm every final command with its own --help output.

Authentication And Profiles

Credential resolution prefers CLOUDFLARE_API_TOKEN, then the OAuth profile selected by --profile, a directory profile binding, or the default profile.

cf auth whoami
cf auth list
cf auth login
cf auth create work
cf auth activate work
cf auth deactivate
  • Use --profile <name> when the user identifies a profile explicitly.
  • cf auth activate <name> [dir] binds a profile to a directory; this changes local configuration, so do it only when requested.
  • Do not display stored configuration files or credential material to diagnose authentication.

Account And Zone Context

Inspect context with:

cf context show

Account resolution prioritizes CLOUDFLARE_ACCOUNT_ID, project .cfrc, user configuration, then interactive or single-account selection. Zone resolution prioritizes --zone, CLOUDFLARE_ZONE_ID, project .cfrc, then user configuration.

Set persistent defaults only when requested:

cf context set account-id <account-id>
cf context set zone example.com --project
cf context clear zone --project
  • --project writes to the project's .cfrc; without it, context is stored in user configuration.
  • Prefer an explicit --zone <zone-id-or-domain> for a one-off command instead of changing persistent context.
  • Re-run cf context show after changing defaults.

Output And Errors

  • Resource command output is JSON on stdout. Parse it directly or use jq for filtering.
  • Status messages and errors are written to stderr.
  • A non-zero exit status indicates failure; do not infer success from partial output.
  • Use --quiet only when suppressed context and status information is safe for the task.
  • On HTTP 401 errors, check cf auth whoami, profile selection, and required token permissions without exposing credentials.

Local Resources

--local routes supported commands to the Local Explorer API exposed by a running wrangler dev or cf dev Miniflare session.

cf <command-path> --local --local-endpoint http://localhost:8787
  • Confirm support using the command's current help and product context.
  • Supply --local-endpoint when required by the installed version; do not assume auto-discovery is available.
  • Make the local-versus-remote target explicit before every write. Never remove --local or substitute a remote operation silently.

Troubleshooting

  • Unknown command: refresh with cf --help, cf agent-context --list, and the relevant product context.
  • Unknown option: use the exact command's --help; preview flags may have changed.
  • Missing request field: inspect cf schema <command-path> and use --body '<json>' when the command supports a complex raw JSON body.
  • Wrong account or zone: run cf context show and inspect explicit profile or zone overrides.
  • Local connection failure: confirm the development server is running and verify --local-endpoint.
  • Product behavior or permission uncertainty: consult the corresponding Cloudflare developer and API documentation before executing.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.