Skip to content

bug: CLI displays incorrect profile name when using --profile option #2542

@hongkongkiwi

Description

@hongkongkiwi

Bug Description

When using the --profile option with CLI commands, the displayed profile name in the command output doesn't match the profile actually being used. Instead, it shows "default" or the first configured profile, even though the correct profile is being used for authentication.

Steps to Reproduce

  1. Have multiple profiles configured in the CLI
  2. Run trigger.dev whoami --profile myprofile
  3. Observe that the output shows [default] or another profile name instead of myprofile

Expected Behavior

The CLI should display the actual profile name being used when the --profile option is specified. If --profile myprofile is used, all output should show [myprofile].

Actual Behavior

  • The intro message shows: Displaying your account details [default]
  • The final output shows a different profile name
  • Error messages reference incorrect profile names

This creates confusion as users can't verify if their specified profile is actually being used.

Example

$ trigger.dev whoami --profile staging
Displaying your account details [default]  # Wrong - should show [staging]
...
Account details [personal]  # Wrong - should show [staging]

Environment

  • Package: packages/cli-v3
  • Command affected: whoami (and potentially others)

Solution

PR #2541 fixes this issue by:

  • Properly resolving the profile name at the start of command execution
  • Using the resolved profile consistently throughout all messages
  • Ensuring the displayed profile matches what's actually being used

Related PR

This issue is fixed by PR #2541

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