Products / Developer tools
treemd
treemd is like tree, but interactive: navigate markdown documents through an expandable and collapsible heading tree with a synchronized content view. It also has a jq-like query language and a non-interactive CLI mode for scripting.
cargo install treemd- 50+
- Languages syntax highlighted
- 50+
- Built-in query functions
Features
Built for production
Dual-pane interface
Navigate the heading outline while viewing synchronized content.
Link following
Follow markdown links with a visual popup. Anchors, files, wikilinks and external URLs are supported.
Live editing
Edit files in your default editor with automatic reload.
Syntax highlighting
50+ languages with full syntect integration.
Fuzzy search
Filter headings in real time by pressing /.
Bookmarks
Mark positions and jump back with vim-style navigation.
jq-like query language
Extract and filter markdown elements such as headings, code blocks, links and tables, with pipes and 50+ built-in functions.
CLI mode for scripting
Non-interactive flags for listing headings, tree output, section extraction, filtering, counting and JSON output, for use in pipelines and automation.
In code
See it work
cargo install treemd
treemd README.mdtreemd -q '.h2' doc.md
cat doc.md | treemd -q '.code[python]'
treemd -q '.h1[Features] > .h2' --query-output json doc.mdQuery language
Element selectors: `.h` (all headings), `.h2` (level 2 headings), `.code[rust]` (Rust code blocks), `.link` (all links) and `.table` (tables).
Pipes and functions: `.h2 | text` returns heading text, `[.h2] | count` counts elements, `.link | url` returns URLs, `.h | select(contains("API"))` filters by content and `. | stats` reports document statistics.
CLI flags
- `-l, --list`: list all headings - `--tree`: tree visualization - `-s, --section`: extract a section by name - `--filter`: filter headings by text - `-L, --level`: filter by heading level - `--count`: count headings by level - `-o json`: JSON output format - `-q, --query`: execute a query expression - `--query-help`: query language documentation
Vim-style navigation
- `j/k`: move up and down - `g/G`: jump to top or bottom - `p`: jump to parent - `d/u`: page down or up - `Space`: toggle expand - `f`: follow links - `/`: search and filter - `m` and `'`: set and jump to a bookmark - `e`: edit in $EDITOR - `t`: cycle theme
Installation options
Install from crates.io with `cargo install treemd`, or on NetBSD with `pkgin install treemd`. Pre-built binaries are available for Linux (x86_64, ARM64), macOS (Intel and Apple Silicon) and Windows.
Where it fits
treemd suits exploring large documentation files, extracting sections from README files, scripting markdown transformations, comfortable terminal reading and AI-assisted documentation workflows.
Putting treemd to work?
We help teams design, build and operate production systems on this stack.