Skip to main content

CliCommand

Enum CliCommand 

Source
pub enum CliCommand {
Show 34 variants Experience { tenant_id: Option<String>, project_id: Option<String>, output: Option<PathBuf>, warm: WarmMode, command: ExperienceCommand, }, Add { tenant_id: Option<String>, text: String, chunk_type: ChunkType, project_id: Option<String>, tags: Option<Vec<String>>, source_uri: Option<String>, source_path: Option<String>, warm: WarmMode, }, Search {
Show 23 fields tenant_id: Option<String>, query: Option<String>, query_positional: Option<String>, k: usize, project_id: Option<String>, task_id: Option<String>, thread_id: Option<String>, compact: bool, dedupe_by_source: bool, token_budget: Option<usize>, mode: CliQueryMode, no_text: bool, include_artifact: bool, include_superseded: bool, format: ExportFormat, output: Option<PathBuf>, reranker: SearchReranker, reranker_model: String, reranker_device: String, reranker_batch_size: usize, reranker_timeout_seconds: u64, reranker_python: String, warm: WarmMode,
}, AgentContext {
Show 14 fields tenant_id: Option<String>, project_id: Option<String>, task_id: Option<String>, thread_id: Option<String>, query: Vec<String>, k: usize, token_budget: usize, mode: CliQueryMode, no_text: bool, include_artifact: bool, format: ExportFormat, output: Option<PathBuf>, log_dir: Option<PathBuf>, warm: WarmMode,
}, MemoryMd { tenant_id: Option<String>, project_id: Option<String>, project_dir: PathBuf, output: PathBuf, project_limit: usize, global_limit: usize, candidate_k: usize, explain_output: Option<PathBuf>, }, EvalMemoryMd { tenant_id: Option<String>, project_id: Option<String>, project_dir: PathBuf, output: PathBuf, project_limit: usize, candidate_k: usize, top_n: usize, min_useful_ratio: f64, max_generated_wrappers: usize, agent_usefulness: bool, gold_file: Option<PathBuf>, }, EvalRetrieval { tenant_id: String, project_id: Option<String>, project_dir: PathBuf, queries: Option<PathBuf>, k: usize, min_precision_at_k: f64, min_hit_rate_at_k: f64, min_known_recall_at_k: f64, min_mrr: f64, }, EvalWriteQuality { project_dir: PathBuf, min_rejection_or_downgrade_rate: f64, min_duplicate_reuse_rate: f64, max_total_chunks: usize, max_disk_bytes: u64, require_retention_compaction: bool, }, Consolidate { tenant_id: Option<String>, project_id: Option<String>, project_dir: PathBuf, max_region: usize, dry_run: bool, background: bool, force: bool, promote: bool, legacy_immediate: bool, warm: WarmMode, }, ConsolidateReview { run_id: Option<String>, tenant_id: Option<String>, project_id: Option<String>, list: bool, limit: usize, accept: bool, reject: bool, warm: WarmMode, }, Outcome { episode_id: String, tenant_id: Option<String>, outcome: String, verifier: String, used: Vec<String>, harmful: Vec<String>, evidence: Option<String>, event_time_ms: Option<i64>, warm: WarmMode, }, OutcomeScan { project_dir: PathBuf, sessions_dir: Option<PathBuf>, since_days: u64, dry_run: bool, }, EvalCounterfactual { tenant_id: String, project_id: Option<String>, project_dir: PathBuf, queries: Option<PathBuf>, k: usize, }, EvalOutcomeRanking { tenant_id: String, project_id: Option<String>, project_dir: PathBuf, queries: PathBuf, k: usize, report_json: PathBuf, }, SessionStart { project_dir: PathBuf, native_hook: Option<NativeHookHarness>, }, Call { tool: String, json: Option<String>, input: Option<PathBuf>, output: Option<PathBuf>, warm: WarmMode, }, Batch { jsonl: Option<PathBuf>, stream: bool, continue_on_error: bool, output: Option<PathBuf>, warm: WarmMode, }, Warm { command: WarmCommand, }, WarmWorker { socket: PathBuf, embedding_model: Option<String>, search_variant: Option<String>, }, Get { tenant_id: Option<String>, chunk_id: Option<String>, chunk_id_positional: Option<String>, }, Delete { tenant_id: Option<String>, chunk_id: String, warm: WarmMode, }, Stats { tenant_id: Option<String>, }, Audit { tenant_id: Option<String>, project_id: Option<String>, format: ExportFormat, strict: bool, output: Option<PathBuf>, page_size: usize, duplicate_examples: usize, top_projects: usize, }, Report { tenant_id: Option<String>, project_id: Option<String>, since: String, format: ReportFormat, strict: bool, top: usize, output: Option<PathBuf>, warm: WarmMode, }, CleanupPlan { tenant_id: Option<String>, project_id: Option<String>, project_dir: PathBuf, format: ExportFormat, output: Option<PathBuf>, archive_dir: PathBuf, older_than_days: u64, candidate_limit: usize, page_size: usize, top_projects: usize, }, Purge { tenant_id: String, project_id: Option<String>, older_than_days: u64, limit: usize, include_unreadable_active: bool, archive: Option<PathBuf>, apply: bool, vacuum_metadata: bool, rewrite_segments: bool, warm: WarmMode, }, PurgeArchive { archive: PathBuf, expect_tenant_id: Option<String>, expect_project_id: Option<String>, min_records: Option<usize>, format: ExportFormat, output: Option<PathBuf>, }, Export { tenant_id: Option<String>, format: ExportFormat, output: Option<PathBuf>, page_size: usize, }, ExportMarkdown { tenant_id: Option<String>, outdir: PathBuf, project_id: Option<String>, include_history: bool, data_dir: Option<PathBuf>, }, ExportOmf { tenant_id: Option<String>, project_id: Option<String>, output: Option<PathBuf>, include_history: bool, include_superseded: bool, include_expired: bool, }, ImportOmf { tenant_id: Option<String>, input: Option<PathBuf>, include_archived: bool, fuzzy_threshold: Option<f32>, dry_run: bool, warm: WarmMode, }, Init { tenant_id: String, project_dir: PathBuf, project_id: Option<String>, memd_command: String, memd_data_dir: Option<PathBuf>, write_agent_files: bool, }, Doctor { project_dir: PathBuf, format: ExportFormat, strict: bool, }, Maintenance { data_dir: Option<PathBuf>, tenant_id: Option<String>, dry_run: bool, aggressive: bool, },
}
Expand description

CLI subcommands for memory operations

Variants§

§

Experience

Linked problems, attempts, executed checks, and conditional lessons.

Fields

§tenant_id: Option<String>
§project_id: Option<String>
§output: Option<PathBuf>
§

Add

Add a memory chunk

Fields

§tenant_id: Option<String>

Tenant identifier

§text: String

Text content of the chunk

§chunk_type: ChunkType

Type of chunk (code, doc, trace, decision, plan, research, message, summary, other)

§project_id: Option<String>

Optional project identifier

§tags: Option<Vec<String>>

Optional tags (comma-separated)

§source_uri: Option<String>

Optional source URI

§source_path: Option<String>

Optional source path

§warm: WarmMode

Route this write through the local warm worker (auto starts one if needed; off runs locally and requires the writer lock; required fails when no worker is reachable)

§

Search

Search memory chunks

Fields

§tenant_id: Option<String>

Tenant identifier

§query: Option<String>

Search query. Also accepts a bare positional argument.

§query_positional: Option<String>

Search query given positionally (memd search "<query>").

§k: usize

Maximum number of results

§project_id: Option<String>

Optional project identifier

§task_id: Option<String>

Optional memd task identifier for retrieval-outcome attribution. Defaults to MEMD_TASK_ID when that variable is set.

§thread_id: Option<String>

Optional native thread identifier for retrieval-outcome attribution. Defaults to the calling client’s observed native thread.

§compact: bool

Use memory.search compact shaping instead of the legacy raw chunk array

§dedupe_by_source: bool

Collapse results sharing a source URI to the best-ranked one, so fragments of one document don’t crowd out other relevant sources

§token_budget: Option<usize>

Approximate result token budget; also enables compact shaping

§mode: CliQueryMode

Retrieval intent for digest-biased searches

§no_text: bool

Omit chunk text from compact output

§include_artifact: bool

Include linked canonical artifacts in compact output

§include_superseded: bool

Include superseded chunks (hidden by default) — for provenance lookups of consolidated lessons.

§format: ExportFormat

Output format

§output: Option<PathBuf>

Output file path (defaults to stdout)

§reranker: SearchReranker

Optional high-quality post-retrieval reranker

§reranker_model: String

Hugging Face model id for the optional MemReranker path

§reranker_device: String

Device for the optional MemReranker path: auto, cuda, cuda:0, or cpu

§reranker_batch_size: usize

Batch size for optional MemReranker inference

§reranker_timeout_seconds: u64

Timeout in seconds for optional MemReranker model load and inference

§reranker_python: String

Python executable used by the optional MemReranker path

§warm: WarmMode

Use the local warm worker for this operation

§

AgentContext

Build a bounded local context file for agents using CLI-only retrieval.

This is the preferred CLI-only orchestration path: a controller runs retrieval before launching the agent, writes a compact context file into the workspace, and the agent reads that file during the solve.

Fields

§tenant_id: Option<String>

Tenant identifier

§project_id: Option<String>

Optional project identifier

§task_id: Option<String>

Optional non-sensitive task identifier attached as plaintext.

§thread_id: Option<String>

Optional non-sensitive thread identifier attached as plaintext.

§query: Vec<String>

Search query. May be repeated; results are merged and deduplicated.

§k: usize

Maximum results per query before deduplication

§token_budget: usize

Approximate token budget per query

§mode: CliQueryMode

Retrieval intent for digest-biased searches

§no_text: bool

Omit chunk text from compact output

§include_artifact: bool

Include linked canonical artifacts in compact output

§format: ExportFormat

Output format

§output: Option<PathBuf>

Output file path (defaults to stdout)

§log_dir: Option<PathBuf>

Optional directory for benchmark/audit JSON logs

§warm: WarmMode

Use the local warm worker for this operation

§

MemoryMd

Refresh a project memory.md file with the highest-priority takeaways.

This is intended for agent session startup. It distills up to 10 project-scoped fact-library items from memd, writes them to memory.md, and prints a JSON summary. Up to 2 machine-wide fact-library items are included by default; tune with --global-limit (0 disables).

Fields

§tenant_id: Option<String>

Tenant identifier. Defaults to .memd/project_scope.json when present.

§project_id: Option<String>

Optional project identifier. Defaults to .memd/project_scope.json.

§project_dir: PathBuf

Project directory containing .memd/project_scope.json

§output: PathBuf

Output path. Relative paths are resolved under --project-dir.

§project_limit: usize

Maximum project-specific takeaways to keep, capped at 10

§global_limit: usize

Maximum machine-wide fact-library items to keep, capped at 10. Defaults to 2; 0 disables the section.

§candidate_k: usize

Unused since scan-first selection considers every stored chunk; kept for CLI compatibility.

§explain_output: Option<PathBuf>

Optional JSON report explaining retrieved candidates, priority score components, and display/filter decisions.

§

EvalMemoryMd

Evaluate default memory.md startup quality against fixed thresholds.

Fields

§tenant_id: Option<String>

Tenant identifier. Defaults to .memd/project_scope.json when present.

§project_id: Option<String>

Optional project identifier. Defaults to .memd/project_scope.json.

§project_dir: PathBuf

Project directory containing .memd/project_scope.json.

§output: PathBuf

Output path for the generated memory.md under evaluation.

§project_limit: usize

Maximum project-specific takeaways to evaluate, capped at 10.

§candidate_k: usize

Unused since scan-first selection considers every stored chunk; kept for CLI compatibility.

§top_n: usize

Number of displayed project takeaways included in useful-ratio scoring.

§min_useful_ratio: f64

Minimum useful displayed-item ratio required for success.

§max_generated_wrappers: usize

Maximum generated wrapper records allowed in displayed project items.

§agent_usefulness: bool

Enable structured startup-briefing usefulness checks.

§gold_file: Option<PathBuf>

Optional JSON file with local project expectations.

§

EvalRetrieval

Evaluate fixed retrieval queries with known useful chunk IDs.

Fields

§tenant_id: String

Tenant identifier.

§project_id: Option<String>

Optional project identifier.

§project_dir: PathBuf

Project directory (resolves default queries and reports).

§queries: Option<PathBuf>

Path to JSONL queries with query and useful_chunk_ids.

§k: usize

Top-k retrieval cutoff for precision and hit-rate metrics.

§min_precision_at_k: f64

Minimum mean precision@k required for success. Defaults to 0 because bundled sparse judgments often cannot reach a fixed precision threshold at k.

§min_hit_rate_at_k: f64

Minimum fraction of queries with at least one useful hit.

§min_known_recall_at_k: f64

Minimum mean recall over known useful chunk IDs.

§min_mrr: f64

Minimum mean reciprocal rank of the first useful hit.

§

EvalWriteQuality

Evaluate synthetic write admission, dedupe, and storage-growth behavior.

Fields

§project_dir: PathBuf

Project directory used only for the eval report output path.

§min_rejection_or_downgrade_rate: f64

Minimum low-value write rejection/downgrade rate.

§min_duplicate_reuse_rate: f64

Minimum exact duplicate reuse rate.

§max_total_chunks: usize

Maximum chunks a synthetic session may leave in its isolated store.

§max_disk_bytes: u64

Maximum isolated persistent-store byte growth for the synthetic session.

§require_retention_compaction: bool

Require the synthetic retention/compaction stage to expire at least one row.

§

Consolidate

Consolidate recent memory chunks into deduplicated lessons.

Builds a working region from chunks written/retrieved since the last run, asks the configured LLM consolidator to rewrite them, and stages hidden kind:consolidated candidates for review. Backend is chosen by MEMD_CONSOLIDATOR.

Fields

§tenant_id: Option<String>

Tenant identifier. Defaults to .memd/project_scope.json or .memd/config.json when present.

§project_id: Option<String>

Optional project identifier. Defaults to the scope file only when –tenant-id is also omitted.

§project_dir: PathBuf

Project directory containing the .memd scope/state files.

§max_region: usize

Maximum chunks in the consolidation working region.

§dry_run: bool

Build and print the prompt without calling the LLM.

§background: bool

Run consolidation in a detached background process.

§force: bool

Consolidate even when the region is below the threshold.

§promote: bool

Promote candidates after deterministic validation. Without this, consolidation stops at a hidden validated candidate.

§legacy_immediate: bool

Preserve the former immediate-promotion behavior for one release.

§warm: WarmMode

Route this write through the local warm worker (auto starts one if needed; off runs locally and requires the writer lock; required fails when no worker is reachable)

§

ConsolidateReview

Inspect, accept, or reject a consolidation run.

Fields

§run_id: Option<String>

Consolidation run UUID returned by memd consolidate.

§tenant_id: Option<String>

Optional tenant scope. Defaults to the current project scope when present.

§project_id: Option<String>

Optional project scope. Defaults to the current project scope when present.

§list: bool

List validated runs awaiting review.

§limit: usize

Maximum staged runs returned by –list.

§accept: bool

Promote the validated candidates and apply their lineage policy.

§reject: bool

Reject the run and keep every candidate hidden.

§warm: WarmMode

Route accept/reject through the local warm worker when available.

§

Outcome

Record a verified task outcome against one retrieval episode.

Only chunks that were rendered in the named episode may be attributed. Agent self-reports are retained for audit but never train ranking.

Fields

§episode_id: String

Retrieval episode UUID returned by search or agent-context.

§tenant_id: Option<String>

Tenant identifier. Defaults to the current project scope.

§outcome: String

Outcome: passed, accepted, corrected, failed, abandoned, observed_used for non-ranking reuse, or verifier_error when the verifier produced no verdict.

§verifier: String

Verifier: user, automated_test, external_tool, task_system, or agent_self_report.

§used: Vec<String>

Rendered chunks that materially helped (comma-separated).

§harmful: Vec<String>

Rendered chunks that caused harm or required correction (comma-separated).

§evidence: Option<String>

Non-sensitive reference to a durable test, task, or tool result.

§event_time_ms: Option<i64>

Event time as Unix epoch milliseconds; defaults to now.

§warm: WarmMode

Route this write through the local warm worker.

§

OutcomeScan

Scan Codex session logs for observed memd retrieval reuse.

Detects tool-call outputs that rendered a retrieval episode, then records served chunks whose distinctive literals appear in later tool-call inputs (commands or patches) of the same session. Writes non-ranking external_tool observed_used events; .memd/data/outcome_scan_state.json keeps re-runs from writing duplicate events.

Fields

§project_dir: PathBuf

Project directory containing .memd/project_scope.json.

§sessions_dir: Option<PathBuf>

Session log directory, scanned recursively for *.jsonl files. Defaults to ~/.codex/sessions.

§since_days: u64

Only scan session files modified within this many days.

§dry_run: bool

Report candidate outcome events without writing events or state.

§

EvalCounterfactual

Counterfactual retrieval eval (Phase 3).

For each query in the benchmark file, runs retrieval twice (full bank vs. kind:consolidated-filtered) and reports the overlap@k loss and mean rank shift. Writes a Markdown report under evals/bench/reports/.

Fields

§tenant_id: String

Tenant identifier.

§project_id: Option<String>

Optional project identifier.

§project_dir: PathBuf

Project directory (resolves default queries file).

§queries: Option<PathBuf>

Path to the JSONL queries file. Defaults to evals/bench/queries/counterfactual_queries.jsonl under the project directory.

§k: usize

Top-k for retrieval comparison.

§

EvalOutcomeRanking

Compare served retrieval order with the outcome-v1 shadow policy.

Query rows declare relevant and harmful chunk IDs. The command records normal privacy-safe retrieval episodes, reconstructs a source-deduped shadow top-k, and writes JSON plus Markdown counterfactual artifacts.

Fields

§tenant_id: String

Tenant identifier.

§project_id: Option<String>

Optional project identifier.

§project_dir: PathBuf

Project directory used to resolve relative paths.

§queries: PathBuf

JSONL query rows with id, query, relevant_chunk_ids, and harmful_chunk_ids.

§k: usize

Top-k for served-versus-shadow comparison.

§report_json: PathBuf

JSON report path. The command also writes a sibling Markdown file.

§

SessionStart

Session-start hook entry point.

Refreshes memory.md synchronously and, when enough chunks have accumulated, spawns a detached background consolidation. Safe to wire into a SessionStart hook for every repo: a missing .memd scope is created automatically unless MEMD_AUTO_SCOPE=0 or a .memd-skip marker disables startup for the repository.

Fields

§project_dir: PathBuf

Project directory containing the .memd scope/state files.

§native_hook: Option<NativeHookHarness>

Read one bounded native SessionStart event from stdin. Only session identity, model, and cwd fields are retained.

§

Call

Invoke a local memd operation by its historical tool name.

This preserves the former structured operation surface without starting an external service. Pass a JSON object with --json or --input; omit both for {}. The result is unwrapped to the operation payload when possible.

Fields

§tool: String

Operation name, for example memory.search or task.start

§json: Option<String>

JSON object containing operation arguments

§input: Option<PathBuf>

File containing a JSON object with operation arguments

§output: Option<PathBuf>

Output file path (defaults to stdout)

§warm: WarmMode

Use the local warm worker for this operation

§

Batch

Run local operation calls from JSONL in one process.

Each non-empty input line must be a JSON object with tool and optional arguments. Results are emitted as JSONL with one row per input line.

Fields

§jsonl: Option<PathBuf>

JSONL input file. Omit or pass - to read stdin.

§stream: bool

Keep stdin/stdout open and process one JSONL request per line.

§continue_on_error: bool

Keep processing after a failed input line or operation.

§output: Option<PathBuf>

Output file path (defaults to stdout)

§warm: WarmMode

Route this write through the local warm worker (auto starts one if needed; off runs locally and requires the writer lock; required fails when no worker is reachable)

§

Warm

Manage the local warm worker used by --warm auto|required.

Fields

§command: WarmCommand
§

WarmWorker

Internal warm worker entrypoint. Not an agent-facing interface.

Fields

§socket: PathBuf

Unix socket path to listen on.

§embedding_model: Option<String>

Embedding-model identity this worker serves, injected by the parent before dispatch (not parsed from argv). Reported in the ping identity so a client requesting a different model respawns it.

§search_variant: Option<String>

Search-variant identity this worker serves (injected, see above).

§

Get

Get a chunk by ID

Fields

§tenant_id: Option<String>

Tenant identifier

§chunk_id: Option<String>

Chunk identifier (UUID). Also accepts a bare positional argument.

§chunk_id_positional: Option<String>

Chunk identifier given positionally (memd get <chunk-id>).

§

Delete

Delete a chunk (soft delete)

Fields

§tenant_id: Option<String>

Tenant identifier

§chunk_id: String

Chunk identifier (UUID)

§warm: WarmMode

Route this write through the local warm worker (auto starts one if needed; off runs locally and requires the writer lock; required fails when no worker is reachable)

§

Stats

Show statistics for a tenant

Fields

§tenant_id: Option<String>

Tenant identifier

§

Audit

Audit memory storage and signal quality by tenant/project.

Reports storage footprint, scope distribution, generated-digest noise, duplicate health, age buckets, and project-id alias candidates. Use this before cleanup or retention changes.

Fields

§tenant_id: Option<String>

Optional tenant identifier. Omit to scan every known tenant.

§project_id: Option<String>

Optional project identifier filter.

§format: ExportFormat

Output format.

§strict: bool

Exit with code 2 when unreadable_active_chunks > 0.

§output: Option<PathBuf>

Output file path (defaults to stdout).

§page_size: usize

Pagination size for chunk scans.

§duplicate_examples: usize

Maximum duplicate examples to request from persistent health snapshots.

§top_projects: usize

Maximum project rows to render per tenant.

§

Report

Usefulness & self-diagnosis report from the usage ledger and store metadata.

Fields

§tenant_id: Option<String>

Optional tenant identifier. Omit to scan every known tenant.

§project_id: Option<String>

Optional project identifier filter.

§since: String

Time window: Nd (days) or Nh (hours), e.g. 7d, 24h, 30d.

§format: ReportFormat

Output format.

§strict: bool

Exit with code 2 when any [warn] self-diagnosis line is present.

§top: usize

Max learning-digest entries.

§output: Option<PathBuf>

Output file path (defaults to stdout).

§warm: WarmMode

Warm-worker routing.

§

CleanupPlan

Build a non-destructive cleanup approval plan.

Classifies tenants/projects for archive review, hidden-row purge readiness, high generated-digest noise, and missing project scope. Emits command previews only; it never deletes or rewrites data.

Fields

§tenant_id: Option<String>

Optional tenant identifier. Omit to scan every known tenant.

§project_id: Option<String>

Optional project identifier filter.

§project_dir: PathBuf

Project directory used for generated verification commands.

§format: ExportFormat

Output format.

§output: Option<PathBuf>

Output file path (defaults to stdout).

§archive_dir: PathBuf

Archive directory shown in generated command previews.

§older_than_days: u64

Only suggest hard-purge commands for hidden rows older than this grace period.

§candidate_limit: usize

Maximum hidden-row purge candidates to inspect per tenant.

§page_size: usize

Pagination size for active chunk scans.

§top_projects: usize

Maximum project rows to render per tenant.

§

Purge

Archive and hard-purge old hidden chunks from metadata and indexes.

Defaults to dry-run. Destructive cleanup requires --apply and --archive; eligible rows are soft-deleted and index-pruned before metadata rows are physically removed.

Fields

§tenant_id: String

Tenant identifier.

§project_id: Option<String>

Optional project identifier filter.

§older_than_days: u64

Only purge hidden rows older than this grace period.

§limit: usize

Maximum candidate rows to process in this run.

§include_unreadable_active: bool

Also include live metadata rows whose segment payload cannot be read.

§archive: Option<PathBuf>

Archive path written before any destructive --apply mutation.

§apply: bool

Apply the purge. Omit for dry-run.

§vacuum_metadata: bool

Run SQLite metadata VACUUM after metadata rows are removed.

§rewrite_segments: bool

Rewrite finalized segment files after metadata purge to reclaim tombstoned payload bytes.

§warm: WarmMode

Route this write through the local warm worker (auto starts one if needed; off runs locally and requires the writer lock; required fails when no worker is reachable)

§

PurgeArchive

Inspect and verify a purge archive without writing to the store.

Use this after memd purge --apply --archive <path> writes an archive and before trusting any destructive cleanup result.

Fields

§archive: PathBuf

Archive path written by memd purge --archive.

§expect_tenant_id: Option<String>

Optional tenant id that the archive must contain.

§expect_project_id: Option<String>

Optional project id that the archive must contain.

§min_records: Option<usize>

Optional minimum number of records required in the archive.

§format: ExportFormat

Output format.

§output: Option<PathBuf>

Output file path (defaults to stdout).

§

Export

Export all tenant chunks in a human-readable or machine-readable format

Fields

§tenant_id: Option<String>

Tenant identifier

§format: ExportFormat

Export format

§output: Option<PathBuf>

Output file path (defaults to stdout when omitted)

§page_size: usize

Pagination size for chunk collection

§

ExportMarkdown

Export tenant chunks as a tree of markdown files.

Uses G1’s render_markdown_tree (one file per (project, chunk_type) bucket) and writes each (path, content) under <outdir> on the user’s machine. Refuses to write if the normalised <outdir> is a descendant of memd’s data directory, because writing a markdown tree into $MEMD_DATA_DIR would silently corrupt segment / SQLite layouts.

Fields

§tenant_id: Option<String>

Tenant identifier

§outdir: PathBuf

Output directory. Created if missing. Must not be inside memd’s data directory.

§project_id: Option<String>

Optional project filter

§include_history: bool

Include history-tier rows (default: live-only)

§data_dir: Option<PathBuf>

Data directory used for the containment guard. Defaults to ~/.memd/data; typically set by a wrapper when the daemon’s data dir lives elsewhere.

§

ExportOmf

Export tenant memory as an OMF 1.0 JSON document.

Writes to --output if provided, else stdout. The opened path is honoured as-is; CLI callers are already on the writer side, so there is no data-dir containment guard.

Fields

§tenant_id: Option<String>

Tenant identifier

§project_id: Option<String>

Optional project filter

§output: Option<PathBuf>

Output file path (defaults to stdout when omitted)

§include_history: bool

Include history-tier rows (default: live-only)

§include_superseded: bool

Include rows whose status is Superseded

§include_expired: bool

Include rows whose status is Expired (or whose expires_at_ms has passed)

§

ImportOmf

Import an OMF 1.0 JSON document into a tenant.

Reads the document from --input (or stdin if - / omitted). Use --dry-run for a read-only preview that reports counts without writing.

Fields

§tenant_id: Option<String>

Tenant identifier

§input: Option<PathBuf>

Input file path. - or omitted reads from stdin.

§include_archived: bool

Include items whose top-level status is “archived” or “expired”

§fuzzy_threshold: Option<f32>

Optional trigram Jaccard threshold. Absent = exact-canonical only.

§dry_run: bool

Preview only — compute counts without writing.

§warm: WarmMode

Route this write through the local warm worker (auto starts one if needed; off runs locally and requires the writer lock; required fails when no worker is reachable)

§

Init

Initialize memd CLI guardrails for agent workflows

Fields

§tenant_id: String

Tenant identifier to enforce in generated policies

§project_dir: PathBuf

Project directory where guardrail files will be written

§project_id: Option<String>

Explicit project identifier to pin for this repository

§memd_command: String

memd CLI command used in generated guardrails

§memd_data_dir: Option<PathBuf>

Optional data directory used for tenant scope discovery and docs

§write_agent_files: bool

Write/refresh AGENTS.md and CLAUDE.md guardrail sections

§

Doctor

Diagnose host wiring and per-repo scope.

Reports the state of: memd binary discovery, data directory, global agent rules (Claude / Codex / Cursor), Claude SessionStart hook, and the current project’s .memd scope. By default this is informational and exits 0; use --strict to fail when any doctor check fails.

Fields

§project_dir: PathBuf

Project directory to inspect for .memd/project_scope.json.

§format: ExportFormat

Output format. markdown (default) renders a human-readable report with stable [ok]/[--] prefixes; json emits the raw structured report.

§strict: bool

Exit with code 2 when any doctor check fails.

§

Maintenance

Disk hygiene: sweep orphan HNSW snapshots and, with –aggressive, force-merge the global sparse index. Takes the data-directory writer lock. Output uses key:value lines for shell parsing.

Fields

§data_dir: Option<PathBuf>

Data directory (defaults to the top-level –data-dir or ~/.memd/data).

§tenant_id: Option<String>

Restrict the HNSW orphan sweep to one tenant directory. The aggressive sparse-index merge remains global.

§dry_run: bool

Report what would change without modifying disk.

§aggressive: bool

Sweep orphans and force-merge the global sparse index. This can temporarily require space for both the old and merged segments.

Implementations§

Source§

impl CliCommand

Source

pub fn normalize_positional_aliases(&mut self)

Fold positional aliases into their long-option fields so every downstream consumer sees a single canonical source. Clap cannot make one argument both positional and --long, so the positional arrives in a separate field; the two are mutually exclusive at parse time.

Source

pub fn store_access(&self) -> StoreAccess

Source

pub fn requires_store(&self) -> bool

Whether this command needs an initialized backing store.

Source

pub fn warm_mode(&self) -> Option<WarmMode>

Warm mode for commands that can be served by the local warm worker.

Trait Implementations§

Source§

impl Clone for CliCommand

Source§

fn clone(&self) -> Self

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 CliCommand

Source§

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

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

impl FromArgMatches for CliCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for CliCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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<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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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