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:

KeyAction
j / kScroll down / up
g / GGo to top / bottom
tToggle TOC sidebar
/Search
Ctrl+POpen fuzzy picker
Ctrl+EOpen in editor
wToggle watch mode
?Show help popup
qQuit

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