- Notifications
You must be signed in to change notification settings - Fork928
Closed
Description
ENV vars to set defaults forcoder login
are ignored.
Note the email, password, and username provided via ENV vars show up in--help
ii@prerepair:~/sharingio/coder$ coder login -hAuthenticate with Coder deploymentUsage: coder login <url> [flags]Flags: -e, --email string Specifies an email address to authenticate with. Consumes $CODER_EMAIL (default "hh@ii.coop") -h, --help help for login -p, --password string Specifies a password to authenticate with. Consumes $CODER_PASSWORD (default "ii") -u, --username string Specifies a username to authenticate with. Consumes $CODER_USERNAME (default "ii")
If the '-u' option is not provided (and it's currently not defaulting toCODER_USERNAME
, tty detection is enabled and calling coder login without arguments fails.
Ideally setting these ENV vars would allow us to runcoder login
and respect the ENV provided defaults. I'm also recommend removing theisTTY
altogether.
https://github.com/coder/coder/blob/main/cli/login.go#L91-L94
if username == "" { if !isTTY(cmd) { return xerrors.New("the initial user cannot be created in non-interactive mode. use the API") }
Metadata
Metadata
Assignees
Labels
No labels