{"id":48620078,"url":"https://github.com/rivolink/leaf","last_synced_at":"2026-05-17T15:01:35.874Z","repository":{"id":349858228,"uuid":"1202456595","full_name":"RivoLink/leaf","owner":"RivoLink","description":"Terminal Markdown previewer — GUI-like experience.","archived":false,"fork":false,"pushed_at":"2026-04-18T09:59:54.000Z","size":335,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T12:03:47.137Z","etag":null,"topics":["markdown","markdown-viewer","preview","terminal","termux","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RivoLink.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-06T03:31:32.000Z","updated_at":"2026-04-18T09:59:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1e2cd1a-0acb-48e5-873c-b8640249af13","html_url":"https://github.com/RivoLink/leaf","commit_stats":null,"previous_names":["rivolink/leaf"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/RivoLink/leaf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RivoLink%2Fleaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RivoLink%2Fleaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RivoLink%2Fleaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RivoLink%2Fleaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RivoLink","download_url":"https://codeload.github.com/RivoLink/leaf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RivoLink%2Fleaf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","markdown-viewer","preview","terminal","termux","tui"],"created_at":"2026-04-09T03:04:45.007Z","updated_at":"2026-05-09T00:02:04.491Z","avatar_url":"https://github.com/RivoLink.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/logo-wordmark.svg\" alt=\"leaf\" width=\"360\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Terminal Markdown previewer — GUI-like experience.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/preview.png\" alt=\"leaf\" width=\"710px\" /\u003e\u003cbr\u003e\n  \u003csub\u003eSee more screenshots in the \u003ca href=\"demo/README.md\"\u003efeatures\u003c/a\u003e demo\u003c/sub\u003e\n\u003c/p\u003e\n\n## Install\n\nInstall the latest published binary.\n\nmacOS / Linux / Android / Termux:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.sh | sh\n```\n\nWindows:\n\n```powershell\nirm https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.ps1 | iex\n```\n\nnpm:\n\n```bash\nnpm install -g @rivolink/leaf\n```\n\nArchLinux (AUR):\n\nUse an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers), such as `yay`:\n\n```bash\nyay -S leaf-markdown-viewer\n```\n\nVerify the installation:\n\n```bash\nleaf --version\n```\n\n## Update\n\nUpdate an existing installation to the latest published release.\n\nSelf:\n\n```bash\nleaf --update\n```\n\n`leaf --update` downloads the matching published asset, verifies it against the published `checksums.txt` SHA256, and then installs it.\n\nOn Windows, if replacing the running `.exe` is blocked by the OS, rerun the PowerShell installer from the install section.\n\nnpm:\n\n```bash\nnpm update -g @rivolink/leaf\n```\n\n## Build\n\nClone the repository:\n\n```bash\ngit clone https://github.com/RivoLink/leaf.git\ncd leaf\n```\n\nBuild the release binary locally:\n\n```bash\ncargo build --release\n```\n\nCreate a local bin directory if needed and symlink `leaf` into it:\n\n```bash\nmkdir -p ~/.local/bin\nln -sf \"$(pwd)/target/release/leaf\" ~/.local/bin/leaf\n```\n\nIf `~/.local/bin` is not already on your `PATH`, add it to `~/.bashrc` or `~/.zshrc`:\n\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\n## Usage\n\n```bash\n# Open a Markdown file\nleaf TESTING.md\n\n# Watch mode — reloads automatically on save\nleaf --watch TESTING.md\nleaf -w TESTING.md\n\n# Open the fuzzy Markdown picker\nleaf\n\n# Open the classic directory browser picker\nleaf --picker\n\n# Open the fuzzy Markdown picker, then watch the selected file\nleaf -w\n\n# Open the classic directory browser picker, then watch the selected file\nleaf -w --picker\n\n# Open a dash-prefixed filename\nleaf -- -notes.md\n\n# Stream Markdown from another CLI tool\nclaude \"explain Rust lifetimes\" | leaf\n\n# Preview a local file through stdin\ncat TESTING.md | leaf\n\n```\n\n## Configuration\n\nSet default values for theme, editor, and watch mode via `config.toml`:\n\n```bash\nleaf --config\n```\n\nThis opens the configuration file in your editor. If the file does not exist yet, leaf creates it with documented defaults.\n\n```toml\ntheme = \"ocean\"      # arctic, forest, ocean, solarized-dark, or a custom theme file\neditor = \"nano\"      # any editor in PATH\nwatch = false        # auto-reload when opening a file\n```\n\nAll settings are optional. CLI arguments always take priority. See [`config.toml`](config.toml) for details.\n\n## Custom Themes\n\nCreate a `.toml` file that inherits from a built-in theme and overrides specific colors:\n\n```toml\ntheme = \"/path/to/custom-theme.toml\"\n```\n\nRelative paths are resolved from the config file directory.\n\n```toml\n# custom-theme.toml\nbase = \"ocean\"\nsyntax = \"base16-ocean.dark\"\n\n[ui]\ncontent_bg = \"#282828\"\ntoc_accent = \"#fe8019\"\n\n[markdown]\ntext = \"#ebdbb2\"\nheading_1 = \"#fabd2f\"\n```\n\nSee [`gruvbox.toml`](gruvbox.toml) for a complete example with all available color keys.\n\n## Keybindings\n\n| Key | Action |\n|---|---|\n| `j` / `↓` | Scroll down |\n| `k` / `↑` | Scroll up |\n| `d` / PgDn | Page down (20 lines) |\n| `u` / PgUp | Page up (20 lines) |\n| `g` / Home | Top |\n| `G` / End | Bottom |\n| `t` | Toggle TOC sidebar |\n| `Shift+Sel` | Select text |\n| `Shift+T` | Open theme picker |\n| `Shift+E` | Open editor picker |\n| `Shift+P` | Open file browser |\n| `Ctrl+E` | Open in editor |\n| `Ctrl+P` | Open fuzzy picker |\n| `Ctrl+F` / `/` | Find |\n| `n` / `N` | Next / prev match |\n| `?` | Show help popup |\n| `r` | Force reload (watch mode) |\n| `q` | Quit |\n\n## Features\n\n- **Live preview** — Watch mode with automatic reload and visual feedback.\n- **File picker** — Fuzzy Markdown picker, directory browser, and watch after selection.\n- **Editor integration** — Open the current file in your preferred editor.\n- **Frontmatter support** — YAML frontmatter rendered as a table (horizontal or vertical based on key count).\n- **Rich Markdown rendering** — Tables, lists, blockquotes, rules, bold, italic, and strikethrough.\n- **Syntax highlighting** — Common aliases like `py`, `cpp`, `json`, `toml`, `ps1`, `dockerfile`.\n- **LaTeX support** — Inline, block, and `latex` / `tex` code blocks rendered as formulas.\n- **Navigation** — TOC sidebar, active section tracking, heading jumps, and search.\n- **Terminal UX** — Theme picker, help popup, file path popup, mouse and keyboard support.\n- **CLI friendly** — stdin support and `leaf --update` with SHA256 verification.\n\n## Typical AI Workflow\n\n```bash\n# Terminal 1: generate the file\naichat \"...\" \u003e notes.md\n\n# Terminal 2: live watch\nleaf --watch notes.md\n```\n\n## Troubleshooting\n\n### Windows: missing Visual C++ runtime\n\nIf `leaf.exe` does not start on Windows and reports a missing MSVC runtime, install the latest supported Microsoft Visual C++ Redistributable from Microsoft Learn:\n\n- https://learn.microsoft.com/fr-fr/cpp/windows/latest-supported-vc-redist?view=msvc-170\n\nDirect download for the latest supported **X64** Microsoft Visual C++ Redistributable:\n\n- https://aka.ms/vc14/vc_redist.x64.exe\n\nFor `leaf-windows-x86_64.exe`, the relevant package is the latest supported **X64** Visual C++ v14 Redistributable.\n\n### Windows: update or file replacement error\n\nIf `leaf --update` fails on Windows with an error about replacing, renaming, or writing `leaf.exe`, the running executable was likely locked by the OS.\n\nClose any terminal session still running `leaf`, then rerun the PowerShell installer from the install section:\n\n```powershell\nirm https://raw.githubusercontent.com/RivoLink/leaf/main/scripts/install.ps1 | iex\n```\n\n## Uninstall\n\nmacOS / Linux / Android / Termux:\n\n```bash\nrm -f ~/.local/bin/leaf\n```\n\nWindows:\n\n```powershell\nRemove-Item \"$env:LOCALAPPDATA\\Programs\\leaf\\leaf.exe\" -Force\n```\n\nnpm:\n\n```bash\nnpm uninstall -g @rivolink/leaf\n```\n\n## Contributors\n\nThanks to all contributors.\n\n![Contributors](https://contrib.rocks/image?repo=RivoLink/leaf\u0026t=717807600)\n\n## Support\n\nContributions are welcome. Feel free to open an issue or submit a pull request.\n\nSee the [CONTRIBUTING.md](CONTRIBUTING.md) file for details.\n\nIf you like **leaf**, consider giving the project a star ⭐\n\n## License\n\nThis project is licensed under the MIT License.\n\nSee the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frivolink%2Fleaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frivolink%2Fleaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frivolink%2Fleaf/lists"}