Skip to content

Allow commands to resolve resources by binding name #38

Open

Description

@petebacondarwin

Problem

Some project-aware commands require a resource ID even when the resource is already identified by a binding in project configuration.

For example, a local D1 migration can be easier to invoke using the configured binding name than by looking up and copying the database ID.

Expected behavior

Where the resource type and command are unambiguous, accept a configured binding name and resolve it to the correct resource identity.

Acceptance criteria

  • Binding-name resolution uses the active project configuration and mode.
  • Ambiguous or missing bindings produce actionable errors.
  • Explicit resource IDs continue to work.
  • Help and structured metadata explain the accepted identifier forms.

Activity

  1. added
    enhancement
    priority: p2
    on Sep 29, 2026
  2. joeblew999 commented on Sep 30, 2026

    @joeblew999

    A closely related case, from deleting 40 test resources with cf 1.0.0-beta.5: most commands also take only IDs where the resource has a unique name the user knows. Every wrapper then starts with a list-and-filter step (and has to pass --per-page 100, see #20):

    To act on You have You need Lookup today
    D1 database its name UUID cf d1 list --name <n> --per-page 100 → .uuid
    KV namespace its title id cf kv namespaces list --per-page 100 → .title match
    Worker its name id (workers delete) cf workers list --per-page 100 → .name match
    Queue its name id cf queues list → .queue_name match

    Accepting a unique resource name wherever an ID is accepted (with the same "ambiguous or missing" errors as the binding-name proposal) would remove that step. Details: https://github.com/joeblew999/cf-cli-test (scripts/cleanup.mjs shows the lookups).

  3. lnv-louis commented on Oct 3, 2026

    @lnv-louis

    I second this.

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

    enhancementpriority: p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions