Usage
Basic Usage
Open a Markdown file:
leaf README.md
Open the file picker to browse and select files:
leaf
Open the picker scoped to a specific directory:
leaf ./docs/
Watch Mode
Auto-reload when the file changes on disk:
leaf --watch README.md
leaf -w README.md
Piping from Stdin
Pipe Markdown content from any tool:
cat README.md | leaf
echo "# Hello" | leaf
claude "explain Rust" | leaf
Maximum stdin size: 8 MB.
Frontmatter
leaf supports YAML frontmatter. If your Markdown file starts with a YAML block between --- markers, it will be rendered as a metadata header at the top of the document.
Navigation
| Key | Action |
|---|---|
j / ↓ | Scroll down one line |
k / ↑ | Scroll up one line |
d / PgDn | Scroll down one page |
u / PgUp | Scroll up one page |
g / Home | Go to top |
G / End | Go to bottom |
t | Toggle TOC sidebar |
Ctrl+F / / | Search |
n / N | Next / previous match |
Ctrl+P | Open fuzzy picker |
Shift+P | Open file browser |
Ctrl+E | Open in editor |
Shift+T | Open theme picker |
Shift+E | Open editor picker |
Ctrl+Click | Open link |
Dbl-Click | Copy link |
Shift+Sel | Select text |
Shift+R | Copy relative file path |
Shift+A | Copy absolute file path |
Shift+L / l | Toggle line numbers |
Ctrl+L | Goto line |
r | Force reload (watch mode) |
? | Show help popup |
q | Quit |
Command-Line Options
leaf [OPTIONS] [FILE | DIRECTORY]
Options:
-w, --watch Watch file for changes
-e, --editor <NAME> Set external editor
--inline [SPEC] Render to stdout (no TUI)
--picker Open directory browser
--config [reset] Open or reset configuration file
--auto-complete [SPEC] Install shell completions
--theme <NAME> Set color theme preset or path
--width <N> Set maximum content width
--update Update to latest version
-h, --help Show help
-V, --version Show version