Skip to main content

Crate cli

Crate cli 

Source
Expand description

mushroomdb CLI library: hand-rolled arg parsing and the demo dataset builder.

The binary in main.rs stays thin — it dispatches on parse_args and prints what the lib functions return.

Modules§

export
Export writer for mushroomdb export.
ingest_git
mushroomdb ingest-git <db> <repo>: build and maintain a graph of a git repository. First run ingests the whole history; later runs apply only the commits after the recorded GitSync head, so deletes and renames retract or move derived edges instead of leaving them stale.
install
mushroomdb install / uninstall — wire the /mushroom skill and MCP server into Claude Code and Cursor.
recall
mushroomdb recall <db>: the body of the UserPromptSubmit hook.

Structs§

CliError
CLI-facing error. [Display] is the message printed to stderr.
DemoOutcome
Outcome of run_demo. Counts are deterministic.

Enums§

AlgoSubcmd
Algorithm subcommand for mushroomdb algo.
Command
Parsed mushroomdb invocation.
ServeUi
How serve should mount a UI. Precedence: --ui dir > embedded > --no-ui.

Constants§

N_ORGS
Deterministic demo: 10 Orgs, 20 Projects, 30 People.
N_PEOPLE
N_PROJECTS
SAMPLE_QUERY
Sample query printed by mushroomdb demo and executed against the fresh store.
VERSION
Build version, printed by mushroomdb --version.

Functions§

format_backup
Format a BackupReport for display.
format_demo
Render a DemoOutcome the way mushroomdb demo prints it.
format_stats
Pretty-print Stats for mushroomdb stats and the demo smoke test.
format_suggest
Pretty-print a list of RuleSuggestions for mushroomdb suggest.
maybe_run_demo_if_empty
Run run_demo when dir is missing or empty; otherwise leave it alone.
parse_args
Parse argv after the binary name. Hand-rolled — no clap.
read_stats
Open dir and return live stats.
run_algo
Run a graph algorithm and return a formatted string.
run_asof
Execute an as-of query at the given commit and print results.
run_backup
Create a consistent, verified backup of db_dir to dest.
run_demo
Build the deterministic demo dataset in an empty dir.
run_export
Export all data from db_dir to dest in format.
run_migrate
Migrate the snapshot at db_dir to the current format version.
run_query
Run a Cypher read or write and print columns/rows like run_asof.
run_schema_apply
Read schema_file, open db_dir, apply the schema, and return the diff as one line per entry: "created rule:x", "updated view:y", etc.
run_snapshot
Open dir and write snapshot.bin. Default truncates the WAL.
run_suggest
Profile the database at dir and return all rule suggestions.
run_verify
Validate the CRC32 integrity of every section in a V8 snapshot.
usage
Usage text for no-args / --help / -h.
validate_ui_dir
--ui <dir> must be a directory that contains index.html.