MCPcopy Create free account
hub / github.com/compozy/agh / newProviderAuthLoginCommand

Function newProviderAuthLoginCommand

internal/cli/provider.go:140–160  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

138}
139
140func newProviderAuthLoginCommand(deps commandDeps) *cobra.Command {
141 var printCommand bool
142 var noTTY bool
143 var timeout time.Duration
144 options := func() providerAuthLoginOptions {
145 return providerAuthLoginOptions{printCommand: printCommand, noTTY: noTTY, timeout: timeout}
146 }
147 cmd := &cobra.Command{
148 Use: "login <provider>",
149 Short: "Run the provider native login command locally",
150 Args: exactOneNonBlankArg(),
151 RunE: func(cmd *cobra.Command, args []string) error {
152 return runProviderAuthLoginCommand(cmd, deps, args[0], options())
153 },
154 }
155 cmd.Flags().
156 BoolVar(&printCommand, "print-command", false, "Print only the resolved provider login command")
157 cmd.Flags().BoolVar(&noTTY, "no-tty", false, "Disable TTY attachment for the login command")
158 cmd.Flags().DurationVar(&timeout, "timeout", 0, "Optional login command timeout")
159 return cmd
160}
161
162type providerAuthLoginOptions struct {
163 printCommand bool

Callers 1

newProviderAuthCommandFunction · 0.85

Calls 3

exactOneNonBlankArgFunction · 0.85
optionsStruct · 0.85

Tested by

no test coverage detected