Skip to main content

Pull-only Overleaf project sync using PyOverleaf

Project description

Overleaf Pull-Only Sync CLI

PyPI - Version

Quick Start (users)

# Install with Qt login support
pip install 'overleaf-pull[qt]'

# Guided setup and background install
overleaf-pull init --install

Overview

  • Pull-only tool that periodically clones/pulls your latest Overleaf projects into a local directory.
  • Discovers projects via cookies captured during setup (Qt login recommended) or manual paste; Firefox cookies can be read automatically.
  • Lists projects via PyOverleaf; syncs using Git.
  • Runs in the background as a macOS LaunchAgent or Linux systemd user timer.

Requirements

  • macOS or Linux with Git installed.
  • Python 3.10+.
  • Dependencies are installed automatically via pip. Optional extras: [qt] for PySide6 (Qt login).
  • Overleaf Git integration enabled on your account to allow cloning/pulling via git.overleaf.com.

Install (pip)

pip install overleaf-pull
# Optional Qt login support:
pip install 'overleaf-pull[qt]'

Quick Setup

overleaf-pull init --install
  • Prompts for the base directory, interval (30m/1h/12h/24h), count (default 10), browser/profile, and host (default www.overleaf.com).
  • Offers a Qt browser login to capture cookies automatically (default Yes if PySide6 is installed). Falls back to optional manual cookie paste.
  • Prompts for your Overleaf Git authentication token (required for cloning/pulling and background runs). It will offer to open Overleaf in your browser to fetch it.
  • Installs a background job (LaunchAgent on macOS, systemd user timer on Linux).
  • Runs a validation sync before installing the scheduler, to confirm access.

Manual Commands Run once now:

overleaf-pull run-once
  • Manual sync (with optional overrides):
overleaf-pull sync --count 5 --base-dir ~/Overleaf --browser firefox
  • Store or clear cookies in config:
  • Folder naming preference:
overleaf-pull set-name-suffix off   # Use display name only
overleaf-pull set-name-suffix on    # Default: append a short ID to avoid collisions

This affects the local folder names only; project display names on Overleaf remain unchanged.

overleaf-pull set-cookie "name=value; other=value2"
overleaf-pull clear-cookie
  • Browser-assisted cookie capture (like olbrowserlogin):
overleaf-pull browser-login
# This opens Overleaf in your browser and guides you to copy document.cookie.

Required cookies

  • At minimum: overleaf_session2 and GCLB must be present in your Cookie header for authenticated requests.
  • document.cookie cannot see HttpOnly cookies; copy the full Cookie header from the Network tab for a request to your Overleaf host.

Qt browser login (optional)

  • Use a built-in Qt browser to log in and auto-capture cookies.
pip install 'overleaf-pull[qt]'
overleaf-pull browser-login-qt

During setup, if PySide6 is present, the tool offers the Qt login flow by default.

Git authentication token

  • Overleaf requires a Git auth token for git clone/git pull.
  • Generate a token in your Overleaf account (see the Git integration/authentication tokens page or the Git instructions shown in your project UI), then set it:
overleaf-pull set-git-token
# Paste your token when prompted

# Clear it if needed
overleaf-pull clear-git-token
  • With a token set, the tool will use URLs like https://git:<TOKEN>@git.overleaf.com/<PROJECT_ID> automatically.
  • Status & timers:
overleaf-pull status
  • Shows a summary of repo health and the last background run.
  • Displays per-project timers indicating when each is next due.
  • Install or remove background job:
overleaf-pull install-scheduler
overleaf-pull uninstall-scheduler

Installing the scheduler is idempotent: it uninstalls any existing instance first, then reinstalls to ensure only one scheduler is active. Publish to PyPI (CI)

  • This repo includes a GitHub Actions workflow that publishes on tags v* using PyPI Trusted Publishers (OIDC).
  • Trigger a release:
git tag v0.1.0
git push origin v0.1.0
  • The workflow builds sdist/wheel and publishes without storing secrets.
  • Adjust interval or latest count:
overleaf-pull set-interval 30m
overleaf-pull set-count 20
  • Change base directory:
overleaf-pull set-base-dir /path/to/Overleaf

macOS Logs

  • Logs: ~/Library/Logs/overleaf_sync/runner.log

Linux Logs

  • journalctl --user -u overleaf-sync.timer -u overleaf-sync.service
  • And ~/.local/state/overleaf_sync/logs/ if configured.

Notes

  • This tool is pull-only; it never pushes to Overleaf.
  • Safari cookie access may require permissions; Firefox is often more reliable for unattended use.
  • If Safari access fails, paste Overleaf cookies once via set-cookie to avoid elevated access.
  • Use Git credential helpers for smooth pulls:
git config --global credential.helper osxkeychain   # macOS
git config --global credential.helper libsecret     # Linux

Background runs

  • To avoid interactive Git prompts in schedulers, set an Overleaf Git token once:
overleaf-pull set-git-token
  • Without a token, new clones will fail with 403; existing repos may also fail if their remotes lack the token. Prompts are disabled in background.

Dynamic scheduling (per-project backoff)

  • The background worker runs on a frequent cadence (e.g., every 30 minutes).
  • Each project has its own timer with exponential backoff:
    • Minimum interval: 30 minutes. Doubles on no changes, up to 24 hours.
    • Resets to 30 minutes when changes are detected and pulled.
  • The status command shows the next-due times for the latest projects.

Development

  • Create a local environment and install from source:
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
# Optional Qt support
pip install PySide6
  • Conda alternative:
conda env create -f environment.yml
conda activate overleaf-sync
pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overleaf_pull-0.3.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

overleaf_pull-0.3.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file overleaf_pull-0.3.0.tar.gz.

File metadata

  • Download URL: overleaf_pull-0.3.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for overleaf_pull-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b74e950ad5045a4261f14f839375f2ff0f1465da807a4ce0a29fb1d9ec2d8931
MD5 422a19537a9f02e9eb8dc410c92b8002
BLAKE2b-256 da1616cfddac394f0c73967939f23d3c478e1433fa07db4c776ab90cc634b0af

See more details on using hashes here.

Provenance

The following attestation bundles were made for overleaf_pull-0.3.0.tar.gz:

Publisher: publish.yml on LeanderK/overleaf_sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file overleaf_pull-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: overleaf_pull-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for overleaf_pull-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb7f35c7e66ba6e84debd6a51797d26328485c56a3c5c8d45344d71e1397a9f6
MD5 8c785824cb3e318861f75be7dd2ec563
BLAKE2b-256 7d605561ee79da3ca381ef49740dcd8e506f11dc8599adcc0a5f69466786b7c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for overleaf_pull-0.3.0-py3-none-any.whl:

Publisher: publish.yml on LeanderK/overleaf_sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page