config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

func EffectivePath

func EffectivePath(explicit string) string

EffectivePath returns the configuration file that Load will use first. It also returns the default user path before the file exists, so callers can show users exactly where a future config update will be written.

func EnvMap

func EnvMap() map[string]string

func RemoveUserConfig

func RemoveUserConfig(path string) (string, error)

func SetUserValue

func SetUserValue(path string, key string, value string) (string, error)

func SetUserValues

func SetUserValues(path string, values map[string]string) (string, error)

SetUserValues validates and writes a group of user values as one file update. The caller owns semantic validation; this function preserves unrelated lines and replaces each selected key in one complete file write.

func Validate

func Validate(cfg AppConfig, requireVLM bool) error

Types

type AppConfig

type AppConfig struct {
	Language          string
	Provider          string
	BaseURL           string
	Model             string
	APIKey            string
	APIKeySource      string
	APIKeyEnv         string
	CredentialStore   string
	CredentialAccount string
	CredentialsPath   string
	RemoteConfirmed   bool
	PPTRenderer       string
	FileWorkers       int
	Workers           int
	DPI               int
	ImageDetail       string
	MaxImageMB        int
	MaxTokens         int
	ContextFallbacks  int
	MinImageDimension int
	TimeoutSeconds    int
	RetryCount        int
	PromptName        string
	JSONOutput        bool
	NoColor           bool
	Quiet             bool
	Verbose           bool
}

func Default

func Default() AppConfig

func Load

func Load(path string, env map[string]string) (AppConfig, error)

func MergeFlags

func MergeFlags(base AppConfig, flags FlagConfig) (AppConfig, error)

func ResolveCredentials

func ResolveCredentials(cfg AppConfig, env map[string]string) (AppConfig, error)

type FlagConfig

type FlagConfig struct {
	Language          string
	ConfigPath        string
	Provider          string
	BaseURL           string
	Model             string
	APIKeyEnv         string
	CredentialStore   string
	CredentialAccount string
	CredentialsPath   string
	RemoteConfirmed   *bool
	PPTRenderer       string
	FileWorkers       int
	Workers           int
	DPI               int
	ImageDetail       string
	MaxImageMB        int
	MaxTokens         int
	ContextFallbacks  *int
	MinImageDimension int
	TimeoutSeconds    int
	RetryCount        int
	PromptName        string
	OutputDir         string
	JSONOutput        bool
	NoColor           bool
	Quiet             bool
	Verbose           bool
}

Jump to

Keyboard shortcuts

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