# local-leaf > local-leaf is a free, open-source (MIT) offline alternative to Overleaf for macOS. It is a browser-based LaTeX editor that runs on your own Mac and compiles with your local TeX distribution (MacTeX, latexmk), with a live PDF and two-way SyncTeX. Projects are plain folders on disk, so git, the terminal, and AI coding agents such as Claude Code or Codex can edit them while the editor updates live. A `leaf` CLI lets agents open, compile, and read errors from the running editor. Key facts: - Platform: macOS with a TeX distribution providing `latexmk` and `synctex` (MacTeX puts them in /Library/TeX/texbin), and Node.js 18 or newer. Runs from source: `npm install && npm start`, then http://localhost:3737 (bound to 127.0.0.1 only). - Editor: CodeMirror 6 with LaTeX highlighting, spellcheck, find/replace, completions for commands, environments, \ref labels and \cite keys, and Overleaf's keyboard shortcuts. - Compile: latexmk with pdfLaTeX, XeLaTeX or LuaLaTeX; auto-compile on file change; parsed errors and warnings with file:line. - Overleaf import: from a .zip (any plan) or over Overleaf's git integration (paid plans). - Git: per-project commit, push, pull, and publish to GitHub from a sidebar panel. - Terminal: integrated xterm.js terminal in the project folder with a one-click Claude Code launcher. - Agent loop: edit files under `leaf root` → `leaf compile` (blocks, exit 1 on failure) → `leaf problems --errors` → repeat. Every command accepts `--json`. - Differences from Overleaf: files stay local, no compile time limit, works offline, free Git; no real-time collaboration. ## Docs - [README](https://github.com/aneesh-iyer29/local-leaf/blob/main/README.md): features, install, Overleaf import, Git, terminal, CLI, shortcuts, comparison with Overleaf, FAQ - [AGENTS.md](https://raw.githubusercontent.com/aneesh-iyer29/local-leaf/main/AGENTS.md): how a coding agent should drive the `leaf` CLI to edit and compile a LaTeX project - [CLI source](https://raw.githubusercontent.com/aneesh-iyer29/local-leaf/main/bin/leaf.js): every `leaf` command - [Demo video](https://local-leaf.aneeshiyer.com/demo.mp4): 22 seconds, a real edit compiled by latexmk and the same build from `leaf compile` ## Optional - [Contributing](https://raw.githubusercontent.com/aneesh-iyer29/local-leaf/main/CONTRIBUTING.md): development setup and ground rules - [Website](https://local-leaf.aneeshiyer.com/): project landing page