Documentation
¶
Overview ¶
Package config resolves the CLI's runtime configuration from compiled defaults, an optional TOML config file, environment variables, and command-line flags — in that order, with later sources overriding earlier ones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultTOML string
Functions ¶
func ConfigDir ¶
func ConfigDir() string
ConfigDir returns the config directory path, respecting XDG_CONFIG_HOME on Unix and APPDATA on Windows.
func ConfigFilePath ¶
func ConfigFilePath() string
ConfigFilePath returns the full path to the config file.
func EnsureDefaultConfig ¶
EnsureDefaultConfig creates the config directory and writes the default config.toml if it does not already exist. Returns true if the file was created.
Types ¶
type Config ¶
type Config struct {
APIURL string `koanf:"api_url"`
APIKey string `koanf:"api_key"`
Team string `koanf:"team"`
KeyringURL string `koanf:"keyring_url"`
HTTPTimeout string `koanf:"http_timeout"`
Verify VerifyConfig `koanf:"verify"`
}
Config holds the resolved configuration for the CLI.
func Load ¶
Load reads configuration in priority order: defaults → config file → env → CLI flags. configPath overrides the default config file location if non-empty. flags should be the merged flag set from the executed command (rootFlags for persistent, cmdFlags for command-specific). Only flags that were explicitly set by the user override.