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 |