Skip to content

cli: --dry-run ignores --local, prints remote api.cloudflare.com URL and misses unsupported-local errors #717

Open

Description

@MattieTK

Summary

Passing --local together with --dry-run ignores --local. --dry-run always prints the remote https://api.cloudflare.com/client/v4/... URL with no indication that the command will run locally, and succeeds even for commands that reject --local at runtime (such as cf d1 query or cf queues list).

Because --dry-run is the documented way for users and agents to preview what a command will do before running it, showing a remote api.cloudflare.com URL makes --local look ignored or unsupported.

Expected behaviour

When --local and --dry-run are combined:

  1. Commands that support local execution should indicate local targeting and state path in the --dry-run JSON instead of printing a remote api.cloudflare.com URL:
{
  "command": "cf workflows list",
  "local": true,
  "persistTo": ".cloudflare/state",
  "method": "GET",
  "path": "/workflows",
  "pathParams": {},
  "query": {},
  "bodyKind": "none"
}
  1. Commands that have no local equivalent should fail during --dry-run with the same error they produce without --dry-run:
┌ Error
│ This command has no local equivalent. Re-run without --local to use the Cloudflare API.
└

Reproduction

  1. Locally supported command:
cf workflows list --local --dry-run

Actual output (prints the remote API URL even though cf workflows list --local --persist-to <dir> executes locally):

{
  "command": "cf workflows list",
  "method": "GET",
  "url": "https://api.cloudflare.com/client/v4/accounts/<account-id>/workflows",
  "pathParams": {},
  "query": {},
  "bodyKind": "none"
}
  1. Command without local support:
cf d1 query 00000000-0000-0000-0000-000000000000 --sql "SELECT 1" --local --dry-run

Actual output: exits 0 and prints POST https://api.cloudflare.com/client/v4/accounts/<account-id>/d1/database/.../query, whereas running the same command without --dry-run fails with:

┌ APIError
│ [error] This command has no local equivalent. Re-run without --local to use the Cloudflare API. The local explorer API does not implement POST /d1/database/00000000-0000-0000-0000-000000000000/query.
│ 404 Not Found
└

Environment

  • cf: 1.0.0-rc.2
  • Node.js: 24.22.3
  • OS: macOS 26.7.3 (arm64)

Activity

  1. added
    bug
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions