1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use clap::{Args, Subcommand};
use std::path::PathBuf;
#[derive(Args)]
pub(in crate::cli) struct ExportArgs {
/// Export as one markdown file per curated memory.
#[arg(long)]
pub(in crate::cli) markdown: bool,
/// Output directory for the markdown mirror.
#[arg(long)]
pub(in crate::cli) output: Option<PathBuf>,
/// Output directory for a deterministic project memory pack.
#[arg(long)]
pub(in crate::cli) pack: Option<PathBuf>,
/// Project path to export. Defaults to the current working directory.
#[arg(long, short)]
pub(in crate::cli) project: Option<String>,
/// Include stale and archived memories.
#[arg(long)]
pub(in crate::cli) include_inactive: bool,
/// Maximum memories to export.
#[arg(long, default_value = "10000")]
pub(in crate::cli) limit: i64,
}
#[derive(Subcommand)]
pub(in crate::cli) enum ImportAction {
/// Import memories from an older backup sqlite file. Transcripts are not
/// replayed; only the old `memories` table is imported, with synthesized
/// provenance defaults.
Backup {
/// Backup sqlite path produced by `remem admin backup`.
#[arg(long)]
source: PathBuf,
/// Acknowledge that import is best-effort and skips constraint
/// violations rather than failing.
#[arg(long)]
best_effort: bool,
},
/// One-way, read-only import of Codex CLI native rollout-summary memories
/// into the candidate review queue. Records are untrusted external
/// content: they only land in pending_review or quarantined, never
/// directly in active memories, and the source tree is never modified.
CodexMemories {
/// Override the source directory (defaults to
/// `~/.codex/memories/rollout_summaries`). Intended for tests/PoC.
#[arg(long)]
source: Option<PathBuf>,
/// Plan the import without writing to the remem database.
#[arg(long)]
dry_run: bool,
/// Plan digest from a prior --dry-run. Required for apply; the apply
/// is rejected if current planning no longer matches this digest.
#[arg(long)]
expect_plan_digest: Option<String>,
},
/// Rebuild curated memories from a markdown mirror produced by `remem export --markdown`.
#[command(visible_alias = "reindex-markdown")]
Markdown {
/// Markdown file or directory containing exported `.md` memory files.
#[arg(long)]
source: PathBuf,
/// Skip malformed markdown files instead of failing the import.
#[arg(long)]
best_effort: bool,
},
}