Installation

macOS / Linux / Android

The recommended way to install leaf:

curl -fsSL https://leaf.rivolink.mg/install.sh | sh

This downloads the latest binary for your platform and places it in a directory on your PATH.

Windows (PowerShell)

irm https://leaf.rivolink.mg/install.ps1 | iex

npm

Install the package from npmjs.com:

npm install -g @rivolink/leaf

Supported platforms: macOS (x64, ARM), Linux (x64, ARM), Windows (x64), Android (ARM64).

Homebrew

Install the formula from brew.sh:

brew install leaf-markdown-viewer

Cargo

Install the crate from crates.io:

cargo install leaf-markdown-viewer

Scoop (Windows)

Install the app from scoop.sh:

scoop install leaf-markdown-viewer

ArchLinux (AUR)

Install the package from archlinux.org using an AUR helper such as yay:

yay -S leaf-markdown-viewer

Build from Source

Requires Rust toolchain:

git clone https://github.com/RivoLink/leaf.git
cd leaf
cargo build --release

The binary will be at target/release/leaf.

Updating

Update to the latest version:

leaf --update

leaf verifies downloads with SHA256 checksums for security.

Shell Completion

To install auto-completion scripts for your shell (Bash, Zsh, Fish, or PowerShell):

leaf --auto-complete

Restart your terminal or source your config file (e.g., source ~/.zshrc) to activate. See the Shell Completion guide for more details.

Uninstall

Interactive uninstall scripts remove the binary, configuration, and shell completions in one step.

macOS / Linux / Android

curl -fsSL https://leaf.rivolink.mg/uninstall.sh -o uninstall.sh
sh uninstall.sh

Windows (PowerShell)

irm https://leaf.rivolink.mg/uninstall.ps1 -OutFile uninstall.ps1
powershell -ExecutionPolicy Bypass -File .\uninstall.ps1

Package Managers (npm / Homebrew / Cargo / Scoop)

For package-manager installs, first clean the config and completions, then uninstall via the package manager:

leaf --config remove
leaf --auto-complete remove

# then, depending on your install:
npm uninstall -g @rivolink/leaf
brew uninstall leaf-markdown-viewer
cargo uninstall leaf-markdown-viewer
scoop uninstall leaf-markdown-viewer