원클릭으로
overleaf-git-sync
Safe instructions for agents using the `ol` command to sync Overleaf projects with a local Git workflow.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Safe instructions for agents using the `ol` command to sync Overleaf projects with a local Git workflow.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | overleaf-git-sync |
| description | Safe instructions for agents using the `ol` command to sync Overleaf projects with a local Git workflow. |
This file teaches coding agents how to use the ol command safely when working
on an Overleaf project through a local Git repository.
The core model is:
Overleaf project <-> ol <-> local Git repository <-> agent / editor
Treat Overleaf as the remote project state. Treat the local Git repository as the real working area.
Never push stale local content over newer Overleaf content.
Always prefer the normal Git-style flow:
ol pull
git diff --cached
git commit -m "overleaf: import latest remote snapshot"
# edit locally
git add -A
git commit -m "agent: make requested changes"
ol push --dry-run
ol push
Before running ol, the agent should first locate the overleaf-git-sync
repository, activate the virtual environment where ol was installed, and only
then switch to the target paper directory.
Typical setup:
cd /path/to/overleaf-git-sync
source .venv/bin/activate
cd /path/to/paper-project
ol --help
Do not assume ol is available before the environment is activated.
For local or self-hosted Overleaf:
ol auth login --host http://localhost --email you@example.com
For the official Overleaf site, cookie login is usually more reliable:
printf '%s' 'overleaf_session2=...' | \
ol auth login --host https://www.overleaf.com --cookie-stdin
This stores the session in .ol-sync/session.json.
ol init --project-id YOUR_PROJECT_ID --project-name my-paper
Notes:
.git, ol init will run
git init..ol-sync/config.toml already exists, ol init overwrites it by default.--keep-config if the existing config should be kept.Always pull before changing files:
ol pull
If ol pull stages remote changes, inspect and commit them first:
git diff --cached
git commit -m "overleaf: import latest remote snapshot"
Typical editable files:
.tex.bib.sty.cls.bst.md.txt.csvAfter editing:
git diff
git add -A
git commit -m "agent: update manuscript"
Preview first:
ol push --dry-run
Then push:
ol push
Fast mode skips importing the freshness snapshot into Git, but still checks the live remote tree before each write:
ol push --fast
--fast aborts if the live remote differs from the saved remote branch and still
verifies after push.
Quick local status:
ol status
Full remote comparison:
ol verify
ol pull in a normal workflow.ol status means the remote is fresh; use ol verify for
real remote comparison.ol push --fast when remote changes need to be imported and
reviewed locally before planning the push.For most tasks, use this exact sequence:
ol pull
git diff --cached
# if staged remote changes exist:
git commit -m "overleaf: import latest remote snapshot"
# make local edits
git diff
git add -A
git commit -m "agent: requested changes"
ol push --dry-run
ol push
If ol pull or ol push reports conflicts:
git status.ol push.Example:
git status
git add conflicted-file.tex
git commit -m "resolve Overleaf sync conflict"
ol push
ol auth login — save Overleaf login sessionol auth status — check whether the saved session still worksol auth logout — delete the saved local sessionol init — initialize sync metadata in the current directoryol pull — import the latest remote snapshot and stage it for reviewol push — push committed local changes back to Overleafol push --fast — skip freshness import but retain live baseline checksol recover — import and reconcile an interrupted push through Gitol status — show local sync stateol verify — compare local contents with the latest remote snapshot