config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir() string

Dir returns the config directory path, respecting XDG_CONFIG_HOME.

func Save

func Save(cfg *Config) error

Save writes config to ~/.config/ai-cli/config.yaml.

Types

type Config

type Config struct {
	ActiveProvider string                    `mapstructure:"active_provider" yaml:"active_provider,omitempty"`
	Providers      map[string]ProviderConfig `mapstructure:"providers" yaml:"providers,omitempty"`
}

Config represents the persistent CLI configuration.

func Load

func Load() (*Config, error)

Load reads config from ~/.config/ai-cli/config.yaml with env var overrides. Returns a zero-value Config (not an error) if the file doesn't exist.

type ProviderConfig

type ProviderConfig struct {
	BaseURL string `mapstructure:"base_url" yaml:"base_url,omitempty"`
	Model   string `mapstructure:"model" yaml:"model,omitempty"`
}

ProviderConfig stores per-provider settings.

Jump to

Keyboard shortcuts

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