Documentation
¶
Overview ¶
Package cmd provides command-line interface functionality for the CLI Proxy API server. It includes authentication flows for various AI service providers, service startup, and other command-line operations.
Package cmd provides command-line interface functionality for the CLI Proxy API server. It includes authentication flows for various AI service providers, service startup, and other command-line operations.
Package cmd contains CLI helpers. This file implements importing a Vertex AI service account JSON into the auth store as a dedicated "vertex" credential.
Index ¶
- func DoAntigravityLogin(cfg *config.Config, options *LoginOptions)
- func DoClaudeLogin(cfg *config.Config, options *LoginOptions)
- func DoClineLogin(cfg *config.Config, options *LoginOptions)
- func DoCodexLogin(cfg *config.Config, options *LoginOptions)
- func DoCopilotLogin(cfg *config.Config, options *LoginOptions)
- func DoIFlowCookieAuth(cfg *config.Config, options *LoginOptions)
- func DoIFlowLogin(cfg *config.Config, options *LoginOptions)
- func DoKiroLogin(cfg *config.Config, options *LoginOptions)
- func DoLogin(cfg *config.Config, projectID string, options *LoginOptions)
- func DoQwenLogin(cfg *config.Config, options *LoginOptions)
- func DoVertexImport(cfg *config.Config, keyPath string)
- func StartService(cfg *config.Config, configPath string, localPassword string)
- type LoginOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoAntigravityLogin ¶
func DoAntigravityLogin(cfg *config.Config, options *LoginOptions)
DoAntigravityLogin triggers the OAuth flow for the antigravity provider and saves tokens.
func DoClaudeLogin ¶
func DoClaudeLogin(cfg *config.Config, options *LoginOptions)
DoClaudeLogin triggers the Claude OAuth flow through the shared authentication manager. It initiates the OAuth authentication process for Anthropic Claude services and saves the authentication tokens to the configured auth directory. Parameters:
- cfg: The application configuration
- options: Login options including browser behavior and prompts
func DoClineLogin ¶
func DoClineLogin(cfg *config.Config, options *LoginOptions)
DoClineLogin handles the Cline authentication flow using the shared authentication manager. It prompts the user for a refresh token (exported from VSCode), exchanges it for access tokens, and saves the authentication credentials to the configured auth directory. Parameters:
- cfg: The application configuration
- options: Login options including browser behavior and prompts
func DoCodexLogin ¶
func DoCodexLogin(cfg *config.Config, options *LoginOptions)
DoCodexLogin triggers the Codex OAuth flow through the shared authentication manager. It initiates the OAuth authentication process for OpenAI Codex services and saves the authentication tokens to the configured auth directory. Parameters:
- cfg: The application configuration
- options: Login options including browser behavior and prompts
func DoCopilotLogin ¶
func DoCopilotLogin(cfg *config.Config, options *LoginOptions)
DoCopilotLogin performs the GitHub Copilot OAuth device flow login.
func DoIFlowCookieAuth ¶
func DoIFlowCookieAuth(cfg *config.Config, options *LoginOptions)
DoIFlowCookieAuth performs the iFlow cookie-based authentication.
func DoIFlowLogin ¶
func DoIFlowLogin(cfg *config.Config, options *LoginOptions)
DoIFlowLogin performs the iFlow OAuth login via the shared authentication manager.
func DoKiroLogin ¶
func DoKiroLogin(cfg *config.Config, options *LoginOptions)
DoKiroLogin triggers the Kiro authentication flow through the shared authentication manager. It initiates the authentication process for Amazon Q/CodeWhisperer services and saves the authentication tokens to the configured auth directory. Parameters:
- cfg: The application configuration
- options: Login options including browser behavior and prompts
func DoLogin ¶
func DoLogin(cfg *config.Config, projectID string, options *LoginOptions)
DoLogin handles Google Gemini authentication using the shared authentication manager. It initiates the OAuth flow for Google Gemini services, performs the legacy CLI user setup, and saves the authentication tokens to the configured auth directory. Parameters:
- cfg: The application configuration
- projectID: Optional Google Cloud project ID for Gemini services
- options: Login options including browser behavior and prompts
func DoQwenLogin ¶
func DoQwenLogin(cfg *config.Config, options *LoginOptions)
DoQwenLogin handles the Qwen device flow using the shared authentication manager. It initiates the device-based authentication process for Qwen services and saves the authentication tokens to the configured auth directory. Parameters:
- cfg: The application configuration
- options: Login options including browser behavior and prompts
func DoVertexImport ¶
DoVertexImport imports a Google Cloud service account key JSON and persists it as a "vertex" provider credential. The file content is embedded in the auth file to allow portable deployment across stores.
func StartService ¶
StartService builds and runs the proxy service using the exported SDK. It creates a new proxy service instance, sets up signal handling for graceful shutdown, and starts the service with the provided configuration. Parameters:
- cfg: The application configuration
- configPath: The path to the configuration file
- localPassword: Optional password accepted for local management requests
Types ¶
type LoginOptions ¶
type LoginOptions struct {
// NoBrowser indicates whether to skip opening the browser automatically.
NoBrowser bool
// Prompt allows the caller to provide interactive input when needed.
Prompt func(prompt string) (string, error)
}
LoginOptions contains options for the login processes. It provides configuration for authentication flows including browser behavior and interactive prompting capabilities.