Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 18 fields pub watchers: Vec<String>, pub auto_link: bool, pub auto_link_threshold: f64, pub commit_footer: bool, pub machine_id: Option<String>, pub machine_name: Option<String>, pub encryption_salt: Option<String>, pub use_keychain: bool, pub summary_provider: Option<String>, pub summary_api_key_anthropic: Option<String>, pub summary_api_key_openai: Option<String>, pub summary_api_key_openrouter: Option<String>, pub summary_model_anthropic: Option<String>, pub summary_model_openai: Option<String>, pub summary_model_openrouter: Option<String>, pub summary_auto: bool, pub summary_auto_threshold: usize, pub sync_global_remote: Option<String>,
}
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: bool

Whether to automatically link sessions to commits.

§auto_link_threshold: f64

Minimum confidence score (0.0-1.0) required for auto-linking.

§commit_footer: bool

Whether to append session references to commit messages.

§machine_id: Option<String>

Unique machine identifier (UUID) for sync deduplication.

Auto-generated on first access via get_or_create_machine_id().

§machine_name: Option<String>

Human-readable machine name.

Defaults to hostname if not set. Can be customized by the user.

§encryption_salt: Option<String>

Salt for encryption key derivation (base64-encoded).

Generated on first sync setup and stored for consistent key derivation. This is NOT secret - only the passphrase needs to be kept private.

§use_keychain: bool

Whether to use the OS keychain for credential storage.

When false (default), the sync passphrase key is stored in a file under ~/.lore. When true, uses macOS Keychain, GNOME Keyring, or Windows Credential Manager. Note: Keychain may prompt for permission on first access.

§summary_provider: Option<String>

LLM provider for summary generation (“anthropic”, “openai”, “openrouter”).

§summary_api_key_anthropic: Option<String>

API key for Anthropic summary provider.

§summary_api_key_openai: Option<String>

API key for OpenAI summary provider.

§summary_api_key_openrouter: Option<String>

API key for OpenRouter summary provider.

§summary_model_anthropic: Option<String>

Model override for Anthropic summary provider.

§summary_model_openai: Option<String>

Model override for OpenAI summary provider.

§summary_model_openrouter: Option<String>

Model override for OpenRouter summary provider.

§summary_auto: bool

Whether to automatically generate summaries when sessions end.

§summary_auto_threshold: usize

Minimum message count to trigger auto-summary generation.

§sync_global_remote: Option<String>

Remote URL of the user’s private global personal store repository.

The global store (lore sync --global) is a managed git repo at ~/.lore/sync whose origin remote points at this URL. It holds the user’s cross-tool, cross-repo aggregate of encrypted sessions for personal multi-machine backup and search.

Implementations§

Source§

impl Config

Source

pub fn load() -> Result<Self>

Loads configuration from the default config file.

Returns default configuration if the file does not exist.

Source

pub fn save(&self) -> Result<()>

Saves configuration to the default config file.

Creates the ~/.lore directory if it does not exist.

Source

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

Loads configuration from a specific path.

Returns default configuration if the file does not exist.

Source

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

Saves configuration to a specific path.

Creates parent directories if they do not exist.

Source

pub fn get_or_create_machine_id(&mut self) -> Result<String>

Returns the machine UUID, generating and saving a new one if needed.

If no machine_id exists in config, generates a new UUIDv4 and saves it to the config file. This ensures a consistent machine identifier across sessions for sync deduplication.

Source

pub fn get_machine_name(&self) -> String

Returns the machine name.

If a custom machine_name is set, returns that. Otherwise returns the system hostname. Returns “unknown” if hostname cannot be determined.

Source

pub fn set_machine_name(&mut self, name: &str) -> Result<()>

Sets a custom machine name and saves the configuration.

The machine name is a human-readable identifier for this machine, displayed in session listings and useful for identifying which machine created a session.

Source

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

Gets a configuration value by key.

Supported keys:

  • watchers - comma-separated list of enabled watchers
  • auto_link - “true” or “false”
  • auto_link_threshold - float between 0.0 and 1.0
  • commit_footer - “true” or “false”
  • machine_id - the machine UUID (read-only, auto-generated)
  • machine_name - human-readable machine name
  • encryption_salt - salt for encryption key derivation (read-only)
  • summary_provider - LLM provider for summaries
  • summary_api_key_anthropic - Anthropic API key
  • summary_api_key_openai - OpenAI API key
  • summary_api_key_openrouter - OpenRouter API key
  • summary_model_anthropic - Anthropic model override
  • summary_model_openai - OpenAI model override
  • summary_model_openrouter - OpenRouter model override
  • summary_auto - “true” or “false”
  • summary_auto_threshold - minimum messages for auto-summary
  • sync_global_remote - remote URL of the global personal store repo

Returns None if the key is not recognized.

Source

pub fn set(&mut self, key: &str, value: &str) -> Result<()>

Sets a configuration value by key.

Supported keys:

  • watchers - comma-separated list of enabled watchers
  • auto_link - “true” or “false”
  • auto_link_threshold - float between 0.0 and 1.0 (inclusive)
  • commit_footer - “true” or “false”
  • machine_name - human-readable machine name
  • summary_provider - “anthropic”, “openai”, or “openrouter”
  • summary_api_key_anthropic - Anthropic API key
  • summary_api_key_openai - OpenAI API key
  • summary_api_key_openrouter - OpenRouter API key
  • summary_model_anthropic - Anthropic model override
  • summary_model_openai - OpenAI model override
  • summary_model_openrouter - OpenRouter model override
  • summary_auto - “true” or “false”
  • summary_auto_threshold - positive integer
  • sync_global_remote - remote URL of the global personal store repo

Note: machine_id and encryption_salt cannot be set manually.

Returns an error if the key is not recognized or the value is invalid.

Source

pub fn config_path() -> Result<PathBuf>

Returns the path to the configuration file.

The configuration file is located at ~/.lore/config.yaml.

Source

pub fn valid_keys() -> &'static [&'static str]

Returns the list of valid configuration keys.

Source

pub fn summary_api_key_for_provider(&self, provider: &str) -> Option<String>

Returns the API key for the given summary provider.

Source

pub fn summary_model_for_provider(&self, provider: &str) -> Option<String>

Returns the model override for the given summary provider.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more