pub struct Config {
pub watchers: Vec<String>,
pub auto_link: bool,
pub auto_link_threshold: f64,
pub commit_footer: bool,
}Expand description
Lore configuration settings.
Controls watcher behavior, auto-linking, and commit integration.
Loaded from ~/.lore/config.yaml when available.
Fields§
§watchers: Vec<String>List of enabled watcher names (e.g., “claude-code”, “cursor”).
auto_link: boolWhether to automatically link sessions to commits.
auto_link_threshold: f64Minimum confidence score (0.0-1.0) required for auto-linking.
Whether to append session references to commit messages.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Loads configuration from the default config file.
Returns default configuration if the file does not exist.
Sourcepub fn save(&self) -> Result<()>
pub fn save(&self) -> Result<()>
Saves configuration to the default config file.
Creates the ~/.lore directory if it does not exist.
Sourcepub fn load_from_path(path: &Path) -> Result<Self>
pub fn load_from_path(path: &Path) -> Result<Self>
Loads configuration from a specific path.
Returns default configuration if the file does not exist.
Sourcepub fn save_to_path(&self, path: &Path) -> Result<()>
pub fn save_to_path(&self, path: &Path) -> Result<()>
Saves configuration to a specific path.
Creates parent directories if they do not exist.
Sourcepub fn get(&self, key: &str) -> Option<String>
pub fn get(&self, key: &str) -> Option<String>
Gets a configuration value by key.
Supported keys:
watchers- comma-separated list of enabled watchersauto_link- “true” or “false”auto_link_threshold- float between 0.0 and 1.0commit_footer- “true” or “false”
Returns None if the key is not recognized.
Sourcepub fn set(&mut self, key: &str, value: &str) -> Result<()>
pub fn set(&mut self, key: &str, value: &str) -> Result<()>
Sets a configuration value by key.
Supported keys:
watchers- comma-separated list of enabled watchersauto_link- “true” or “false”auto_link_threshold- float between 0.0 and 1.0 (inclusive)commit_footer- “true” or “false”
Returns an error if the key is not recognized or the value is invalid.
Sourcepub fn config_path() -> Result<PathBuf>
pub fn config_path() -> Result<PathBuf>
Returns the path to the configuration file.
The configuration file is located at ~/.lore/config.yaml.
Sourcepub fn valid_keys() -> &'static [&'static str]
pub fn valid_keys() -> &'static [&'static str]
Returns the list of valid configuration keys.