Add Overleaf project automation scripts#30
Merged
Conversation
Two professional bash scripts that automate the lifecycle of the EWRL 2026 paper's Overleaf mirror: bin/setup-overleaf-project.sh — one-shot project provisioning that wires a new alias into overleaf-mcp's config + keychain + local clone in a single command. Token is read from $OVERLEAF_TOKEN so it never appears on the command line (no leak via ps). Performs a version preflight (requires overleaf-mcp >= 0.1.2 for non-interactive flags), runs `overleaf-mcp doctor` at the end to verify, and is idempotent: re-running with --force overwrites the alias, an existing clone is left alone. scripts/mirror_paper_to_overleaf.sh — keeps git canonical and Overleaf as a render/edit mirror. Pulls Overleaf first (so manual web-UI edits aren't clobbered), rsyncs paper/ → clone with --delete, commits, pushes. Excludes LaTeX build artefacts (*.aux, *.bbl, etc.) so only source goes to Overleaf. Skips the commit step entirely if nothing changed; supports --dry-run for previewing. Both scripts validated manually against missing-arg, missing-env, missing-clone, and missing-source-dir error paths. Real end-to-end runs are gated on the user creating an Overleaf project and the upstream overleaf-mcp PR (amcheste/overleaf-mcp#13) merging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Overleaf returns 403 for any clone URL whose user component isn't literally "git" (matching their documented format https://git:<TOKEN>@git.overleaf.com/<PROJECT_ID>). My initial draft used "x:<TOKEN>" by analogy with GitHub's pattern, which 403s. Confirmed against the live API by setup of the EWRL paper project. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two professional bash scripts that automate the lifecycle of the EWRL 2026 paper's Overleaf mirror. Companion to amcheste/overleaf-mcp#13, which adds the non-interactive CLI flags these scripts depend on.
bin/setup-overleaf-project.sh— one-shot project provisioningWires the new alias into the MCP config + keychain + local clone in one command:
overleaf-mcp init --alias ... --project-id ...(registers alias)printf '%s' "$OVERLEAF_TOKEN" | overleaf-mcp auth add --project ... --token-stdin(stores token)git clone https://x:${OVERLEAF_TOKEN}@git.overleaf.com/<id> ...(clones with token redacted from output)overleaf-mcp doctor(verifies green)Token never appears on the command line (no leak via
ps). Version preflight requiresoverleaf-mcp >= 0.1.2and prints clear upgrade instructions otherwise. Idempotent: re-running with--forceoverwrites the alias, an existing clone is left alone.scripts/mirror_paper_to_overleaf.sh— git → Overleaf syncTreats git as canonical, Overleaf as the render/edit mirror:
git pull --ff-only) so manual web-UI edits aren't silently clobbered. If Overleaf has diverged the script aborts with explicit resolution instructions.paper/→ clone with--deleteso removed files are pruned on Overleaf.*.aux,*.bbl,*.log, etc.) — only source goes to Overleaf.How they fit together
The setup script is run once per project. The mirror script is run after every paper edit, or wired into a git post-commit hook.
Test plan
--helprenders cleanly on both scriptsexit 2🤖 Generated with Claude Code