Skip to content

fix(auth): stop advertising --profile on list and logout #687

Open

Description

@coygeek

Summary of the issue

The help for cf auth list and cf auth logout advertises --profile even though both commands reject that option. A user following either help screen gets a usage error.

Expected behaviour

Both help screens should omit --profile or state explicitly that those commands reject it. cf auth list enumerates all profiles, and cf auth logout manages the default profile. Named-profile removal uses cf auth delete <name>.

Version of cf used

1.0.0-rc.1

System information and package versions

macOS 27.2 (arm64) with Node 26.13.1 and npm 12.2.2. I used an isolated installation and an empty temporary home and config directory. I also inspected the current main source without running a build from it.

Reproduction

Use the published CLI in a clean shell with no Cloudflare credentials and an isolated empty home and config directory. example is a placeholder and does not need to be an existing profile.

cf auth list --help
cf auth logout --help
cf auth list --profile example
cf auth logout --profile example

Relevant error logs

Both help commands exit 0 and show the following global flag on stdout.

--profile     Use a specific auth profile                         [string]

Both invocations with --profile example exit 1. The errors on stderr contain these messages, shown here without terminal decoration or wrapping.

The --profile flag cannot be used with `cf auth list`.
The --profile flag cannot be used with `cf auth logout`. Run `cf auth delete <name>` to remove a named profile.

As a control, cf auth list without the option exited 0 and returned [] in the empty environment.

Evidence

  • Expected source: The CLI authentication documentation describes default-profile logout and distinct named-profile management. Each command's own help is the usage contract being contradicted.
  • Failure source: The four observed exit statuses and output excerpts above. The current source still declares the global flag and explicitly rejects it in both handlers. See packages/cli/src/commands/auth/profiles.ts at listCommand and packages/cli/src/commands/auth/logout.ts at logoutCommand.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Restoration check

Run both --help commands and verify that neither presents --profile as accepted. Run both commands with --profile example and verify they still reject the unsupported option. cf auth list without the option should continue to succeed.

Triage assessment

  • Impact level: P3
  • Assessment status: supported
  • Impact basis: Both help screens present a misleading usage option. The CLI rejects it before performing the auth operation.
  • Workaround status: available
  • Workaround basis: Omit the option when listing profiles or logging out of the default profile. The logout error and authentication guide point to the named-profile command when that is the intended operation.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions