r/CLI•
gimalay

iwe — a CLI that turns a folder of markdown into a queryable graph

I've been building iwe for a while and figured this sub is the right home for it. It's a single Rust binary that treats a directory of .md files as a graph and gives you a CLI to query and rewrite it. No daemon, no database, no sync — just files.

A quick tour:

Normalize a corpus. Fixes link titles, header levels, list numbering across every file in the workspace. Thousands of files in well under a second:

iwe normalize

Stats. Counts, most-referenced doc, orphans:

$ iwe stats
Documents: 1,247
Nodes: 45,832
Block references: 3,291
Most referenced: inbox.md (147 refs)
Orphaned documents: 23

Find with a YAML filter language. Frontmatter is the schema; the operators are the ones you already know ($eq, $in, $gte, $exists, $and/$or/$not):

iwe find --filter 'status: draft, priority: {$gte: 8}'
iwe find --filter '$or: [{status: draft}, {status: review}]'

Walk the graph. Markdown links come in two flavors — inline (a "see also") and on-their-own-line (containment). Each gets its own pair of operators:

iwe find --references people/alice       # docs that mention alice inline
iwe find --included-by tasks/alpha:0     # everything under the alpha subtree, unbounded

Stack flags to compose:

iwe find --included-by tasks/alpha:0 \
         --references people/alice \
         --filter 'status: draft'

Same predicates drive count / update / delete. --dry-run previews; git diff is the audit log:

iwe count --filter 'status: draft'
iwe update --filter 'status: draft, reviewed: true' --set status=published
iwe delete --filter 'status: archived' --dry-run

Squash a subtree into one document — handy for piping to an LLM or generating a single-file export:

iwe squash --key main-topic --depth 3 > combined.md

Graphviz export:

iwe export dot --key project-notes --depth 2 | dot -Tpng -o graph.png

The same binary also speaks LSP, so the editor (VSCode, Neovim, Helix, Zed) gets go-to-definition, backlinks, link completion — all reading the same files. But the CLI is the interesting surface for this crowd.

Install: cargo install iwe. Repo: https://github.com/iwe-org/iwe.

Happy to answer anything about the model or the query language.

Posted May 21, 2026, 12:20 AM UTC

204
Loading comments…