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.
Essential Keybindings
The most common shortcuts to get you started:
| Key | Action |
|---|---|
j / k | Scroll down / up |
g / G | Go to top / bottom |
t | Toggle TOC sidebar |
/ | Search |
Ctrl+P | Open fuzzy picker |
Ctrl+E | Open in editor |
w | Toggle watch mode |
? | Show help popup |
q | Quit |
For the full reference (including code block interactions, mouse capture, theme picker, and more), see the Keybindings page.
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