Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 32 variants RetiredHook, Serve {
Show 13 fields db_dir: PathBuf, addr: SocketAddr, ui: ServeUi, demo_if_empty: bool, token: Option<String>, role_tokens: Vec<(String, String)>, snapshot_every: Option<Duration>, shutdown_timeout: Duration, restore_from: Option<PathBuf>, tls_cert: Option<PathBuf>, tls_key: Option<PathBuf>, bolt: BoltFlags, tx: TxFlags,
}, Mcp { db_dir: Option<PathBuf>, auto: bool, all_tools: bool, }, Stats { db_dir: PathBuf, }, Demo { db_dir: PathBuf, }, AsOf { db_dir: PathBuf, commit: Option<u64>, at: Option<String>, query: Option<String>, file: Option<PathBuf>, stdin: bool, namespace: Option<String>, }, Suggest { db_dir: PathBuf, }, Algo { db_dir: PathBuf, subcmd: AlgoSubcmd, top: usize, dir: AlgoDir, edge_types: Vec<String>, weight_prop: Option<String>, min_weight: Option<f64>, }, Query { db_dir: PathBuf, cypher: String, file: Option<PathBuf>, stdin: bool, role: Option<String>, namespace: Option<String>, }, Snapshot { db_dir: PathBuf, wal: WalDisposition, retention: Option<u32>, }, BuildIndex { db_dir: PathBuf, rule: Option<String>, }, SchemaApply { db_dir: PathBuf, schema_file: Option<PathBuf>, memory_defaults: bool, memory_identity: bool, }, SchemaList { db_dir: PathBuf, what: SchemaListing, }, Migrate { db_dir: PathBuf, }, KeysAdd { db_dir: PathBuf, name: String, tier: String, role: Option<String>, }, KeysHash, Verify { db_dir: PathBuf, }, Backup { db_dir: PathBuf, dest: PathBuf, }, RestoreS3 { from: String, at: Option<String>, into: Option<PathBuf>, }, Export { db_dir: PathBuf, dest: PathBuf, format: ExportFormat, }, Import { db_dir: PathBuf, inputs: ImportInputs, opts: ImportOptions, }, IngestGit { db_dir: PathBuf, opts: IngestGitOpts, }, Install(InstallOpts), Uninstall(InstallOpts), Disable(ToggleOpts), Enable(ToggleOpts), Doctor(DoctorOpts), Recall { db_dir: Option<PathBuf>, auto: bool, }, Brief { db_dir: Option<PathBuf>, auto: bool, }, Why { db_dir: PathBuf, a: String, b: String, }, Version, Help,
}
Expand description

Parsed mushroomdb invocation.

No Eq derive: Algo { min_weight: Option<f64>, .. } carries a float.

Variants§

§

RetiredHook

A hook body 0.6 installed and 0.7 retired: touch, intercept, impact-hook and enrich in the assistant’s settings, sync in the git hooks. A machine that upgraded without re-running install still calls them, so each is accepted with any arguments, opens nothing, prints nothing and exits 0. mushroomdb doctor lists any that remain and install removes them. Never in usage.

§

Serve

Fields

§db_dir: PathBuf
§demo_if_empty: bool

If the db dir is missing or empty, run run_demo before serving. Docker’s default CMD uses this so a fresh volume is ready on first boot.

§token: Option<String>

Bearer token for non-loopback binds. Loopback may omit it.

§role_tokens: Vec<(String, String)>

Role-bound tokens from --role-token TOKEN:ROLE flags. Merged with MUSHROOMDB_ROLE_TOKENS env var in main before serving.

§snapshot_every: Option<Duration>

Periodic snapshot cadence. None = off (default).

§shutdown_timeout: Duration

--shutdown-timeout-secs: the whole graceful shutdown (drain, snapshot, backup flush, lease release) must finish within this. Default DEFAULT_SHUTDOWN_TIMEOUT_SECS.

§restore_from: Option<PathBuf>

Seed an empty db_dir from the newest backup under this directory before opening it. See restore_if_empty. None = off (default).

§tls_cert: Option<PathBuf>

Path to PEM certificate for native TLS (--tls-cert). Requires --tls-key.

§tls_key: Option<PathBuf>

Path to PEM private key for native TLS (--tls-key). Requires --tls-cert.

§bolt: BoltFlags

The --bolt-* flags; resolved against the environment by serve_bolt::resolve_bolt_settings.

§tx: TxFlags

--tx-max, --tx-timeout-secs, --tx-max-lifetime-secs: the HTTP transaction limits; resolved against the environment by resolve_tx_limits.

§

Mcp

Fields

§db_dir: Option<PathBuf>

None with auto set: resolved by resolve_auto_db at run time.

§auto: bool
§all_tools: bool

--all-tools: advertise every served tool in tools/list rather than the association tools every store lists by default. The rest are callable either way; the flag decides what is listed, and what every session pays for before its first turn.

§

Stats

Fields

§db_dir: PathBuf
§

Demo

Fields

§db_dir: PathBuf
§

AsOf

Read-only view of the database at a past commit.

Fields

§db_dir: PathBuf
§commit: Option<u64>

0-based WAL commit index to replay up to (inclusive).

Exactly one of commit and at is set — the parser refuses both and refuses neither, because a precedence rule between them is how a caller ends up believing it asked for a date while the engine answered a commit.

§at: Option<String>

RFC 3339 date to replay up to, resolved against the store’s recorded commit times once it is open.

§query: Option<String>

Optional Cypher read query to execute against the as-of view.

§file: Option<PathBuf>

Read the Cypher statement from this file instead of --query.

§stdin: bool

Read the Cypher statement from standard input instead of --query.

§namespace: Option<String>

Read only this namespace, as it was at that commit.

§

Suggest

Profile the database and suggest linking rules with estimated edge counts.

Fields

§db_dir: PathBuf
§

Algo

Run a graph algorithm (pagerank / wcc / degree / communities).

Fields

§db_dir: PathBuf
§subcmd: AlgoSubcmd
§top: usize

Print only the top N results (0 = all).

§dir: AlgoDir

Edge direction for degree/pagerank (out / in / both). Ignored by wcc and communities, which are always undirected.

§edge_types: Vec<String>

communities only: restrict to the union of these edge types (--edge-type T, repeatable). Empty means all edge types.

§weight_prop: Option<String>

communities only: edge property to read as the edge weight.

§min_weight: Option<f64>

communities only: drop edges below this resolved weight.

§

Query

Run a Cypher query (read or write).

Fields

§db_dir: PathBuf
§cypher: String

Positional after dir (remaining args joined), or --query.

§file: Option<PathBuf>

Read the statement from this file (--file), instead of cypher.

§stdin: bool

Read the statement from standard input (--stdin), instead of cypher.

§role: Option<String>

Answer as one of the store’s roles: only the nodes it may see.

§namespace: Option<String>

Answer from one namespace only. Intersects role — never widens it.

§

Snapshot

Write snapshot.bin. The WAL is archived unless told otherwise.

Fields

§db_dir: PathBuf
§retention: Option<u32>

Keep the newest N archives; prune oldest at snapshot time. None = unlimited. Applies only when the WAL is archived.

§

BuildIndex

Drive any outstanding vector-index build to completion.

Fields

§db_dir: PathBuf
§rule: Option<String>

Build only this rule; None builds every pending one.

§

SchemaApply

Apply a JSON schema file idempotently (schema apply <db-dir> <schema.json>), the built-in memory schema (schema apply <db-dir> --memory-defaults), or the identity preset (schema apply <db-dir> --memory-identity).

Fields

§db_dir: PathBuf
§schema_file: Option<PathBuf>

None when a built-in was named instead.

§memory_defaults: bool
§memory_identity: bool
§

SchemaList

List the declared indexes (schema indexes <db-dir>) or unique constraints (schema constraints <db-dir>) as a table.

Fields

§db_dir: PathBuf
§

Migrate

Migrate an old-format snapshot to the current version and keep .bak.

Fields

§db_dir: PathBuf
§

KeysAdd

Issue an access key: print a new random token once, store only its hash.

Fields

§db_dir: PathBuf
§name: String
§tier: String
§

KeysHash

Print the keys.json hash of the token read from standard input.

§

Verify

Validate CRC32 integrity of every section in the V8 snapshot.

Fields

§db_dir: PathBuf
§

Backup

Create a consistent, verified copy of the database directory.

Fields

§db_dir: PathBuf
§dest: PathBuf
§

RestoreS3

Restore a store from a continuous backup in S3-compatible storage (restore --from s3://bucket/prefix). See run_restore_s3.

Fields

§from: String

s3://bucket/prefix, r2://… or minio://….

§at: Option<String>

--at: a commit number or an RFC 3339 timestamp; None restores the newest restore point.

§into: Option<PathBuf>

--into; None is DEFAULT_RESTORE_INTO.

§

Export

Export all nodes, edges, and rules to a destination directory.

Fields

§db_dir: PathBuf
§dest: PathBuf
§

Import

Bulk-load CSV and JSONL files.

Fields

§db_dir: PathBuf
§

IngestGit

Build (or incrementally sync) a graph of a git repository.

Fields

§db_dir: PathBuf
§

Install(InstallOpts)

Wire the /mushroom skill and MCP server into Claude Code / Cursor.

§

Uninstall(InstallOpts)

Undo what install wrote (manifest-driven).

§

Disable(ToggleOpts)

Turn an install off without removing it: strips the hooks, the MCP entry and the git hook blocks; the skill, the store and the .gitignore line stay.

§

Enable(ToggleOpts)

Turn a disabled install back on, re-deriving the dynamic parts (the resolved command, the hooks) rather than replaying stale ones.

§

Doctor(DoctorOpts)

Verify an install end to end: config, store, hooks, and a real MCP handshake.

§

Recall

Body of the Claude Code UserPromptSubmit hook: reads a prompt payload on stdin, prints related graph facts on stdout.

Fields

§db_dir: Option<PathBuf>
§auto: bool
§

Brief

Body of the Claude Code SessionStart hook: prints the repository in one byte-stable block, which the host caches for the whole session.

Fields

§db_dir: Option<PathBuf>
§auto: bool
§

Why

What links two nodes, with the evidence behind each link.

Fields

§db_dir: PathBuf
§

Version

§

Help

Trait Implementations§

Source§

impl Clone for Command

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 Command

Source§

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

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

impl PartialEq for Command

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Command

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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