Command-line interface for Overleaf — Sync, manage, and compile LaTeX projects from your terminal. Work with Overleaf projects directly from your command line.
$ npx -y skills add aloth/olcli --agent claude-code
Command-line interface for Overleaf — Sync, manage, and compile LaTeX projects from your terminal.
Work with Overleaf projects directly from your command line. Edit locally with your favorite editor, version control with Git, and sync seamlessly with Overleaf's cloud compilation.
diff --latexdiff produces the struck-through/underlined PDF advisors and journals ask for.olignore.bbl, .log, .aux for arXiv submissions)Perfect for:
brew tap aloth/tap
brew install olcli
npm install -g @aloth/olcli
Or use with npx without installation:
npx @aloth/olcli list
npx skills add aloth/olcli
Session cookie (overleaf.com and self-hosted):
olcli auth --cookie "your_session_cookie_value"
Email/password (self-hosted without reCAPTCHA):
olcli auth --email "you@example.com"
# prompts for the password, so it stays out of your shell history
The password is not stored unless you pass --save-password. A session
cookie is saved either way and is what later commands use; the password only
buys an automatic re-login once that cookie expires. For scripts, set
OVERLEAF_EMAIL and OVERLEAF_PASSWORD — every command reads them, so a
scripted run never needs olcli auth at all.
olcli list
olcli pull "My Thesis"
cd My_Thesis/
vim main.tex
olcli push
olcli pdf
# Compile a specific .tex file (for multi-doc projects):
olcli pdf -r appendix.tex
git clone overleaf::https://www.overleaf.com/project/<id>
cd <project>
# edit, commit, push — standard git workflow
git push
See Git Remote Helper docs for details.
All commands auto-detect the project when run from a synced directory (contains .olcli.json).
| Command | Description |
|---|---|
olcli auth | Set session cookie or login with email/password |
olcli whoami | Check authentication status |
olcli logout | Clear the global config and the local .olauth, reporting each |
olcli list | List all projects |
olcli info [project] | Show project details and file list |
olcli pull [project] [dir] | Download project files to local directory |
olcli push [dir] | Upload local changes to Overleaf (--delete also removes files deleted locally) |
olcli sync [dir] | Bidirectional sync (pull + push) |
olcli diff [project] [dir] | Show content-level changes between local files and the remote |
olcli upload <file> [project] | Upload a single file (--to <path> sets the remote destination) |
olcli download <file> [project] | Download a single file |
olcli delete <file> [project] | Delete a remote file or folder (alias: rm) |
olcli rename <old> <new> [project] | Rename a remote file or folder (alias: mv) |
olcli project create <name> | Create a blank or example project (--template blank|example) |
olcli project rename <new> [project] | Rename the project itself (--dry-run) |
olcli project rename-bulk | Rename many projects by pattern (dry-run unless --apply) |
olcli compile [project] | Trigger PDF compilation |
olcli pdf [project] | Compile and download PDF |
olcli output [type] | Download compile output files |
olcli zip [project] | Download project as zip archive |
olcli comments list [project] | List comments (--status, --context, --concurrency) |
olcli comments add <file> <msg> | Add a comment to selected text |
olcli comments reply <id> <body> | Reply to a comment thread |
olcli comments resolve <id> | Resolve a comment thread |
olcli comments reopen <id> | Reopen a resolved thread |
olcli comments delete <id> | Delete a comment thread |
olcli ignored [dir] | List ignore patterns in effect |
olcli config set-url <url> | Set self-hosted base URL |
olcli config get-url | Show the configured base URL |
olcli config set-cookie-name <name> | Set session cookie name |
olcli config get-cookie-name | Show the configured session cookie name |
olcli config set-timeout <ms> | Set default HTTP timeout |
olcli config get-timeout | Show the configured HTTP timeout |
olcli check | Show config paths and credential sources |
The compile-related commands (compile, pdf, output) accept:
| Flag | Description |
|---|---|
-r, --resource <path> | Compile a specific .tex file as the root document (e.g. appendix.tex, folder/test.tex) |
Useful in multi-doc projects: each -r run compiles the file as if it were the main document.
| Flag | Description |
|---|---|
--verbose | Print HTTP requests and responses to stderr |
--base-url <url> | Override Overleaf instance URL |
--cookie-name <name> | Override session cookie name |
--timeout <ms> | Override HTTP timeout (default: 10000) |
--force to overwrite local changes--all to upload all files, --dry-run to preview--no-delete to opt out--dry-run to preview without applyingolcli diff compares the bytes of your local files against the project's
current contents and prints a unified diff.
olcli diff # every changed file, as patches
olcli diff --name-only # just the changed paths
olcli diff --file main.tex # one file
olcli diff -U 8 # wider context
olcli diff --exit-code # exit 1 if anything differs, for CI
The remote side is fetched fresh on every run. The diff describes the
project as it is at that moment — which is what a subsequent push would
overwrite — not a comparison against your last pull. .olcli.json records
remote paths, never remote contents, so there is no stored snapshot to
compare against; and the whole project arrives in a single request, the same
one pull makes, so fetching fresh costs one round trip rather than one per
file. A collaborator editing between diff and push can still change the
outcome, which is why the fetch time is printed.
In the output, a/ is the remote and b/ is local: a + line is content
push would upload, a - line is content it would overwrite. Files that
differ only in bytes that are not text (PDFs, images) are reported as
Binary files ... differ. Both sides pass through the same ignore layers, so
build artifacts sitting on Overleaf are not reported as locally deleted.
diff --name-only and push --dry-run answer different questions and will
disagree. push --dry-run lists files whose modification time is newer
than the last pull, because that is what push uploads; diff lists files
whose contents actually differ. A file you touched without editing appears
in the first and not the second.
A unified diff is the right artifact for a developer and the wrong one for a
thesis advisor. --latexdiff marks the same revision up inside the document
instead — deletions struck through, additions underlined — which is what
advisors and journals ask for.
olcli diff --latexdiff # write .olcli-diff/main-diff.tex
olcli diff --latexdiff --pdf # ...and compile it, download .olcli-diff/main-diff.pdf
Requires latexdiff on your PATH. It ships with TeX Live and MacTeX; nothing
else in olcli diff needs an external tool.
--pdf compiles on Overleaf, so you do not need a local TeX installation.
The compile endpoint can only build a file that is in the project, so the
marked-up document is uploaded as olcli-latexdiff.tex next to your root
document, compiled, downloaded, and then removed. The command says so before it
does it, refuses to overwrite a file of that name if one already exists, and
prints the exact olcli rm command if the cleanup itself fails.
\input and \include are inlined before comparing (--no-flatten to opt
out). Without that, a remote compile would resolve those against the files
sitting in the project — the old content — and quietly produce a PDF showing
every input file as unchanged.
Output goes to .olcli-diff/, which is dotted so that push and sync never
pick it up; -o <path> puts it elsewhere. The root document is the .tex file
declaring \documentclass; if several do, --main <path> picks one rather
than the command guessing. --latexdiff-opt passes anything else straight
through, e.g. --latexdiff-opt --math-markup=0.
One limit worth knowing: --pdf compiles against the project, not against your
working directory, so anything the markup needs must already be on Overleaf. A
.sty or .cls you added locally fails the compile — the compiler log is
written next to the marked-up source when that happens. A figure you added
locally does not fail it; Overleaf draws a placeholder box naming the missing
file and the rest of the PDF is fine.
diff as a CI gate--exit-code turns the command into a check, with the statuses diff(1) uses:
| Status | Meaning |
|---|---|
0 | Nothing differs |
1 | Something differs |
olcli is a Claude Code plugin with 1 hand-picked skill, indexed on Flowy in the Writing category. Install it with the command on its page. It includes olcli. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it