config

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentSchemaVersion = 1

Variables

This section is empty.

Functions

func ApplyEnv

func ApplyEnv(c *Config)

func Migrate

func Migrate(c *Config) error

Types

type CacheConfig

type CacheConfig struct {
	Enabled bool `yaml:"enabled"`
	TTLDays int  `yaml:"ttl_days"`
}

type Config

type Config struct {
	Version   int                       `yaml:"version"`
	Provider  string                    `yaml:"provider"`
	Providers map[string]ProviderConfig `yaml:"providers"`
	Output    OutputConfig              `yaml:"output"`
	Cache     CacheConfig               `yaml:"cache"`
	Guard     GuardConfig               `yaml:"guard"`
	Cost      CostConfig                `yaml:"cost"`
}

func Default

func Default() *Config

func Load

func Load(globalPath, repoPath string) (*Config, error)

func LoadFile

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

type CostConfig added in v0.8.0

type CostConfig struct {
	WarnThresholdUSD float64 `yaml:"warn_threshold_usd"`
}

CostConfig controls the pre-send cost preflight added in v0.8.0. WarnThresholdUSD is the estimated-cost ceiling above which the CLI will prompt (TTY) or abort (non-TTY) before contacting the provider. Zero or negative disables the check entirely; the default of 0.50 is a "occasional dev review" budget — users running scheduled jobs should bump it via config or pass --no-cost-check per-invocation.

type GuardConfig added in v0.8.0

type GuardConfig struct {
	SecretScan bool `yaml:"secret_scan"`
}

GuardConfig toggles pre-send protections that don't quite fit elsewhere. SecretScan controls the credential-pattern scan added in v0.8.0 (ADR-0007 follow-up); leaving it true is the safe default, false disables it entirely for users who pipeline outputs through a secrets manager and don't want the prompt.

type OutputConfig

type OutputConfig struct {
	Lang   string `yaml:"lang"`
	Stream bool   `yaml:"stream"`
	Color  string `yaml:"color"`
}

type ProviderConfig

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

Jump to

Keyboard shortcuts

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