diff --git a/pkg/cmd/config/get/get.go b/pkg/cmd/config/get/get.go index 94694adb2..f391decc4 100644 --- a/pkg/cmd/config/get/get.go +++ b/pkg/cmd/config/get/get.go @@ -1,6 +1,7 @@ package get import ( + "errors" "fmt" "github.com/MakeNowJust/heredoc" @@ -53,6 +54,16 @@ func NewCmdConfigGet(f *cmdutil.Factory, runF func(*GetOptions) error) *cobra.Co } func getRun(opts *GetOptions) error { + // search keyring storage when fetching the `oauth_token` value + if opts.Hostname != "" && opts.Key == "oauth_token" { + token, _ := opts.Config.Authentication().Token(opts.Hostname) + if token == "" { + return errors.New(`could not find key "oauth_token"`) + } + fmt.Fprintf(opts.IO.Out, "%s\n", token) + return nil + } + val, err := opts.Config.GetOrDefault(opts.Hostname, opts.Key) if err != nil { return err