cmd

package
v6.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 25 Imported by: 0

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

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

func StartService(cfg *config.Config, configPath string, localPassword string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL