pub struct OpenCodeConfig {Show 26 fields
pub schema: Option<String>,
pub log_level: Option<LogLevel>,
pub server: Option<ServerConfig>,
pub command: Option<HashMap<String, CommandConfig>>,
pub skills: Option<SkillsConfig>,
pub watcher: Option<WatcherConfig>,
pub snapshot: Option<bool>,
pub plugin: Option<Vec<PluginEntry>>,
pub share: Option<ShareMode>,
pub autoupdate: Option<AutoupdateConfig>,
pub disabled_providers: Option<Vec<String>>,
pub enabled_providers: Option<Vec<String>>,
pub model: Option<String>,
pub small_model: Option<String>,
pub default_agent: Option<String>,
pub username: Option<String>,
pub agent: Option<HashMap<String, AgentConfig>>,
pub provider: Option<HashMap<String, ProviderConfig>>,
pub mcp: Option<HashMap<String, McpConfig>>,
pub permission: Option<PermissionConfig>,
pub formatter: Option<HashMap<String, FormatterConfig>>,
pub instructions: Option<Vec<String>>,
pub compaction: Option<CompactionConfig>,
pub experimental: Option<Value>,
pub tools: Option<HashMap<String, bool>>,
pub extra: HashMap<String, Value>,
}Expand description
Root configuration for opencode.json.
All fields are optional to support partial configs from different layers (global, project, custom) that are merged together.
Fields§
§schema: Option<String>JSON schema reference for validation.
log_level: Option<LogLevel>Log level.
server: Option<ServerConfig>Server configuration.
command: Option<HashMap<String, CommandConfig>>Custom commands.
skills: Option<SkillsConfig>Additional skill folder paths.
watcher: Option<WatcherConfig>File watcher ignore patterns.
snapshot: Option<bool>Enable or disable snapshot tracking.
plugin: Option<Vec<PluginEntry>>Plugin list.
Sharing behavior.
autoupdate: Option<AutoupdateConfig>Auto-update behavior.
disabled_providers: Option<Vec<String>>Disabled provider IDs.
enabled_providers: Option<Vec<String>>Enabled provider IDs (allowlist).
model: Option<String>Default model in provider/model format.
small_model: Option<String>Small model for lightweight tasks.
default_agent: Option<String>Default agent.
username: Option<String>Custom username.
agent: Option<HashMap<String, AgentConfig>>Agent configurations.
provider: Option<HashMap<String, ProviderConfig>>Provider configurations.
mcp: Option<HashMap<String, McpConfig>>MCP server configurations.
permission: Option<PermissionConfig>Tool permissions.
formatter: Option<HashMap<String, FormatterConfig>>Formatter configurations.
instructions: Option<Vec<String>>Instruction file paths/globs.
compaction: Option<CompactionConfig>Compaction settings.
experimental: Option<Value>Experimental features.
tools: Option<HashMap<String, bool>>Tool enable/disable overrides.
extra: HashMap<String, Value>Catch-all for fields not explicitly modeled above. Prevents data loss when reading configs with fields our schema doesn’t cover yet (e.g., new OpenCode features).
Trait Implementations§
Source§impl Clone for OpenCodeConfig
impl Clone for OpenCodeConfig
Source§fn clone(&self) -> OpenCodeConfig
fn clone(&self) -> OpenCodeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpenCodeConfig
impl Debug for OpenCodeConfig
Source§impl Default for OpenCodeConfig
impl Default for OpenCodeConfig
Source§fn default() -> OpenCodeConfig
fn default() -> OpenCodeConfig
Source§impl<'de> Deserialize<'de> for OpenCodeConfig
impl<'de> Deserialize<'de> for OpenCodeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OpenCodeConfig
impl PartialEq for OpenCodeConfig
Source§fn eq(&self, other: &OpenCodeConfig) -> bool
fn eq(&self, other: &OpenCodeConfig) -> bool
self and other values to be equal, and is used by ==.