diff --git a/login.go b/login.go index 8a06dd095f..7855efe59c 100644 --- a/login.go +++ b/login.go @@ -149,3 +149,13 @@ func createOauthToken(email, password, secondFactor string) (string, error) { } return doc.AccessToken.Token, nil } + +var authTokenCmd = &Command{ + Topic: "auth", + Command: "token", + Description: "Display your API token.", + NeedsAuth: true, + Run: func(ctx *Context) { + Println(ctx.APIToken) + }, +} diff --git a/main.go b/main.go index e2f4055717..0cc084d66a 100644 --- a/main.go +++ b/main.go @@ -46,6 +46,7 @@ func init() { } cli.Commands = CommandSet{ authLoginCmd, + authTokenCmd, commandsListCmd, debugErrlogCmd, loginCmd,