pub struct MatrixConfig {Show 14 fields
pub provider: Option<String>,
pub api_key: Option<String>,
pub base_url: Option<String>,
pub model: Option<String>,
pub think: bool,
pub markdown: bool,
pub max_tokens: u32,
pub context_size: Option<u32>,
pub multi_model: Option<bool>,
pub plan_model: Option<String>,
pub compress_model: Option<String>,
pub fast_model: Option<String>,
pub approve_mode: Option<String>,
pub extra_headers: Option<HashMap<String, String>>,
}Expand description
Matrixcode configuration file structure. Uses universal naming (no ANTHROPIC_ prefix).
Fields§
§provider: Option<String>LLM provider: “anthropic” or “openai”
api_key: Option<String>API key (universal naming, also supports ANTHROPIC_AUTH_TOKEN alias)
base_url: Option<String>Base URL for API endpoint
model: Option<String>Main model name
think: boolEnable extended thinking
markdown: boolEnable markdown rendering
max_tokens: u32Maximum output tokens
context_size: Option<u32>Context size
multi_model: Option<bool>Multi-model configuration
plan_model: Option<String>Plan/reasoning model
compress_model: Option<String>Compress/haiku model
fast_model: Option<String>Fast model
approve_mode: Option<String>Approve mode: “ask”, “auto”, “strict”
extra_headers: Option<HashMap<String, String>>Extra HTTP headers to add to API requests Format: {“Header-Name”: “header-value”}
Implementations§
Source§impl MatrixConfig
impl MatrixConfig
Sourcepub fn matrix_config_path() -> Option<PathBuf>
pub fn matrix_config_path() -> Option<PathBuf>
Path to matrixcode config file.
Sourcepub fn claude_settings_path() -> Option<PathBuf>
pub fn claude_settings_path() -> Option<PathBuf>
Path to Claude Code settings file.
Sourcepub fn load() -> Self
pub fn load() -> Self
Load configuration with fallback chain. Priority: env vars > ~/.matrix/config.json > ~/.claude/settings.json > defaults
Sourcepub fn get_api_key(&self, provider: &str) -> Option<String>
pub fn get_api_key(&self, provider: &str) -> Option<String>
Get API key, with fallback to environment variable. Universal env var: API_KEY (also supports ANTHROPIC_AUTH_TOKEN for compatibility)
Sourcepub fn get_model(&self, provider: &str) -> String
pub fn get_model(&self, provider: &str) -> String
Get model name, with fallback to environment variable. Universal env var: MODEL (also supports ANTHROPIC_MODEL for compatibility)
Sourcepub fn get_base_url(&self, provider: &str) -> String
pub fn get_base_url(&self, provider: &str) -> String
Get base URL, with fallback to environment variable. Universal env var: BASE_URL (also supports ANTHROPIC_BASE_URL for compatibility)
Sourcepub fn is_api_configured(&self) -> bool
pub fn is_api_configured(&self) -> bool
Check if API is configured.
Trait Implementations§
Source§impl Clone for MatrixConfig
impl Clone for MatrixConfig
Source§fn clone(&self) -> MatrixConfig
fn clone(&self) -> MatrixConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more