Help with the process of downloading Overleaf projects, sync them into a local Git repository, generate AI-assisted commit messages, and sync the changes remotely.
- 🔄 Sync Overleaf Projects: Helps download .zip exports of Overleaf projects via Selenium.
- 🧠 AI-Powered Commit Messages: Uses OpenWebUI with LLaMA model to generate meaningful commit messages based on git diff.
- 🧪 Logging: Logs everything into timestamped log files.
- Python 3.9+
- Firefox (for Selenium)
- geckodriver in $PATH
- Overleaf account (read-only share URL)
- Git repository for syncing, git configuration set up
- OpenWebUI instance with API access
- Install dependencies
pip install -r requirements.txt
- Set up .env Create a .env file in the root directory:
OVERLEAF_URL=https://www.overleaf.com/read/abc123...
GIT_REPO_PATH=~/your/local/git/repo
TMP_ZIP_FOLDER=/tmp/
LOGS_FOLDER=/tmp/overleaf_logs
OPENWEBUI_URL=http://localhost:3000
API_KEY=your_openwebui_api_key
-
Install Firefox & Geckodriver
-
Run the main script:
python main.py --overleaf_url https://www.overleaf.com/read/abc123 \
--git_path ~/my-paper \
--log_level DEBUG \
--openwebui_url http://localhost:3000 \
--api_key sk-abc...
You can omit CLI args to use values from .env.
Note
Configuring a cron job to run this script periodically is recommended for continuous syncing.
Variable | Description |
---|---|
OVERLEAF_URL |
Share URL of the Overleaf project (read-only) |
GIT_REPO_PATH |
Path to the local Git repo where LaTeX files are synced |
TMP_ZIP_FOLDER |
Temp directory for Overleaf .zip downloads |
LOGS_FOLDER |
Directory for storing log files |
OPENWEBUI_URL |
Base URL of the OpenWebUI instance |
API_KEY |
API key for authenticating with OpenWebUI |
- Launches a headless Firefox browser via Selenium.
- Logs into Overleaf (via shared link)
- Downloads the .zip file of the project.
- Unzips the .zip archive into a Git repo.
- Runs git diff to detect changes.
- Sends the diff to OpenWebUI for commit message generation.
- Adds, commits, and pushes the changes to the remote repo.
main.py - Entry point
helpers.py - Logging, datetime utilities, OpenWebUI helper
parser.py - Selenium-based Overleaf project downloader
git.py - Git CLI wrapper for add/commit/push/diff
- geckodriver must be installed and match Firefox version.
- Assumes Overleaf’s UI doesn’t change, based on XPath selectors
- AI-generated commit messages may contain errors or irrelevant text.
Important
This tool is intended for personal use. It helps download Overleaf projects via publicly shared read-only URLs. It is the user's responsibility to ensure their use of this tool complies with Overleaf's terms. The authors take no responsibility for misuse of this software.
See LICENSE for details.