Global user configuration — cache settings, registry sources, and agent target defaults stored in ~/.config/ion/config.toml.

GlobalConfig

Fields

NameTypeDescription
targetsBTreeMap<String, String>
sourcesBTreeMap<String, String>
cacheCacheConfig
uiUiConfig
registriesBTreeMap<String, RegistryConfig>
searchSearchConfig

Methods

config_path

pub fn config_path() -> Option<PathBuf>

Returns the platform-appropriate path for the global config file.

load

pub fn load() -> Result<Self>

Load global config from the platform default path. Returns Default if the file doesn’t exist.

load_from

pub fn load_from(path: &Path) -> Result<Self>

Load global config from a specific path. Returns Default if the file doesn’t exist.

resolve_targets

pub fn resolve_targets(&self, project: &ManifestOptions) -> BTreeMap<String, String>

Merge global targets with project targets. Project wins on key collision.

resolve_source

pub fn resolve_source(&self, input: &str) -> String

Expand source aliases. If the first segment of a shorthand matches a source alias, replace it with the alias value. URLs and paths pass through unchanged.

save_to

pub fn save_to(&self, path: &Path) -> Result<()>

Save global config to a specific path. Creates parent directories.

get_value

pub fn get_value(&self, key: &str) -> Option<String>

Get a config value by dot-notation key (e.g., “targets.claude”, “ui.color”).

set_value_in_file

pub fn set_value_in_file(path: &Path, key: &str, value: &str) -> Result<()>

Set a config value in a TOML file by dot-notation key, preserving formatting.

delete_value_in_file

pub fn delete_value_in_file(path: &Path, key: &str) -> Result<()>

Delete a config value from a TOML file by dot-notation key, preserving formatting.

list_values

pub fn list_values(&self) -> Vec<(String, String)>

List all config values as a Vec of (dot-key, value) pairs.

Trait Implementations

  • Debug
  • Clone
  • Default
  • Serialize
  • Deserialize<'de>

CacheConfig

Fields

NameTypeDescription
max_age_daysOption<u32>

Trait Implementations

  • Debug
  • Clone
  • Default
  • Serialize
  • Deserialize<'de>

UiConfig

Fields

NameTypeDescription
colorOption<bool>

Trait Implementations

  • Debug
  • Clone
  • Default
  • Serialize
  • Deserialize<'de>

RegistryConfig

Fields

NameTypeDescription
urlString
defaultOption<bool>

Trait Implementations

  • Debug
  • Clone
  • Default
  • Serialize
  • Deserialize<'de>

SearchConfig

Fields

NameTypeDescription
agent_commandOption<String>

Trait Implementations

  • Debug
  • Clone
  • Default
  • Serialize
  • Deserialize<'de>