| name | overleaf |
| description | Sync and manage Overleaf LaTeX projects from the command line. Pull projects locally, push changes back, compile PDFs, and download compile outputs like .bbl files for arXiv submissions. Use when working with LaTeX, Overleaf, academic papers, or arXiv. |
| license | MIT |
| metadata | {"author":"aloth","version":"1.3","cli":"olcli","install":"brew tap aloth/tap && brew install olcli"} |
Overleaf Skill
Manage Overleaf LaTeX projects via the olcli CLI, native git remote, or MCP server.
When to Use Which Mode
| Mode | Best for | How |
|---|
CLI (olcli) | Interactive workflows, sync, compile, arXiv prep | olcli pull/push/sync/pdf |
| Git remote | Version control, commits, diffs, CI/CD pipelines | git clone overleaf::… then standard git |
| MCP server | AI agents with MCP support (Claude, Cursor, Windsurf) | Connect via olcli-mcp stdio transport |
Use CLI when you need bidirectional sync with conflict detection, compilation, or comment management. Use Git remote when you want proper git history, branches, and standard git push/pull. Use MCP when an AI agent has native MCP support and doesn't need to shell out.
Installation
brew tap aloth/tap && brew install olcli
npm install -g @aloth/olcli
Authentication
Get your session cookie from Overleaf:
- Log into overleaf.com
- Open DevTools (F12) → Application → Cookies
- Copy the value of
overleaf_session2
olcli auth --cookie "YOUR_SESSION_COOKIE"
Verify with:
olcli whoami
Debug authentication issues:
olcli check
Clear stored credentials:
olcli logout
Self-hosted Overleaf
olcli config set-url https://overleaf.yourcompany.com
olcli config set-cookie-name overleaf.sid
olcli auth --cookie "YOUR_COOKIE"
Or pass per-command: olcli --base-url https://overleaf.yourcompany.com list
Git Remote Helper
Use Overleaf projects as native git remotes. No wrapper scripts needed.
git clone overleaf::https://www.overleaf.com/project/<id>
cd <project>
vim main.tex
git add . && git commit -m "update introduction"
git push
git pull
Authentication: reads OVERLEAF_SESSION env var, ~/.olauth file, or stored config (same as CLI).
For self-hosted instances, just use your instance URL:
git clone overleaf::https://overleaf.yourcompany.com/project/<id>
Debug with: GIT_REMOTE_OVERLEAF_DEBUG=1 git push
MCP Server
Built-in Model Context Protocol server for AI assistant integration.
olcli-mcp
npx @aloth/olcli-mcp
Available MCP tools: list_projects, get_project_info, pull_project, push_file, compile, download_pdf, list_comments, get_entities, download_file, add_comment, reply_to_comment, resolve_comment, delete_entity, rename_entity, compile_with_outputs.
Auth: set OVERLEAF_SESSION env var in MCP config, or use stored credentials from olcli auth.
Common Workflows
Pull a project to work locally
olcli pull "My Paper"
cd My_Paper/
Edit and sync changes
olcli push
olcli sync
olcli sync --no-delete
Delete or rename remote files
olcli delete chapters/old.tex
olcli rm figures/old.pdf
olcli rename old.tex new.tex
olcli mv chapters/draft.tex chapters/intro.tex
Inspect ignore rules
olcli ignored
olcli push --show-ignored
olcli sync --no-ignore
Compile and download PDF
olcli pdf
olcli pdf -o paper.pdf
olcli compile
Download .bbl for arXiv submission
olcli output bbl
olcli output bbl -o main.bbl
olcli output --list
Upload figures or assets
olcli upload figure1.png "My Paper"
olcli upload diagram.pdf
Download specific files
olcli download main.tex "My Paper"
olcli zip "My Paper"
Review comments
olcli comments list
olcli comments list --status open
olcli comments list --context
olcli comments add main.tex "Fix this citation" --from 10 --to 15
olcli comments reply <thread-id> "Done!"
olcli comments resolve <thread-id>
olcli comments reopen <thread-id>
olcli comments delete <thread-id>
arXiv Submission Workflow
Complete workflow for preparing an arXiv submission:
olcli pull "Research Paper"
cd Research_Paper
olcli compile
olcli output bbl -o main.bbl
olcli output aux -o main.aux
zip arxiv.zip *.tex main.bbl figures/*.pdf
Commands Reference
| Command | Description |
|---|
olcli auth --cookie <value> | Authenticate with session cookie |
olcli auth --email <e> --password <p> | Authenticate with password (self-hosted) |
olcli whoami | Check authentication status |
olcli logout | Clear stored credentials |
olcli check | Show config paths and credential sources |
olcli list | List all projects |
olcli info [project] | Show project details |
olcli pull [project] [dir] | Download project files |
olcli push [dir] | Upload local changes |
olcli sync [dir] | Bidirectional sync |
olcli upload <file> [project] | Upload a single file |
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 ignored [dir] | List active ignore patterns |
olcli zip [project] | Download as zip archive |
olcli compile [project] | Trigger compilation |
olcli pdf [project] | Compile and download PDF |
olcli output [type] | Download compile outputs |
olcli comments list [project] | List review comments |
olcli comments add <file> <msg> | Add a comment |
olcli comments reply <id> <body> | Reply to a thread |
olcli comments resolve <id> | Resolve a thread |
olcli comments reopen <id> | Reopen a thread |
olcli comments delete <id> | Delete a thread |
olcli config set-url <url> | Set self-hosted base URL |
olcli config set-cookie-name <name> | Set cookie name |
olcli config set-timeout <ms> | Set HTTP timeout |
Tips
- Auto-detect project: Run commands from a synced directory (contains
.olcli.json) to skip the project argument
- Dry run: Use
olcli push --dry-run or olcli sync --dry-run to preview before applying
- Force overwrite: Use
olcli pull --force to overwrite local changes
- Two-way deletes:
olcli sync propagates local deletions to the remote; use --no-delete to opt out per run
- Build artifacts:
.aux, .bbl, .log, .synctex.gz etc. are filtered by default. Add custom patterns to a .olignore file (gitignore-style)
- PDF rule:
thesis.pdf next to thesis.tex is auto-ignored; standalone figures/diagram.pdf is preserved
- Project ID: You can use project ID instead of name (24-char hex from URL)
- Debug auth: Run
olcli check to see where credentials are loaded from
- Timeout:
olcli --timeout 60000 pull "Big Project" or olcli config set-timeout 60000