Feature proposal: olcli diff — preview content-level changes before push
Hi! First off, thanks for building olcli — the git remote helper alone has made my Overleaf workflow so much better.
I searched existing issues and didn't find a prior proposal for this.
So I'd like to propose a new command, and I'm happy to lead the implementation myself if you think it fits the project's direction.
Motivation
olcli push --dry-run shows which files would change, but not what changed inside them. Two scenarios where content-level diff matters:
- Pre-push sanity check — before pushing, see exactly what edits will land on Overleaf (similar to reviewing
git diff before committing).
- Academic review workflow — a very common situation: a student revises a thesis locally and wants to show their advisor what changed. Overleaf's web history is limited (especially on free plans) and isn't reviewer-friendly. A marked-up diff PDF (via
latexdiff) is the standard way journals and advisors expect to see revisions.
Proposed design
Core command (no external dependencies)
olcli diff [project] [dir]
- Compares local files against the current remote version
- Outputs a unified diff to stdout (colorized when TTY)
- Reuses the existing
.olcli.json manifest to determine which files to compare, so it only fetches remote content for files that differ
--name-only to list changed files, --file <path> to diff a single file
Optional latexdiff integration (opt-in flags)
olcli diff --latexdiff [--pdf]
- If
latexdiff is available on PATH, generate a marked-up .tex (deletions struck through in red, additions underlined in blue)
- With
--pdf, compile the marked-up file via Overleaf's remote compiler (reusing the existing compile machinery) — so users without a local TeX installation still get a reviewable PDF
- Gracefully degrades with a clear message if
latexdiff isn't installed
Implementation sketch
- Text diffing via the
diff npm package (or similar) — no new heavy deps
- Remote file contents fetched through the existing
OverleafClient methods
- Binary files (images, PDFs) reported as "binary files differ" only
- Respects the existing ignore layers (
.olignore etc.)
Out of scope (for now)
Keeping the first iteration small on purpose. Possible follow-ups if there's interest: diffing between two points in time via the git remote helper, tagging "review checkpoints", auto-creating a review project on Overleaf.
Questions for you
- Does this fit how you see olcli evolving?
- Any preference on the diff library, or constraints on new dependencies?
- Would you prefer the latexdiff integration split into a separate PR?
If this sounds good, I'll start with a draft PR for the core olcli diff command. Thanks!
Feature proposal:
olcli diff— preview content-level changes before pushHi! First off, thanks for building olcli — the git remote helper alone has made my Overleaf workflow so much better.
I searched existing issues and didn't find a prior proposal for this.
So I'd like to propose a new command, and I'm happy to lead the implementation myself if you think it fits the project's direction.
Motivation
olcli push --dry-runshows which files would change, but not what changed inside them. Two scenarios where content-level diff matters:git diffbefore committing).latexdiff) is the standard way journals and advisors expect to see revisions.Proposed design
Core command (no external dependencies)
.olcli.jsonmanifest to determine which files to compare, so it only fetches remote content for files that differ--name-onlyto list changed files,--file <path>to diff a single fileOptional latexdiff integration (opt-in flags)
latexdiffis available on PATH, generate a marked-up.tex(deletions struck through in red, additions underlined in blue)--pdf, compile the marked-up file via Overleaf's remote compiler (reusing the existing compile machinery) — so users without a local TeX installation still get a reviewable PDFlatexdiffisn't installedImplementation sketch
diffnpm package (or similar) — no new heavy depsOverleafClientmethods.olignoreetc.)Out of scope (for now)
Keeping the first iteration small on purpose. Possible follow-ups if there's interest: diffing between two points in time via the git remote helper, tagging "review checkpoints", auto-creating a review project on Overleaf.
Questions for you
If this sounds good, I'll start with a draft PR for the core
olcli diffcommand. Thanks!