pub enum Command {
Show 80 variants
Serve(ServeArgs),
Mcp {
tier: String,
profile: Option<String>,
},
Store(StoreArgs),
Update(UpdateArgs),
Recall(RecallArgs),
Search(SearchArgs),
Get(GetArgs),
List(ListArgs),
Delete(DeleteArgs),
Promote(PromoteArgs),
Forget(ForgetArgs),
Link(LinkArgs),
Consolidate(ConsolidateArgs),
Gc,
Stats,
Namespaces,
Namespace(NamespaceArgs),
Config(ConfigCliArgs),
Export,
Import(ImportArgs),
Resolve(ResolveArgs),
Shell,
Sync(SyncArgs),
SyncDaemon(SyncDaemonArgs),
AutoConsolidate(AutoConsolidateArgs),
Completions(CompletionsArgs),
Man,
Mine(MineArgs),
Archive(ArchiveArgs),
Agents(AgentsArgs),
Identity(IdentityArgs),
Offload(OffloadArgs),
Deref(DerefArgs),
Rules(RulesArgs),
Pending(PendingArgs),
Backup(BackupArgs),
Restore(RestoreArgs),
Curator(CuratorArgs),
Bench(BenchArgs),
Doctor(DoctorCliArgs),
Boot(BootArgs),
Install(InstallArgs),
Wrap(WrapArgs),
Logs(LogsArgs),
Audit(AuditArgs),
Governance(GovernanceCliArgs),
VerifyReflectionChain(VerifyChainArgs),
VerifySignedEventsChain(VerifySignedEventsChainArgs),
ExportForensicBundle(ExportForensicBundleArgs),
VerifyForensicBundle(VerifyForensicBundleArgs),
ExportReflections(ExportReflectionsArgs),
RecoverPreviousSession(RecoverPreviousSessionArgs),
Atomise(AtomiseArgs),
Persona(PersonaArgs),
Calibrate(CalibrateArgs),
Skill(SkillArgs),
Share(ShareArgs),
KgQuery(KgQueryArgs),
FindPaths(FindPathsArgs),
RecallObservations(RecallObservationsArgs),
Expand(ExpandArgs),
CheckDuplicate(CheckDuplicateArgs),
Reembed(ReembedArgs),
Replay(ReplayArgs),
Reflect(ReflectArgs),
Subscribe(SubscribeArgs),
Unsubscribe(UnsubscribeArgs),
ListSubscriptions(ListSubscriptionsArgs),
SubscriptionReplay(SubscriptionReplayArgs),
SubscriptionDlqList(SubscriptionDlqListArgs),
Notify(NotifyArgs),
Inbox(InboxArgs),
IngestMultistep(IngestMultistepArgs),
KgInvalidate(KgInvalidateArgs),
KgTimeline(KgTimelineArgs),
EntityRegister(EntityRegisterArgs),
EntityGetByAlias(EntityGetByAliasArgs),
DependentsOfInvalidated(DependentsOfInvalidatedArgs),
ReflectionOrigin(ReflectionOriginArgs),
QuotaStatus(QuotaStatusArgs),
}Variants§
Serve(ServeArgs)
Start the HTTP memory daemon.
Tier resolution. Unlike mcp / store / recall, the
serve subcommand does NOT accept a --tier flag. The
daemon’s effective feature tier is resolved from the tier
field in config.toml, falling back to the compiled-in
default (semantic). For per-invocation tier overrides use
the mcp / store / recall subcommands, which expose
--tier directly. See docs/ADMIN_GUIDE.md §“Feature tiers”
and issue #703 for the rationale (a long-running daemon owns
embedder / LLM resources that are expensive to swap mid-run,
so tier is fixed at startup via configuration).
Mcp
Run as an MCP (Model Context Protocol) tool server over stdio
Fields
profile: Option<String>v0.6.4 — Tool surface profile. One of core, graph, admin,
power, full, or a comma-separated custom list (e.g.,
core,graph,archive). Default core (7 tools at v0.7.0:
the original 5 + memory_load_family + memory_smart_load).
Resolution order: this CLI flag > AI_MEMORY_PROFILE env >
[mcp].profile in config.toml > core. Set --profile full
to expose every family — at v0.7.0,
Profile::full().expected_tool_count() returns 74 (canonical
SSOT; pinned by profile_full_matches_registry_all against
crate::mcp::registry::tool_names::ALL.len()). The 74
advertised entries decompose as 73 callable “memory tools”
plus the always-on memory_capabilities bootstrap; the
build_capabilities_summary “{n} memory tools” phrasing
reports the 73 memory-tool count to reconcile with the
user-facing summary (see issue #862 for the disambiguation).
Store(StoreArgs)
Store a new memory
Update(UpdateArgs)
Update an existing memory by ID
Recall(RecallArgs)
Recall memories relevant to a context
Search(SearchArgs)
Search memories by text
Get(GetArgs)
Retrieve a memory by ID
List(ListArgs)
List memories
Delete(DeleteArgs)
Delete a memory by ID
Promote(PromoteArgs)
Promote a memory to long-term
Forget(ForgetArgs)
Delete memories matching a pattern
Link(LinkArgs)
Link two memories
Consolidate(ConsolidateArgs)
Consolidate multiple memories into one
Gc
Run garbage collection
Stats
Show statistics
Namespaces
List all namespaces
Namespace(NamespaceArgs)
v0.7.0 (issue #800) — operator CRUD for the per-namespace
standard policy memory pointer (Batman Mode Crack 1). Three
verbs: set-standard / get-standard / clear-standard, plus
the batman-policy helper that prints the canonical Batman
GovernancePolicy JSON blob. Closes the friction that kept
Batman Forms 2 + 6 dormant on most installs by replacing the
MCP-stdio JSON-RPC dance with first-class CLI surface.
Config(ConfigCliArgs)
v0.7.x (#1146) — enterprise configuration tooling.
ai-memory config migrate rewrites a legacy v1 (flat-field)
config.toml to the v2 sectioned shape ([llm], [embeddings],
[reranker], [storage]) with a timestamped .bak backup.
--dry-run prints the diff without writing.
--also-clean-claude-json additionally removes the
mcpServers.<*>.env block from ~/.claude.json after the
operator has verified the new config.
Export
Export all memories as JSON
Import(ImportArgs)
Import memories from JSON (stdin)
Resolve(ResolveArgs)
Resolve a contradiction — mark one memory as superseding another
Shell
Interactive memory shell (REPL)
Sync(SyncArgs)
Sync memories between two database files
SyncDaemon(SyncDaemonArgs)
Run the peer-to-peer sync daemon — continuously exchange memories
with one or more HTTP peers (Phase 3 Task 3b.1). The defining
grand-slam capability: two agents on two machines form a live
knowledge mesh with no cloud, no login, no SaaS.
AutoConsolidate(AutoConsolidateArgs)
Auto-consolidate short-term memories by namespace
Completions(CompletionsArgs)
Generate shell completions
Man
Generate man page
Mine(MineArgs)
Import memories from historical conversations (Claude, ChatGPT, Slack exports)
Archive(ArchiveArgs)
Manage the memory archive (list, restore, purge, stats)
Agents(AgentsArgs)
Register or list agents (Task 1.3)
Identity(IdentityArgs)
v0.7 (Track H, Task H1) — per-agent Ed25519 keypair lifecycle.
generate / import / list / export-pub against the local
key directory (default <config>/ai-memory/keys). Hardware-backed
key storage (TPM/HSM/Secure Enclave) is out of OSS scope and
lives in the AgenticMem commercial layer.
Offload(OffloadArgs)
v0.7.0 QW-3 — context-offload substrate primitive. Persists a
file (or - for stdin) into the offloaded_blobs substrate
and prints the short ref_id callers keep in their working
window. Pairs with ai-memory deref <ref_id>.
Deref(DerefArgs)
v0.7.0 QW-3 — dereference a previously-offloaded ref_id.
Refuses tampered rows (SHA-256 mismatch). Pairs with
ai-memory offload <file>.
Rules(RulesArgs)
v0.7.0 (issue #691) — substrate-level agent-action rules engine.
CRUD over the governance_rules table consulted by
check_agent_action. Mutation verbs (add/enable/disable/remove)
require the operator’s Ed25519 keypair on disk at
<key-dir>/operator.priv (mode 0600); without --sign they
refuse with governance.no_operator_key. Read verbs (list /
check) are unprivileged.
Pending(PendingArgs)
List / approve / reject governance-pending actions (Task 1.9)
Backup(BackupArgs)
v0.6.0.0: snapshot the SQLite database to a timestamped backup
file. Uses SQLite VACUUM INTO which is hot-backup safe (no daemon
stop required). Writes a manifest.json alongside (sha256 + version).
Restore(RestoreArgs)
v0.6.0.0: restore the SQLite database from a backup file written
by ai-memory backup. Verifies the manifest sha256 before
replacing the current DB. The current DB is moved aside as a safety
net before the replacement.
Curator(CuratorArgs)
v0.6.1: run the autonomous curator. --once runs a single sweep
and prints a JSON report; --daemon loops with --interval-secs
between cycles. Auto-tags memories without tags and flags
contradictions against nearby siblings in the same namespace.
Bench(BenchArgs)
v0.6.3 (Pillar 3 / Stream E): run the canonical performance
workload and print measured p50/p95/p99 against the budgets in
PERFORMANCE.md. Each invocation seeds a disposable temp DB so
the user’s main DB is untouched. Exits non-zero when any p95
exceeds its budget by more than the published 10% tolerance.
Doctor(DoctorCliArgs)
v0.6.3.1 (P7 / R7): operator-visible health dashboard. Reads
Capabilities v2 (P1) + data integrity surfaces (P2) + recall
observability (P3). With --remote <url> becomes a fleet doctor
at T3+. Read-only — never mutates the database. Exits 0 on a
healthy report, 2 on critical findings, and 1 on warnings when
--fail-on-warn is passed.
Boot(BootArgs)
Issue #487: emit session-boot context. Universal primitive every
AI-agent integration recipe (Claude Code SessionStart hook, Cursor /
Cline / Continue / Windsurf system-message, Codex / Apps SDK /
Agent SDK programmatic prepend, OpenClaw built-in, local models
via LM Studio / Ollama / vLLM) calls before the agent’s first turn.
Read-only, fast, never blocks. With --quiet (recommended for
hooks) a missing DB exits 0 with empty stdout.
Install(InstallArgs)
Issue #487 PR-2: wire ai-memory boot and the ai-memory-mcp
server into AI agents’ config files (Claude Code SessionStart hook,
Cursor / Cline / Continue / Windsurf / OpenClaw MCP config). Default
is --dry-run (prints the diff, writes nothing). Pass --apply to
commit. Pass --uninstall --apply to remove a previously-installed
managed block.
Wrap(WrapArgs)
Issue #487 PR-6: cross-platform Rust replacement for the bash /
PowerShell wrappers PR-1 shipped in the integration recipes. Runs
ai-memory boot in-process, builds a system message, then spawns
the named agent CLI with the system message delivered via the
strategy chosen by default_strategy(<agent>) (or an explicit
--system-flag / --system-env / --message-file-flag
override). Exit code is propagated from the wrapped agent.
Logs(LogsArgs)
Issue #487 PR-5: operator-facing CLI for the operational logging
facility (tail, cat, archive, purge). Default-OFF — emits
nothing useful unless [logging] enabled = true is set in
config.toml.
Audit(AuditArgs)
Issue #487 PR-5: operator-facing CLI for the security audit
trail (verify, tail, path). Default-OFF — emits nothing
useful unless [audit] enabled = true is set in config.toml.
Governance(GovernanceCliArgs)
v0.7.0 K11 — translate legacy [governance] policies in
config.toml into the v0.7 [[permissions.rules]] (K9) format.
Default mode is dry-run: prints to stdout. Pass --config-out PATH to write the rendered block to a file (or merge in-place
when PATH matches the loaded config).
VerifyReflectionChain(VerifyChainArgs)
v0.7.0 L1-3 — external verifier for reflection chains
(procurement-grade audit tool). Walks reflects_on edges
backward from <memory_id> to depth 0, verifies each
Ed25519 signature, and emits a structured chain-integrity
report. Exit 0 if fully verified; non-zero otherwise.
VerifySignedEventsChain(VerifySignedEventsChainArgs)
v0.7.0 V-4 closeout (#698) — walk the SQL-side signed_events
cross-row hash chain (schema v34) and emit a structured
report. Distinct from verify-reflection-chain (which walks
reflects_on edges) and from audit verify (which walks the
JSONL audit log). Exit 0 if the chain holds; 1 on chain
break.
ExportForensicBundle(ExportForensicBundleArgs)
v0.7.0 L2-5 (issue #670) — export a procurement-grade forensic
evidence bundle (signed tarball) for a memory and its
reflection chain. The OSS surface for the AgenticMem Attest
tier; see crate::forensic::bundle for the bundle layout.
VerifyForensicBundle(VerifyForensicBundleArgs)
v0.7.0 L2-5 (issue #670) — verify a forensic evidence bundle.
Re-hashes every file, checks the manifest signature when
present, and re-verifies every edge signature against the
bundled observed_by public key.
ExportReflections(ExportReflectionsArgs)
v0.7.0 QW-1 — write every reflection memory to a file under
~/.ai-memory/reflections/<namespace>/<id>.md (or .json with
--format json) so operators can cat what the substrate has
synthesised without learning SQL. The on-disk artefact is
derived; the SQL row stays canonical.
RecoverPreviousSession(RecoverPreviousSessionArgs)
v0.7.0 (issue #1389) — fail-safe recovery of agent context
from a host’s per-turn transcript file when the previous
session terminated ungracefully (SIGKILL, tmux lockup, host
crash) between turns. Closes the #1388 substrate failure
mode. Designed for SessionStart-hook chaining after
ai-memory boot; the in-session counterpart is the
memory_recover_previous_session MCP tool.
Atomise(AtomiseArgs)
v0.7.0 WT-1-F — operator-side wrapper over the atomisation
engine (crate::atomisation::Atomiser). Decomposes one
long-form memory into atomic propositions; surfaces every
substrate failure with a stable exit code (see
crate::cli::commands::atomise::exit_code).
Persona(PersonaArgs)
v0.7.0 QW-2 — fetch (or regenerate) the Persona artefact for
an entity. Read-only by default; pass --regenerate to run
the curator and persist a fresh row.
Calibrate(CalibrateArgs)
v0.7.0 Form 5 (issue #758) — calibration driver verbs.
ai-memory calibrate confidence --from-shadow reads
confidence_shadow_observations and emits per-(namespace,
source) baselines computed over the window.
Skill(SkillArgs)
v0.7.0 Cluster E API-2 (issue #767) — ai-memory skill <register|list|get|resource|export|promote|compose> CLI parity
surface for the 7 L1-5 Agent Skills MCP tools. Dispatches into
the same substrate handlers (re-exported under
crate::mcp::handle_skill_*); no business logic is duplicated.
v0.7.0 #1095 — ai-memory share subcommand. Closes the SR-4
three-surface-parity gap. Copies a memory into the recipient
agent’s shared namespace _shared/<from>→<to>/ via the same
substrate primitive the MCP tool (memory_share) and HTTP
route (POST /api/v1/share) consume — guaranteeing byte-equal
envelopes across the three surfaces.
KgQuery(KgQueryArgs)
v0.7.0 ARCH-3 / FX-12 — ai-memory kg-query subcommand.
Outbound KG traversal from a source memory (<=5 hops). CLI
parity for the MCP memory_kg_query tool.
FindPaths(FindPathsArgs)
v0.7.0 ARCH-3 / FX-12 — ai-memory find-paths subcommand.
Enumerate up to N paths through the KG between two memories
(BFS, max_depth<=7). CLI parity for memory_find_paths.
RecallObservations(RecallObservationsArgs)
v0.7.0 ARCH-3 / FX-12 — ai-memory recall-observations
subcommand. List rows from the recall-consumption ledger
(#886). CLI parity for memory_recall_observations.
Expand(ExpandArgs)
v0.7.0 #1443 — ai-memory expand subcommand. LLM query-expansion
over a free-text query. CLI parity for the MCP
memory_expand_query tool + the POST /api/v1/expand_query HTTP
route — all three share crate::mcp::handle_expand_query. Lets
a harness inject expansion as a one-shot without an MCP stdio
server or HTTP daemon. Requires a configured LLM (any tier via
AI_MEMORY_LLM_BACKEND, or smart/autonomous preset).
CheckDuplicate(CheckDuplicateArgs)
v0.7.0 ARCH-3 / FX-12 — ai-memory check-duplicate
subcommand. Pre-write near-duplicate check via cosine over
stored embeddings. CLI parity for memory_check_duplicate.
Requires the embedder (semantic tier or above).
Reembed(ReembedArgs)
v0.7.0 #1598 — ai-memory reembed subcommand. Full-corpus
vector-space migration: re-embeds every live memory (optionally
--namespace-filtered) with the resolved embedding
backend/model and REPLACES the stored vectors (unlike the boot
backfill, which only fills missing ones). --dry-run prints
the plan; per-row #1595 failure isolation (skip-with-WARN)
keeps one poison row from stopping the sweep. Resolves the
embedder via the same AppConfig::resolve_embeddings() +
Embedder::from_resolved path as daemon/MCP boot.
Replay(ReplayArgs)
v0.7.0 ARCH-3 / FX-12 — ai-memory replay subcommand.
Reconstruct the conversation transcript chain that produced a
memory. CLI parity for memory_replay.
Reflect(ReflectArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory reflect. CLI
parity for memory_reflect. CLI dispatcher uses
active_keypair=None / embedder=None; operators who need
signing or LLM dedup drive the daemon via MCP / HTTP.
Subscribe(SubscribeArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory subscribe. CLI
parity for memory_subscribe.
Unsubscribe(UnsubscribeArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory unsubscribe. CLI
parity for memory_unsubscribe.
ListSubscriptions(ListSubscriptionsArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory list-subscriptions.
CLI parity for memory_list_subscriptions.
SubscriptionReplay(SubscriptionReplayArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory subscription-replay.
CLI parity for memory_subscription_replay.
SubscriptionDlqList(SubscriptionDlqListArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory subscription-dlq-list.
CLI parity for memory_subscription_dlq_list.
Notify(NotifyArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory notify. CLI
parity for memory_notify.
Inbox(InboxArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory inbox. CLI
parity for memory_inbox.
IngestMultistep(IngestMultistepArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory ingest-multistep.
CLI parity for memory_ingest_multistep. CLI dispatcher passes
handler=None; tier-locked advisory returns on every tier
because the CLI does not own the LLM dispatch.
KgInvalidate(KgInvalidateArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory kg-invalidate.
CLI parity for memory_kg_invalidate.
KgTimeline(KgTimelineArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory kg-timeline. CLI
parity for memory_kg_timeline.
EntityRegister(EntityRegisterArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory entity-register.
CLI parity for memory_entity_register.
EntityGetByAlias(EntityGetByAliasArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory entity-get-by-alias.
CLI parity for memory_entity_get_by_alias.
DependentsOfInvalidated(DependentsOfInvalidatedArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory dependents-of-invalidated.
CLI parity for memory_dependents_of_invalidated.
ReflectionOrigin(ReflectionOriginArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory reflection-origin.
CLI parity for memory_reflection_origin.
QuotaStatus(QuotaStatusArgs)
v0.7.0 ARCH-3 / FX-C3 (batch2) — ai-memory quota-status. CLI
parity for memory_quota_status.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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