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.
Index ¶
- func DoClaudeLogin(cfg *config.Config, options *LoginOptions)
- func DoCodexLogin(cfg *config.Config, options *LoginOptions)
- func DoIFlowLogin(cfg *config.Config, options *LoginOptions)
- func DoLogin(cfg *config.Config, projectID string, options *LoginOptions)
- func DoQwenLogin(cfg *config.Config, options *LoginOptions)
- func StartService(cfg *config.Config, configPath string, localPassword string)
- func WaitForCloudDeploy()
- type LoginOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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 DoIFlowLogin ¶ added in v6.1.0
func DoIFlowLogin(cfg *config.Config, options *LoginOptions)
DoIFlowLogin performs the iFlow OAuth login via the shared authentication manager.
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 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
func WaitForCloudDeploy ¶ added in v6.2.1
func WaitForCloudDeploy()
WaitForCloudDeploy waits indefinitely for shutdown signals in cloud deploy mode when no configuration file is available.
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.