https://github.com/chenle02/overleaf-manage
Manage Overleaf projects from the terminal - create, invite, tag, clone, archive, delete. The missing gh for Overleaf.
https://github.com/chenle02/overleaf-manage
academic-writing cli collaboration latex overleaf project-management terminal
Last synced: about 1 month ago
JSON representation
Manage Overleaf projects from the terminal - create, invite, tag, clone, archive, delete. The missing gh for Overleaf.
- Host: GitHub
- URL: https://github.com/chenle02/overleaf-manage
- Owner: chenle02
- License: mit
- Created: 2026-04-11T22:59:20.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-12T01:03:05.000Z (3 months ago)
- Last Synced: 2026-04-12T01:12:38.041Z (3 months ago)
- Topics: academic-writing, cli, collaboration, latex, overleaf, project-management, terminal
- Language: Python
- Size: 25.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

**Create projects, invite collaborators, tag, clone, archive, delete — all from your terminal.**
[](LICENSE)
[](https://python.org)
[](#-installation)
[](#-installation)
[](#-installation)
[](#-git-integration)
[](#-llm--ai-agent-integration)
[](#-llm--ai-agent-integration)
[](#-llm--ai-agent-integration)
[Installation](#-installation) · [Quick Start](#-quick-start) · [Commands](#-command-reference) · [Git](#-git-integration) · [Tags](#%EF%B8%8F-tag-system) · [LLM Integration](#-llm--ai-agent-integration) · [How It Works](#%EF%B8%8F-how-it-works)
---
## Why?
GitHub has [`gh`](https://cli.github.com/) — create repos, manage PRs, invite collaborators, automate workflows, all from your shell.
**Overleaf has 25 million+ users — and no CLI for project management.**
Tools like [`olcli`](https://github.com/iamhyc/Overleaf-CLI) and [`pyoverleaf`](https://github.com/jkulhanek/pyoverleaf) cover file sync and PDF compilation. But you still can't do the basics from a terminal:
- **Create a project** → must open browser
- **Invite a collaborator** → must open browser
- **Tag and organize projects** → must open browser
`overleaf-manage` fills this gap. One script, zero config beyond `olcli` auth, every command outputs JSON for scripting.
## Feature Comparison
| Feature | Overleaf Web | olcli | **overleaf-manage** |
|:--------|:---:|:---:|:---:|
| Create project | ✅ | ❌ | ✅ |
| Invite collaborator | ✅ | ❌ | ✅ |
| Remove collaborator | ✅ | ❌ | ✅ |
| List collaborators | ✅ | ❌ | ✅ |
| Tag / label projects | ✅ | ❌ | ✅ |
| Clone project | ✅ | ❌ | ✅ |
| Rename project | ✅ | ❌ | ✅ |
| Archive / trash | ✅ | ❌ | ✅ |
| Git clone / push | ✅ | ❌ | ✅ *(via git bridge)* |
| Pull / push files | ✅ | ✅ | — *(use olcli)* |
| Compile PDF | ✅ | ✅ | — *(use olcli)* |
| JSON output | ❌ | ❌ | ✅ |
| LLM tool-use ready | ❌ | ❌ | ✅ |
> **`overleaf-manage` + `olcli` = complete terminal-first Overleaf workflow.**
## 📦 Installation
```bash
# 1. Download the script
curl -fsSL https://raw.githubusercontent.com/chenle02/overleaf-manage/main/overleaf-manage \
-o ~/.local/bin/overleaf-manage
chmod +x ~/.local/bin/overleaf-manage
# 2. Install the one dependency
pip install requests
# 3. Authenticate (one-time — shares cookie with olcli)
npm install -g @aloth/olcli
olcli auth --cookie "YOUR_SESSION_COOKIE"
```
🔑 How to get your session cookie
1. Log into [overleaf.com](https://www.overleaf.com) in your browser
2. Open DevTools (`F12`) → **Application** → **Cookies** → `www.overleaf.com`
3. Copy the value of `overleaf_session2`
4. Run: `olcli auth --cookie "paste_value_here"`
**Auto-extract from Firefox (Linux):**
```bash
# Find your profile directory
ls ~/.mozilla/firefox/ # standard install
ls ~/snap/firefox/common/.mozilla/firefox/ # snap install
# Extract & authenticate in one shot (replace YOUR_PROFILE)
COOKIE=$(python3 -c "
import sqlite3, shutil
shutil.copy(
'$HOME/snap/firefox/common/.mozilla/firefox/YOUR_PROFILE.default/cookies.sqlite',
'/tmp/ff_cookies.sqlite')
conn = sqlite3.connect('/tmp/ff_cookies.sqlite')
print(conn.execute(
\"SELECT value FROM moz_cookies WHERE host LIKE '%overleaf%' AND name='overleaf_session2'\"
).fetchone()[0])
conn.close()
") && olcli auth --cookie "$COOKIE"
```
The cookie stays valid for **weeks**. Re-run when auth fails.
## 🚀 Quick Start
```bash
# Create a project and invite collaborators
overleaf-manage create "Article-New-Idea"
overleaf-manage invite "Article-New-Idea" alice@mit.edu
overleaf-manage invite "Article-New-Idea" bob@stanford.edu --role viewer
# Organize with tags
overleaf-manage tag "Article-New-Idea" SPDE
overleaf-manage tag "Article-New-Idea" Draft
# Work locally with olcli
olcli pull "Article-New-Idea"
vim main.tex
olcli sync && olcli pdf
# Browse your portfolio
overleaf-manage ls --tag SPDE --sort name
overleaf-manage info "Article-New-Idea"
```
## 📖 Command Reference
### Project Lifecycle
| Command | Description | Example |
|:--------|:------------|:--------|
| `create ` | Create a new project | `overleaf-manage create "My Paper"` |
| `clone ` | Duplicate a project | `overleaf-manage clone "My Paper" "v2"` |
| `rename ` | Rename a project | `overleaf-manage rename "Old" "New"` |
| `archive ` | Archive (hide from list) | `overleaf-manage archive "Done Paper"` |
| `unarchive ` | Restore from archive | `overleaf-manage unarchive "Done Paper"` |
| `trash ` | Soft-delete | `overleaf-manage trash "Scratch"` |
| `untrash ` | Restore from trash | `overleaf-manage untrash "Scratch"` |
| `delete ` | **Permanent** delete | `overleaf-manage delete "Bad" --confirm` |
### Collaboration
| Command | Description | Example |
|:--------|:------------|:--------|
| `invite ` | Send invite (editor) | `overleaf-manage invite "Paper" alice@mit.edu` |
| `invite ... --role viewer` | Invite as viewer | `overleaf-manage invite "Paper" bob@mit.edu --role viewer` |
| `invite ... --role reviewer` | Invite as reviewer | `overleaf-manage invite "Paper" carol@mit.edu --role reviewer` |
| `collaborators ` | List all members | `overleaf-manage collaborators "Paper"` |
| `remove-collaborator ` | Remove member | `overleaf-manage remove-collaborator "Paper" bob@mit.edu` |
### Tags & Organization
| Command | Description | Example |
|:--------|:------------|:--------|
| `tag ` | Add tag (auto-creates) | `overleaf-manage tag "Paper" SPDE` |
| `untag ` | Remove tag | `overleaf-manage untag "Paper" SPDE` |
| `tags` | List all tags | `overleaf-manage tags` |
| `tags ` | Show projects in tag | `overleaf-manage tags Research` |
| `tag-create ` | Create empty tag | `overleaf-manage tag-create "Exam"` |
| `tag-rename ` | Rename tag | `overleaf-manage tag-rename "Old" "New"` |
| `tag-delete ` | Delete tag (keeps projects) | `overleaf-manage tag-delete "Bad Tag"` |
### Listing & Filtering
| Command | Description | Example |
|:--------|:------------|:--------|
| `ls` | List active projects | `overleaf-manage ls` |
| `ls --owner` | Only your projects | `overleaf-manage ls --owner` |
| `ls --shared` | Only shared with you | `overleaf-manage ls --shared` |
| `ls --tag ` | Filter by tag | `overleaf-manage ls --tag SPDE` |
| `ls --untagged` | Untagged projects only | `overleaf-manage ls --untagged` |
| `ls --search ` | Search by name | `overleaf-manage ls --search "Article"` |
| `ls --sort name\|date` | Sort results | `overleaf-manage ls --sort name` |
| `ls --all` | Include archived/trashed | `overleaf-manage ls --all` |
| `info ` | Detailed project info | `overleaf-manage info "My Paper"` |
> 💡 **Every command** accepts `--json` for machine-readable output.
## 🔀 Git Integration
Clone and sync Overleaf projects with standard `git` — no `olcli` required. Uses Overleaf's [git bridge](https://www.overleaf.com/learn/how-to/Git_integration) (requires premium plan).
```bash
# One-time setup: store credentials for passwordless access
overleaf-manage git-setup
# Clone any project by name
overleaf-manage git-clone "My Paper"
cd My_Paper/
# Standard git workflow — edits sync to Overleaf
vim main.tex
git add -A && git commit -m "edits" && git push
# Pull collaborators' changes
git pull
```
### Git Commands
| Command | Description | Example |
|:--------|:------------|:--------|
| `git-setup` | Store Overleaf credentials for passwordless git | `overleaf-manage git-setup` |
| `git-clone ` | Clone project via git | `overleaf-manage git-clone "My Paper"` |
| `git-clone ` | Clone into specific directory | `overleaf-manage git-clone "Paper" ~/papers/paper` |
| `git-url ` | Show git clone URL | `overleaf-manage git-url "My Paper"` |
### How `git-setup` works
1. Detects your Overleaf email from your session
2. Prompts for your Overleaf password (stored locally, mode `0600`)
3. Configures `git credential-store` for `git.overleaf.com` only
4. After setup, `git clone/pull/push` work without prompts
```
Credentials: ~/.config/overleaf-manage/git-credentials (mode 0600)
Scope: git.overleaf.com only — does not affect GitHub/GitLab
```
> **Note:** Git bridge requires an Overleaf premium plan. The `info` command always shows the git URL regardless of plan.
## 🏷️ Tag System
Tags are lightweight labels for organizing your Overleaf portfolio — the same tags you see in Overleaf's web sidebar, fully manageable from the terminal.
```bash
# Tag by workflow stage
overleaf-manage tag "Paper A" Draft
overleaf-manage tag "Paper B" Submitted
overleaf-manage tag "Paper C" Accepted
# Tag by topic
overleaf-manage tag "Paper A" SPDE
overleaf-manage tag "Paper A" KPZ
# Filter and browse
overleaf-manage ls --tag SPDE # all SPDE papers
overleaf-manage ls --tag Draft --sort date # drafts by recency
overleaf-manage ls --untagged # what needs organizing?
# Tags auto-create — no need for tag-create first
overleaf-manage tag "Midterm" Exam # creates "Exam" on the fly
```
**Example tag sets:**
| Academic | Teaching | Status |
|:---------|:---------|:-------|
| `SPDE`, `KPZ`, `Probability` | `Course`, `Lecture`, `Homework`, `Exam` | `Draft`, `Submitted`, `Revision`, `Accepted` |
## 🤖 LLM / AI Agent Integration
Every command supports `--json` for structured, deterministic output — designed for **LLM tool-use pipelines**, MCP servers, and scripting.
```bash
# Structured project listing
overleaf-manage ls --owner --json
# Machine-readable project info
overleaf-manage info "My Paper" --json
```
**Example JSON response:**
```json
{
"ok": true,
"action": "info",
"project_id": "abcdef1234567890abcdef12",
"name": "My Paper",
"url": "https://www.overleaf.com/project/abcdef1234567890abcdef12",
"accessLevel": "owner",
"tags": ["SPDE", "Draft"],
"archived": false,
"trashed": false
}
```
**Why this matters for AI agents:**
- 🔧 **Tool-use ready** — AI coding assistants can create Overleaf projects, invite collaborators, and organize work via function calls
- 📊 **Deterministic JSON** — no HTML scraping, no table parsing, just structured data
- ✅ **Reliable error handling** — every response includes `"ok": true/false`
- 🔗 **Composable** — combine with `olcli` for end-to-end LaTeX automation
```bash
# An AI agent setting up a new collaboration:
overleaf-manage create "New Paper" --json # → {"ok": true, "project_id": "..."}
overleaf-manage invite "New Paper" coauthor@university.edu --json
overleaf-manage tag "New Paper" Research --json
```
## ⚙️ How It Works
`overleaf-manage` calls the same internal HTTP endpoints that Overleaf's browser UI uses. No scraping, no headless browser — just clean REST calls authenticated with your session cookie.
```
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ │ cookie │ │ HTTP API │ │
│ Terminal │────────────▶│ overleaf-manage │────────────▶│ Overleaf │
│ │◀────────────│ │◀────────────│ Server │
│ │ JSON/text │ (Python script) │ responses │ │
└──────────────┘ └──────────────────┘ └──────────────┘
```
Authentication is shared with `olcli` via `~/.config/olcli-nodejs/config.json`.
## ⚠️ Limitations
| Limitation | Detail |
|:-----------|:-------|
| **Unofficial** | Not an Overleaf product. Independently developed. |
| **Internal APIs** | Uses undocumented endpoints that may change without notice. |
| **Cookie auth** | No official API keys. Cookies last weeks, then need refresh. |
| **No file sync** | File operations are handled by [`olcli`](https://github.com/iamhyc/Overleaf-CLI). |
## 🔗 See Also
| Tool | What it does |
|:-----|:-------------|
| [`olcli`](https://github.com/iamhyc/Overleaf-CLI) | Pull, push, sync files, compile PDF, download output |
| [`pyoverleaf`](https://github.com/jkulhanek/pyoverleaf) | Python API for file operations |
| [Overleaf](https://www.overleaf.com) | The collaborative LaTeX editor itself |
---
**If this tool saves you time, consider giving it a ⭐**
Made with 🖥️ by [Le Chen](https://github.com/chenle02)