pub enum Command {
Show 36 variants
Serve {
db_dir: PathBuf,
addr: SocketAddr,
ui: ServeUi,
demo_if_empty: bool,
token: Option<String>,
role_tokens: Vec<(String, String)>,
snapshot_every: Option<Duration>,
restore_from: Option<PathBuf>,
tls_cert: Option<PathBuf>,
tls_key: Option<PathBuf>,
},
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>,
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,
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: PathBuf,
},
Migrate {
db_dir: PathBuf,
},
Verify {
db_dir: PathBuf,
},
Backup {
db_dir: PathBuf,
dest: PathBuf,
},
Export {
db_dir: PathBuf,
dest: PathBuf,
format: ExportFormat,
},
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,
},
Sync {
db_dir: Option<PathBuf>,
auto: bool,
json: bool,
},
Intercept {
db_dir: Option<PathBuf>,
auto: bool,
},
ImpactHook {
db_dir: Option<PathBuf>,
auto: bool,
},
Enrich {
db_dir: Option<PathBuf>,
auto: bool,
},
Touch {
db_dir: Option<PathBuf>,
auto: bool,
files: Vec<PathBuf>,
},
Map {
db_dir: PathBuf,
json: bool,
},
Explore {
db_dir: PathBuf,
target: String,
depth: Depth,
full: bool,
},
Context {
db_dir: PathBuf,
target: String,
full: bool,
},
Impact {
db_dir: PathBuf,
files: Vec<String>,
},
Owners {
db_dir: PathBuf,
path: String,
},
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§
Serve
Fields
addr: SocketAddrdemo_if_empty: boolIf 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.
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.
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).
Mcp
Fields
db_dir: Option<PathBuf>None with auto set: resolved by resolve_auto_db at run time.
Stats
Demo
AsOf
Read-only view of the database at a past commit.
Fields
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.
Suggest
Profile the database and suggest linking rules with estimated edge counts.
Algo
Run a graph algorithm (pagerank / wcc / degree / communities).
Fields
subcmd: AlgoSubcmddir: AlgoDirEdge direction for degree/pagerank (out / in / both).
Ignored by wcc and communities, which are always undirected.
Query
Run a Cypher query (read or write).
Fields
Snapshot
Write snapshot.bin. The WAL is archived unless told otherwise.
Fields
wal: WalDispositionBuildIndex
Drive any outstanding vector-index build to completion.
SchemaApply
Apply a JSON schema file idempotently (schema apply <db-dir> <schema.json>).
Migrate
Migrate an old-format snapshot to the current version and keep .bak.
Verify
Validate CRC32 integrity of every section in the V8 snapshot.
Backup
Create a consistent, verified copy of the database directory.
Export
Export all nodes, edges, and rules to a destination directory.
IngestGit
Build (or incrementally sync) a graph of a git repository.
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.
Brief
Body of the Claude Code SessionStart hook: prints the repository in one byte-stable block, which the host caches for the whole session.
Sync
Bring the store up to date with the repository the GitSync marker
names: the commits since the marker, then the dirty working tree.
Fields
db_dir: Option<PathBuf>None with auto set: resolved by resolve_auto_db at run time.
The git hooks install writes use that form, so a git worktree
of the repository syncs its own store rather than the one belonging
to the checkout the install was typed in.
Intercept
Body of the optional PreToolUse hook: reads a Grep tool call on
stdin and exits 2 with a message when the pattern names a symbol the
graph holds, so the search becomes an explore. Off unless
install --intercept-grep wired it.
ImpactHook
Body of the optional PreToolUse hook on the editing tools: reads the
tool call on stdin and prints the edited file’s blast radius as
additionalContext, so the model knows what the change reaches before
it makes it. Off unless install --impact-before-edit wired it.
Enrich
Body of the optional PostToolUse hook on Grep: reads the finished
tool call on stdin and prints what the graph knows about the symbols it
matched as additionalContext. Off unless install --enrich-grep
wired it.
Touch
Re-extract named files only. Body of the PostToolUse hook, which reads the paths off a payload on stdin when none are given on the command line.
Map
Summarise the repository the store was built from: clusters, key files, owners, what is hot, and what is worth asking about.
Fields
json: boolPrint the core_api::repograph::RepoMap as JSON instead of the
rendered digest.
Explore
One target from as many sides as the depth asks for: the graph’s
context, impact and owners answers behind one command.
Fields
Context
Everything the graph knows about one file or symbol.
Fields
Impact
What else the named files reach: co-change partners, importers, and the symbols other files call.
Owners
Who has written a file, and when.
Why
What links two nodes, with the evidence behind each link.
Version
Help
Trait Implementations§
impl StructuralPartialEq for Command
Auto 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§
impl<T> Allocation for T
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.