Skip to content

Commit 0de8bd4

Browse files
committed
refactor: update Coder CLI's whoami command to use client URL instead of deployment config
1 parent 6f5e101 commit 0de8bd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/whoami.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ func (r *RootCmd) whoami() *serpent.Command {
2424
// Fetch the user info
2525
resp, err := client.User(ctx, codersdk.Me)
2626
// Get Coder instance url
27-
deployConfig, _ := client.DeploymentConfig(ctx)
27+
clientURL := client.URL
2828

2929
if err != nil {
3030
return err
3131
}
3232

33-
_, _ = fmt.Fprintf(inv.Stdout, Caret+"Coder is running at %s, You're authenticated as %s !\n", pretty.Sprint(cliui.DefaultStyles.Keyword, deployConfig.Values.AccessURL.Scheme+"://"+deployConfig.Values.AccessURL.Host), pretty.Sprint(cliui.DefaultStyles.Keyword, resp.Username))
33+
_, _ = fmt.Fprintf(inv.Stdout, Caret+"Coder is running at %s, You're authenticated as %s !\n", pretty.Sprint(cliui.DefaultStyles.Keyword, clientURL), pretty.Sprint(cliui.DefaultStyles.Keyword, resp.Username))
3434
return err
3535
},
3636
}

0 commit comments

Comments
 (0)