by Epistates
A terminal markdown viewer. Browse a document by its outline in the TUI, or query its sections from the CLI with a jq-like language.
# Add to your Claude Code skills
git clone https://github.com/Epistates/treemdtreemd is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Epistates. A terminal markdown viewer. Browse a document by its outline in the TUI, or query its sections from the CLI with a jq-like language. It has 739 GitHub stars.
treemd's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Epistates/treemd" and add it to your Claude Code skills directory (see the Installation section above).
treemd is primarily written in Rust. It is open-source under Epistates on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh treemd against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Read markdown by its structure. treemd shows a document's headings as a tree you can fold and search, with the section you're on beside it, and gives the shell the same view: list, extract and query any part of a document with a jq-like language.

treemd github:owner/repo or any markdown URL.cargo install treemd # crates.io
brew install treemd # Homebrew, macOS and Linux
pacman -S treemd # Arch Linux (extra)
pkgin install treemd # NetBSD
Prebuilt binaries for Linux, macOS and Windows are on the releases page; see Release binaries for verifying them. To build from source:
git clone https://github.com/epistates/treemd
cd treemd
cargo install --path . --locked
Shell completions, which offer only markdown files and directories:
treemd --setup-completions # bash, zsh or fish, set up interactively
treemd --man-page > treemd.1 # the man page, for packagers
PowerShell and elvish completions work too. Add the line for your shell to
your PowerShell profile ($PROFILE) or to elvish's rc.elv:
$env:COMPLETE = "powershell"; treemd | Out-String | Invoke-Expression; Remove-Item Env:\COMPLETE
eval (E:COMPLETE=elvish treemd | slurp)
treemd README.md # open a file
treemd . # pick a file in this directory
treemd github:rust-lang/rust # a GitHub repo's README, whatever it's named
treemd -l -n README.md # list headings with their line ranges
treemd -s Install README.md # print one section
treemd -q '.code[rust]' doc.md # every Rust code block
In the TUI, the footer shows the keys for whatever you're doing, ? lists
them all, and : opens a command palette that finds any command by name.
The outline is on the left and the selected section on the right. Tab
switches between them. Move through the outline with j/k and fold with
Enter, or hide it with w and read the content alone.
With outline_popup = true the content takes the full width and shows the
whole document, and Tab (or w) opens the outline as a popup in the
middle of the screen. Moving through it scrolls the document to each heading, with what
comes before it still in view and the section highlighted. Enter stays
there, Esc goes back.
/ searches the current section and s filters the outline. f lists the
section's links and follows one by number. i steps through the section's
elements one at a time: checkboxes, tables, links, code blocks, images and
<details>. In interactive mode, Enter uses the element, y copies it and
e opens your editor at its line. Table cells are edited in place, and every
change is written back to the file. Ctrl+z undoes the last edit.
Every key can be remapped, see Keybindings.
| Key | Action |
|---|---|
j / k, ↓ / ↑ |
Next / previous heading |
g / G, Home / End |
First / last heading |
p |
Parent heading |
d / u, Ctrl+d / Ctrl+u, Ctrl+f / Ctrl+b, PageDown / PageUp |
Page down / up |
Ctrl+e / Ctrl+y |
Scroll the content a line |
Tab / Shift+Tab |
Switch pane |
5j, 3k |
Repeat a move: digits start a count |
m / ' |
Set the bookmark / jump to it |
| Key | Action |
|---|---|
Enter / Space |
Fold or unfold |
h / l, ← / → |
Fold (or go to the parent) / unfold |
w |
Hide or show the outline |
[ / ] |
Outline width: 20%, 30% or 40%; drag the border for any other |
# |
Show or hide the # level markers |
T |
Only headings with open todos (Esc clears it) |
| Key | Action |
|---|---|
/ |
Search the current section |
s |
Filter the outline |
Tab |
While typing, switch between the two |
Enter |
Keep the search and read with the matches highlighted |
n / N |
Next / previous match |
Esc |
Clear the search |
| Key | Action |
|---|---|
f |
List the section's links |
j / k, Tab / Shift+Tab |
Next / previous link |
1-9 |
Link by number |
Enter |
Follow it |
/ |
Search the links |
p |
The parent section's links |
b / Backspace, F |
Back / forward through followed links and files |
o / Ctrl+o |
Open a file |
In the file picker, / searches, Backspace goes up a directory and h
shows hidden files.
| Key | Action |
|---|---|
i |
Enter or leave interactive mode |
j / k |
Next / previous element |
Tab / Shift+Tab |
Next / previous link inside the element |
Enter / Space |
Use it: toggle, expand, follow, edit or view full screen |
y |
Copy it: the code, the link target, the table or the image source |
e |
Open the editor at its line |
Ctrl+z |
Undo the last edit |
On a table, Enter moves into its cells:
| Key | Action |
|---|---|
h / j / k / l |
Move between cells |
Enter |
Edit the cell |
y / Y / r |
Copy the cell / the row / the table as markdown |
Esc |
Back to the elements |
In the full-screen image viewer, Space plays or pauses a GIF and h / l
step through its frames.
| Key | Action |
|---|---|
: |
Command palette |
t |
Choose a theme, previewed live |
r |
Show the markdown source |
M |
Release the mouse, so it selects text |
e |
Open the file in $VISUAL or $EDITOR |
y / Y |
Copy the section / a link to its heading |
Ctrl+l |
Redraw |
Ctrl+z |
Suspend to the shell (fg returns) |
? |
Help |
q / Ctrl+c |
Quit, asking first if there are unsaved edits |
Esc backs out of a search or mode. In help and the pickers, q closes them
instead of quitting.
Anything the keys act on can be clicked. A click selects it, and a second click
is Enter: a heading folds, a link is followed, an image opens, a code block is
copied, a table cell is edited, a row of a picker is opened. A stray click
therefore changes nothing, which matters inside tmux, where the click that
focuses a pane is passed on to it. Ctrl+click, or Alt+click, selects and
opens at once.
Controls act on the first click. A task's box ticks it. The arrow beside a
heading, or a <details> summary, folds it. A key in the footer does what the
key does, and an answer in a dialog gives it. A click beside a popup closes it.
The wheel scrolls the pane under the pointer. Drag a scrollbar to scroll, and
the border between the panes to resize them (:sw saves the width). Hold the
pointer over a link and the status bar shows where it goes.
Because treemd captures the mouse for this, your terminal's own click-and-drag
selection needs a modifier: most terminals (iTerm2, kitty, GNOME Terminal,
Konsole, Windows Terminal) select natively while Shift is held. Or press M
to release the mouse entirely, and again to take it back. To copy a whole
section, y is quicker.
Images render with the terminal's graphics protocol (kitty, iTerm2 or Sixel),
and as half blocks where there isn't one. Enter on one in interactive mode
shows it full screen, and animated GIFs play. On Linux and macOS, Mermaid
diagrams render as images too, in the theme's light or dark colors, and
scroll with the text. --no-images or images.enabled = false turns
images off. An image that isn't drawn is named by its alt text where it stands,
and a Mermaid diagram that isn't drawn shows its source.

Press t to preview every theme on the open document; Enter keeps one. Or
set one by name in the config or with --theme:
| Dark | Light | Other |
|---|---|---|
OceanDark (default), Nord, Dracula, Solarized, `Mo |