Skip to main content

Module config

Module config 

Source
Expand description

TOML config loading (S9.1/S9.1.1).

Loads and resolves opi configuration with precedence: CLI > env > project config > user config > built-in defaults.

Phase 1 fields: model, max_iterations, tool_timeout_ms, theme, thinking, providers.anthropic.api_key_env.

Phase 2 fields: providers.{openai,openrouter,mistral,openai_responses,gemini} config with api_key_env, base_url, and OpenRouter-specific referer.

Structs§

AnthropicProviderConfig
[providers.anthropic] section.
AzureProviderConfig
[providers.azure] section.
BedrockProviderConfig
[providers.bedrock] section.
CompactionConfigSection
[compaction] section.
ConfigSource
External configuration sources for precedence resolution.
DefaultsConfig
[defaults] section.
ExtensionsConfig
[extensions] section.
GenericProviderConfig
Generic provider config (api_key_env + optional base_url + optional proxy).
KeybindingsConfig
[keybindings] section.
OpenRouterProviderConfig
OpenRouter-specific provider config.
OpiConfig
Top-level opi configuration (fully resolved).
PackagesConfig
[packages] section.
ProviderProxyConfig
Per-provider proxy configuration from [providers.*.proxy].
ProvidersConfig
[providers] section.
ThinkingConfig
[thinking] section.
VertexProviderConfig
[providers.vertex] section.

Enums§

ConfigError
Errors from config loading and parsing.

Functions§

build_http_client
Build an HTTP client with optional proxy configuration.
load_config_file
Load and parse a TOML config file. Returns defaults if the file doesn’t exist. Returns a clear error for malformed TOML.
resolve_config
Resolve configuration from all sources with correct precedence: CLI > env > project config > user config > built-in defaults.
user_config_dir
Return the platform-specific user config directory.
user_config_path
Return the platform-specific user config file path.