config

package
v1.2.1 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 ModelPricing added in v1.2.0

type ModelPricing struct {
	InputPer1M       float64 `yaml:"input_per_1m,omitempty"`
	OutputPer1M      float64 `yaml:"output_per_1m,omitempty"`
	CachedInputPer1M float64 `yaml:"cached_input_per_1m,omitempty"`
}

ModelPricing is a per-1M-token rate override for one model.

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"`

	// Pricing overrides the built-in per-model rate table (OQ-09), keyed
	// by model name. Useful when the hard-coded snapshot drifts or for a
	// negotiated rate. Zero fields fall back to the built-in value, so a
	// partial override (e.g. only output_per_1m) is allowed. Consumed by
	// the cost preflight, verbose footer, and cached-cost figures via
	// resolvePricing (internal/cli).
	Pricing map[string]ModelPricing `yaml:"pricing,omitempty"`
}

Jump to

Keyboard shortcuts

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