Overleaf CLI — Sync and manage your LaTeX projects from the command line.
- 📋 List all your Overleaf projects
- ⬇️ Pull project files to local directory
- ⬆️ Push local changes back to Overleaf
- 🔄 Sync bidirectionally with smart conflict detection
- 📄 Compile and download PDFs
- 📦 Download individual files or full project archives
- 📤 Upload files to projects
- 📊 Output compile artifacts (
.bbl,.log,.auxfor arXiv submissions)
brew tap aloth/tap
brew install olclinpm install -g @aloth/olcliGet your session cookie from Overleaf:
- Log into overleaf.com
- Open Developer Tools (F12) → Application → Cookies
- Copy the value of
overleaf_session2
olcli auth --cookie "your_session_cookie_value"olcli listolcli pull "My Thesis"
cd My_Thesis/# Edit files locally with your favorite editor
vim main.tex
# Push changes back to Overleaf
olcli push
# Or sync bidirectionally
olcli syncolcli pdfAll commands auto-detect the project when run from a synced directory (contains .olcli.json).
| Command | Description |
|---|---|
olcli auth |
Set session cookie |
olcli whoami |
Check authentication status |
olcli logout |
Clear stored credentials |
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 |
olcli sync [dir] |
Bidirectional sync (pull + push) |
olcli upload <file> [project] |
Upload a single file |
olcli download <file> [project] |
Download a single file |
olcli zip [project] |
Download project as zip archive |
olcli compile [project] |
Trigger PDF compilation |
olcli pdf [project] |
Compile and download PDF |
olcli output [type] |
Download compile output files |
olcli check |
Show config paths and credential sources |
Download the .bbl file for arXiv submissions:
olcli output bbl --project "My Paper"
# Downloads: bblList all available compile output files:
olcli output --list
# Available output files:
# aux output.aux
# bbl output.bbl
# blg output.blg
# log output.log
# ...- Downloads all files from Overleaf
- Skips local files modified after last pull (won't overwrite your changes)
- Use
--forceto overwrite local changes
- Uploads files modified after last pull
- Use
--allto upload all files - Use
--dry-runto preview changes
- Pulls remote changes
- Preserves local modifications (local wins if newer)
- Pushes local changes to remote
- Use
--verboseto see detailed file operations
Credentials are stored in (checked in order):
OVERLEAF_SESSIONenvironment variable.olauthfile in current directory- Global config:
~/.config/olcli-nodejs/config.json(macOS/Linux)
For project-specific credentials, create .olauth in your project directory:
s%3AyourSessionCookieValue...
# Initial setup
olcli pull "PhD Thesis" thesis
cd thesis
# Daily workflow
vim chapters/introduction.tex
olcli sync
olcli pdf -o draft.pdfolcli pdf "Conference Paper" -o paper.pdfolcli download main.tex "My Project"cd my-project
olcli upload figures/diagram.pngfor proj in $(olcli list --json | jq -r '.[].name'); do
olcli zip "$proj" -o "backups/${proj}.zip"
donecd my-paper
olcli output bbl -o main.bbl
olcli zip -o arxiv-submission.zipIf you get authentication errors, your session cookie may have expired. Get a fresh one from the browser and run olcli auth again.
Check the Overleaf web editor for detailed error logs. Common issues:
- Missing packages
- Syntax errors in
.texfiles - Missing bibliography files
Contributions are welcome! Please open an issue or submit a pull request.
MIT © Alexander Loth
