Skip to content

Getting Started

This takes you from a checkout to a computed code graph: build Muundo, analyse a tree from Python, then do the same from the shell. About five minutes.

Nothing here reaches the network, runs a build system, or executes the code it reads. Muundo parses files with tree-sitter and reports what is in them.

1. Build it

Muundo is not on a package index yet, so you build it. The Rust crates need a stable toolchain; the Python binding needs maturin.

cargo build --release --workspace   # muundo-analyze and muundo-server

For the Python module:

cd python
maturin build --release
pip install ../target/wheels/muundo-*.whl

If pyo3 says it cannot find a Python interpreter, point it at one explicitly — it otherwise resolves whatever a stale virtualenv on the path claims:

PYO3_PYTHON=$(which python3) maturin build --release

2. Analyse a tree from Python

import muundo

report = muundo.MuundoAnalyzer("./src", ["rust", "python"]).analyze()

print(len(report.entities), "entities")
for edge in report.call_edges[:5]:
    print(edge.caller, "->", edge.callee)

The parse is the expensive part, so it runs once per MuundoAnalyzer and is cached for that instance's lifetime. The options are fixed at construction: build a new analyzer for a fresh analysis, which makes cache invalidation a non-question.

Check partial_analysis before you trust a count. It lists what could not be parsed. A graph that quietly drops the files it failed on produces confident numbers about a subset, and nothing tells the reader which subset.

if report.partial_analysis:
    print("not parsed:", report.partial_analysis)

3. The same from the shell

The binary is muundo-analyze — the crate that provides it is called muundo-cli, which is not the name you type.

./target/release/muundo-analyze info

That prints the version and the language names this build accepts. Then:

./target/release/muundo-analyze analyze --root ./src --languages rust,python

Every subcommand answers a single JSON object with ok and either data or an error, so it pipes into jq without a mode flag.

4. Verify what an analysis read

An analysis records the hash of every file it parsed. verify re-reads the tree and tells you whether it still matches:

./target/release/muundo-analyze analyze --root ./src > report.json
./target/release/muundo-analyze verify --report report.json --root ./src

This is what lets a finding be attributed to a specific state of a tree rather than to "the code, at some point".

Next steps

  • Reference — the languages, every field of a report, all six subcommands, the HTTP API and its limits
  • Design decisions — the deliberate "no"s: things that look like missing features and are refusals on purpose