Documentation
¶
Overview ¶
Package config resolves gskill's layered configuration. Precedence, lowest to highest, is: built-in defaults, user config file, project config file, GSKILL_-prefixed environment variables, then explicit flags. Storage paths follow the platform convention (XDG on Linux, the OS equivalents elsewhere) and may be overridden with GSKILL_CONFIG_DIR / GSKILL_CACHE_DIR.
Index ¶
Constants ¶
const (
// EnvPrefix is the prefix for environment-variable overrides.
EnvPrefix = "GSKILL_"
)
Variables ¶
This section is empty.
Functions ¶
func CacheDir ¶
CacheDir returns the gskill cache directory, honoring GSKILL_CACHE_DIR and otherwise following the platform convention.
func DefaultMap ¶
DefaultMap returns the built-in configuration defaults.
Types ¶
type Config ¶
type Config struct {
LogLevel string
LogFormat string
Offline bool
NoCache bool
Jobs int
// Repositories are the known skill repositories an unscoped `find` searches
// (FR-038). Configured in a config file (TOML array) or via
// GSKILL_REPOSITORIES (comma-separated).
Repositories []string
}
Config is the resolved, layered gskill configuration.
type Sources ¶
type Sources struct {
// Defaults seeds the lowest layer. When nil, DefaultMap is used.
Defaults map[string]any
// UserFile and ProjectFile are optional TOML config paths. A missing file
// is skipped without error.
UserFile string
ProjectFile string
// Environ is a list of "KEY=VALUE" entries (as from os.Environ); only
// GSKILL_-prefixed entries are consulted. When nil, the process environment
// is used.
Environ []string
// Flags is the highest-precedence layer of explicitly set flag values.
Flags map[string]any
}
Sources are the inputs to Load. Empty fields are skipped; later layers override earlier ones in the documented precedence order.