config

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config handles CLI configuration loading and management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default configuration file path for the current platform. - macOS/Linux: ~/.iris/config.yaml - Windows: %USERPROFILE%\.iris\config.yaml

Types

type Config

type Config struct {
	DefaultProvider string                    `yaml:"default_provider"`
	DefaultModel    string                    `yaml:"default_model"`
	Providers       map[string]ProviderConfig `yaml:"providers"`
}

Config represents the CLI configuration.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads configuration from the specified path. If the file doesn't exist, returns an empty config without error. Returns an error only if the file exists but cannot be read or parsed.

func (*Config) GetProvider

func (c *Config) GetProvider(id string) *ProviderConfig

GetProvider returns the provider config for the given ID. Returns nil if the provider is not configured.

type ProviderConfig

type ProviderConfig struct {
	APIKeyRef string `yaml:"api_key_ref"`
	BaseURL   string `yaml:"base_url,omitempty"`
}

ProviderConfig holds configuration for a specific provider.

Jump to

Keyboard shortcuts

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