Skip to content

Display environment context in error messages like 'Try logging in using coder login <url>' #44

@cdr-robot

Description

@cdr-robot

Currently, when users encounter authentication errors in Coder CLI, they see generic error messages like:

You are signed out or your session has expired. Please sign in again to continue.
Try logging in using 'coder login <url>'.

These messages are hardcoded and don't respect environment variables like $CODER_URL and $CODER_SSH_CONFIG_BINARY_PATH that might be set in an organizational setting.

Requested Change:
Update the CLI to respect these environment variables when displaying error messages, so users receive specific, actionable instructions like:

You are signed out or your session has expired. Please sign in again to continue.
Try logging in using '/home/user/path/to/coder login https://specific.coder.instance'.

This would make the user experience better since they could simply copy-paste the exact command rather than having to determine the correct URL or command path.

Original issue: coder/coder#11505

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions