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.

KeyAction
j / Scroll down one line
k / Scroll up one line
d / PgDnScroll down one page
u / PgUpScroll up one page
g / HomeGo to top
G / EndGo to bottom
tToggle TOC sidebar
Ctrl+F / /Search
n / NNext / previous match
Ctrl+POpen fuzzy picker
Shift+POpen file browser
Ctrl+EOpen in editor
Shift+TOpen theme picker
Shift+EOpen editor picker
Ctrl+ClickOpen link
Dbl-ClickCopy link
Shift+SelSelect text
Shift+RCopy relative file path
Shift+ACopy absolute file path
Shift+L / lToggle line numbers
Ctrl+LGoto line
rForce reload (watch mode)
?Show help popup
qQuit

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