MCPcopy Create free account
hub / github.com/algolia/cli / runGetCmd

Function runGetCmd

pkg/cmd/auth/get/get.go:69–92  ·  view source on GitHub ↗
(opts *GetOptions)

Source from the content-addressed store, hash-verified

67}
68
69func runGetCmd(opts *GetOptions) error {
70 client := opts.NewDashboardClient(auth.OAuthClientID())
71 if _, err := opts.EnsureAuthenticated(opts.IO, client); err != nil {
72 return err
73 }
74
75 stored := opts.LoadToken()
76
77 identity := Identity{
78 UserID: stored.UserID,
79 Email: stored.Email,
80 Name: stored.Name,
81 }
82 if opts.WithAccessToken {
83 identity.Token = stored.AccessToken
84 }
85
86 p, err := opts.PrintFlags.ToPrinter()
87 if err != nil {
88 return err
89 }
90
91 return p.Print(opts.IO, identity)
92}

Callers 2

cmdWithOptsFunction · 0.70
NewGetCmdFunction · 0.70

Calls 3

OAuthClientIDFunction · 0.92
PrintMethod · 0.65
ToPrinterMethod · 0.45

Tested by 1

cmdWithOptsFunction · 0.56