go.bigb.es/claudio

v0.7.0
Doc Versions Source

Functions

f func Path

src
func Path() string

Path returns the config file path following XDG Base Directory Specification.

f func ResolveProvider

src

ResolveProvider builds a provider.Provider for the given key by merging the built-in registry entry (if any) with config overrides. Custom providers defined entirely in config are also supported.

f func Save

src
func Save(cfg *Config) error

Save writes the config to disk.

Types

T type Config

src
type Config struct {
	Schema         string                    `yaml:"$schema,omitempty"`
	ActiveProvider string                    `yaml:"active_provider"`
	Proxy          string                    `yaml:"proxy,omitempty"`        // global proxy for upstream requests, e.g. "socks5://127.0.0.1:1080"
	ClaudeProxy    string                    `yaml:"claude_proxy,omitempty"` // HTTP(S) proxy for Claude Code (it doesn't support SOCKS5)
	Providers      map[string]ProviderConfig `yaml:"providers"`
}

Config is the top-level configuration.

f func Load

src
func Load() (*Config, error)

Load reads the config from disk. If the file doesn't exist, it creates a default config with all known providers (empty API keys) and writes it to disk as a starting template.

T type ProviderConfig

src
type ProviderConfig struct {
	APIKey        string            `yaml:"api_key"`
	Name          string            `yaml:"name,omitempty"`
	Description   string            `yaml:"description,omitempty"`
	BaseURL       string            `yaml:"base_url,omitempty"`
	Model         string            `yaml:"model,omitempty"`
	SmallModel    string            `yaml:"small_model,omitempty"`
	Compat        string            `yaml:"compat,omitempty"`         // "anthropic" or "openai"
	Proxy         string            `yaml:"proxy,omitempty"`          // e.g. "socks5://127.0.0.1:1080"
	ClaudeProxy   string            `yaml:"claude_proxy,omitempty"`   // HTTP(S) proxy for Claude Code (it doesn't support SOCKS5)
	Plan          string            `yaml:"plan,omitempty"`           // plan key for providers with multiple plans (e.g. "api", "coding")
	ContextWindow int               `yaml:"context_window,omitempty"` // model context window in tokens
	Env           map[string]string `yaml:"env,omitempty"`            // extra env vars to set at launch
	Hidden        bool              `yaml:"hidden,omitempty"`         // hide from the main menu
}

ProviderConfig holds per-provider user settings. For built-in providers only api_key is needed. For custom providers, set base_url + model + compat to define one entirely in YAML.

Source Files