MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / openbrowser

Function openbrowser

app/cli/cmd/auth_login.go:168–187  ·  view source on GitHub ↗
(url string)

Source from the content-addressed store, hash-verified

166}
167
168func openbrowser(url string) error {
169 var cmd *exec.Cmd
170
171 switch runtime.GOOS {
172 case "linux":
173 cmd = exec.Command("xdg-open", url)
174 case "windows":
175 cmd = exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
176 case "darwin":
177 cmd = exec.Command("open", url)
178 default:
179 return fmt.Errorf("unsupported platform")
180 }
181
182 if err := cmd.Start(); err != nil {
183 return err
184 }
185
186 return cmd.Wait()
187}
188
189// isRemoteSession returns true if the CLI is running inside an SSH session
190// where a local browser callback would not be reachable.

Callers 1

interactiveAuthFunction · 0.85

Calls 1

StartMethod · 0.45

Tested by

no test coverage detected