Download internal/cmd/antigravity_login.go from shimen/ShinAPI: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/shimen/ShinAPI/resolve/main/internal/cmd/antigravity_login.go
- Command line
-
hf download hf://spaces/shimen/ShinAPI/internal/cmd/antigravity_login.go
-
curl -L -o antigravity_login.go https://huggingface.co/spaces/shimen/ShinAPI/resolve/main/internal/cmd/antigravity_login.go
1.12 kB
| package cmd | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/router-for-me/CLIProxyAPI/v6/internal/config" | |
| sdkAuth "github.com/router-for-me/CLIProxyAPI/v6/sdk/auth" | |
| log "github.com/sirupsen/logrus" | |
| ) | |
| // DoAntigravityLogin triggers the OAuth flow for the antigravity provider and saves tokens. | |
| func DoAntigravityLogin(cfg *config.Config, options *LoginOptions) { | |
| if options == nil { | |
| options = &LoginOptions{} | |
| } | |
| promptFn := options.Prompt | |
| if promptFn == nil { | |
| promptFn = defaultProjectPrompt() | |
| } | |
| manager := newAuthManager() | |
| authOpts := &sdkAuth.LoginOptions{ | |
| NoBrowser: options.NoBrowser, | |
| CallbackPort: options.CallbackPort, | |
| Metadata: map[string]string{}, | |
| Prompt: promptFn, | |
| } | |
| record, savedPath, err := manager.Login(context.Background(), "antigravity", cfg, authOpts) | |
| if err != nil { | |
| log.Errorf("Antigravity authentication failed: %v", err) | |
| return | |
| } | |
| if savedPath != "" { | |
| fmt.Printf("Authentication saved to %s\n", savedPath) | |
| } | |
| if record != nil && record.Label != "" { | |
| fmt.Printf("Authenticated as %s\n", record.Label) | |
| } | |
| fmt.Println("Antigravity authentication successful!") | |
| } | |