MCPcopy Create free account
hub / github.com/basecamp/hey-cli / newAuthRefreshCommand

Function newAuthRefreshCommand

internal/cmd/auth.go:230–246  ·  view source on GitHub ↗

refresh subcommand

()

Source from the content-addressed store, hash-verified

228// refresh subcommand
229
230func newAuthRefreshCommand() *cobra.Command {
231 return &cobra.Command{
232 Use: "refresh",
233 Short: "Force token refresh",
234 RunE: func(cmd *cobra.Command, args []string) error {
235 ctx := context.Background()
236 if err := authMgr.Refresh(ctx); err != nil {
237 return output.ErrAuth(fmt.Sprintf("refresh failed: %v", err))
238 }
239 if writer.IsStyled() {
240 fmt.Fprintln(cmd.OutOrStdout(), "Token refreshed.")
241 return nil
242 }
243 return writeOK(nil, output.WithSummary("Token refreshed"))
244 },
245 }
246}
247
248// token subcommand
249

Callers 1

newAuthCommandFunction · 0.85

Calls 4

WithSummaryFunction · 0.92
writeOKFunction · 0.85
RefreshMethod · 0.80
IsStyledMethod · 0.80

Tested by

no test coverage detected