Skip to main content

Module config_core

Module config_core 

Source
Expand description

config-core: Core configuration file read/write/validate/merge for OpenCode.

This crate handles:

  • Parsing and serializing opencode.json / opencode.jsonc files
  • Deep merging global and project-level configs
  • Validating config against the OpenCode JSON schema
  • JSONC comment preservation
  • Platform-aware config path resolution
  • Environment variable substitution {env:VAR} and file substitution {file:path}

Re-exports§

pub use error::ConfigError;
pub use error::Result;
pub use jsonc::JsoncHandler;
pub use merge::MergeStrategy;
pub use merge::merge_configs;
pub use merge::merge_two;
pub use paths::ConfigLayer;
pub use paths::ConfigPaths;
pub use validate::validate_config;
pub use schema::*;

Modules§

error
jsonc
JSONC (JSON with Comments) parser and serializer.
merge
Deep merge logic for OpenCode configuration files.
paths
Platform-aware config path resolution for OpenCode.
schema
Config schema types matching the OpenCode JSON schema.
validate
Config validation against the OpenCode JSON schema and custom rules.