pub struct MirrorConfig {
pub enabled: bool,
pub projects_dir: PathBuf,
pub codex_enabled: bool,
pub codex_sessions_dir: PathBuf,
pub chatgpt_enabled: bool,
pub chatgpt_exports_dir: PathBuf,
pub poll_interval: Duration,
pub backfill: bool,
}Expand description
Configuration for the mirror service.
Loaded from environment variables at daemon boot via MirrorConfig::from_env.
Fields§
§enabled: boolWhether the Claude Code transcript mirror is enabled (default: false — opt-in).
projects_dir: PathBufRoot directory that contains <project-slug>/<session-uuid>.jsonl files.
Defaults to $HOME/.claude/projects.
codex_enabled: boolWhether the Codex CLI transcript mirror is enabled (default: false — opt-in,
independent of enabled).
codex_sessions_dir: PathBufRoot directory that contains YYYY/MM/DD/rollout-<ts>-<uuid>.jsonl files.
Defaults to $HOME/.codex/sessions.
chatgpt_enabled: boolWhether the ChatGPT export mirror is enabled (default: false — opt-in,
independent of enabled and codex_enabled).
chatgpt_exports_dir: PathBufRoot directory scanned (recursively) for conversations.json export files.
Defaults to $HOME/.chatgpt/exports.
poll_interval: DurationHow long to sleep between polling ticks (default: 2 seconds).
backfill: boolWhen true (default), existing files are mirrored from byte offset 0. When false, newly discovered files start mirroring from their current EOF.
Implementations§
Source§impl MirrorConfig
impl MirrorConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Build config from environment variables, falling back to safe defaults.
| Variable | Default |
|---|---|
KHIVE_MIRROR_ENABLED | false |
KHIVE_MIRROR_PROJECTS_DIR | $HOME/.claude/projects |
KHIVE_MIRROR_CODEX_ENABLED | false |
KHIVE_MIRROR_CODEX_DIR | $HOME/.codex/sessions |
KHIVE_MIRROR_CHATGPT_ENABLED | false |
KHIVE_MIRROR_CHATGPT_DIR | $HOME/.chatgpt/exports |
KHIVE_MIRROR_POLL_SECS | 2 |
KHIVE_MIRROR_BACKFILL | true |
Auto Trait Implementations§
impl Freeze for MirrorConfig
impl RefUnwindSafe for MirrorConfig
impl Send for MirrorConfig
impl Sync for MirrorConfig
impl Unpin for MirrorConfig
impl UnsafeUnpin for MirrorConfig
impl UnwindSafe for MirrorConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more