Documentation
¶
Index ¶
Constants ¶
View Source
const ( CommandVersion = "version" CommandLogin = "login" CommandLogout = "logout" CommandSessions = "sessions" CommandWhoami = "whoami" CommandModels = "models" CommandServe = "serve" CommandImport = "import" )
Known subcommand names captured in AppConfig.Command after ParseConfig.
Variables ¶
View Source
var ErrHelpRequested = errors.New("help requested")
ErrHelpRequested is returned when the user asked for command help. Callers should exit successfully after cobra has printed help.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
Verbose bool
ShowVersion bool
// Command is the selected subcommand name (see Command* constants).
// Bare root defaults to CommandServe.
Command string
// Args are positional args passed to the selected subcommand.
Args []string
Host string
Port int
AuthPath string
MaxRetries int
CooldownMins int
PreferPro bool
// MaxLoginAttempts caps concurrent open Control API login attempts.
MaxLoginAttempts int
// LoginAttemptMins closes unanswered login attempts after this many minutes.
LoginAttemptMins int
// LoginKeepMins keeps a resolved login attempt listed after success/fail.
LoginKeepMins int
// SessionsCheck is set by `sessions --check`.
SessionsCheck bool
// ImportPath is the Cursor-style auth.json path for `import` (default ./data/auth.json).
ImportPath string
}
func ParseConfig ¶
ParseConfig loads env defaults, parses CLI flags/subcommands, and returns the app config. It returns ErrHelpRequested when the user asked for help (cobra has already printed it). Callers should handle ShowVersion and process exit themselves.
Click to show internal directories.
Click to hide internal directories.