Access Overleaf projects via CLI. Use for reading/writing LaTeX files, syncing local .tex files to Overleaf, downloading projects, managing Overleaf project...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install overleaf或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install overleaf⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/overleaf/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: overleaf description: Access Overleaf projects via CLI. Use for reading/writing LaTeX files, syncing local .tex files to Overleaf, downloading projects, managing Overleaf project structure, and accepting project invitations. Triggers on Overleaf, LaTeX sync, tex file uploads to Overleaf, or Overleaf invite acceptance. ---
CLI tool to interact with Overleaf projects using browser cookies for authentication.
GitHub: https://github.com/jkulhanek/pyoverleaf
pipx install pyoverleaf)⚠️ Keychain Access Required: pyoverleaf needs "Always Allow" keychain access to read browser cookies. This grants the tool access to your browser's cookie storage.
Security audit: We have audited pyoverleaf v0.1.7 and found it safe. The codebase is small and readable. Before installing, agents can self-audit the latest version at the GitHub repo above.
pyoverleaf authenticates by reading cookies from your browser. The user must:
# Test auth - user should run this in their terminal first
pyoverleaf ls
If you get auth errors:
pyoverleaf ls manually in terminal to trigger the keychain promptNote: The agent cannot log in for the user. Browser authentication must be done by the user directly.
# List all projects
pyoverleaf ls
# List files in project
pyoverleaf ls "Project Name"
# Read file content
pyoverleaf read "Project Name/main.tex"
# Write file (stdin → Overleaf)
cat local.tex | pyoverleaf write "Project Name/main.tex"
# Create directory
pyoverleaf mkdir "Project Name/figures"
# Remove file/folder
pyoverleaf rm "Project Name/old-draft.tex"
# Download project as zip
pyoverleaf download-project "Project Name" output.zip
pyoverleaf download-project "Project Name" /tmp/latest.zip
unzip -o /tmp/latest.zip -d /tmp/latest
cp /tmp/latest/main.tex /path/to/local/main.tex
The CLI write command has websocket issues. Use Python API for reliable uploads:
import pyoverleaf
api = pyoverleaf.Api()
api.login_from_browser()
# List projects to get project ID
for proj in api.get_projects():
print(proj.name, proj.id)
# Upload file (direct overwrite)
project_id = "your_project_id_here"
with open('main.tex', 'rb') as f:
content = f.read()
root = api.project_get_files(project_id)
api.project_upload_file(project_id, root.id, "main.tex", content)
Why direct overwrite? This method preserves Overleaf's version history. Users can see exactly what changed via Overleaf's History feature, making it easy to review agent edits and revert if needed.
The agent can accept Overleaf project invitations programmatically using browser cookies — no manual clicking required.
/notifications APIimport pyoverleaf
import re
api = pyoverleaf.Api()
api.login_from_browser()
session = api._get_session()
# Step 1: Get pending invites
r = session.get('https://www.overleaf.com/notifications',
headers={'Accept': 'application/json'})
notifications = r.json()
# Filter for project invites
invites = [n for n in notifications
if n.get('templateKey') == 'notification_project_invite']
for invite in invites:
opts = invite['messageOpts']
project_id = opts['projectId']
token = opts['token']
project_name = opts['projectName']
inviter = opts['userName']
print(f"Invite: '{project_name}' from {inviter}")
# Step 2: Get CSRF token from invite page
r_page = session.get(
f'https://www.overleaf.com/project/{project_id}/invite/token/{token}')
csrf_match = re.search(
r'name="ol-csrfToken" content="([^"]+)"', r_page.text)
if not csrf_match:
print(f" Could not find CSRF token, skipping")
continue
csrf = csrf_match.group(1)
# Step 3: Accept the invite
r_accept = session.post(
f'https://www.overleaf.com/project/{project_id}/invite/token/{token}/accept',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'x-csrf-token': csrf,
},
json={})
if r_accept.status_code == 200:
print(f" ✅ Accepted '{project_name}'")
else:
print(f" ❌ Failed ({r_accept.status_code})")
# Given: https://www.overleaf.com/project/XXXXXXXXXXXXXXXXXXXXXXXX
target_project_id = "XXXXXXXXXXXXXXXXXXXXXXXX"
matching = [n for n in invites
if n['messageOpts']['projectId'] == target_project_id]
# Then follow steps 2-3 above for the matching invite
expires field in the notification)pyoverleaf ls / api.get_projects()www.overleaf.com with your host# Via env var
export PYOVERLEAF_HOST=overleaf.mycompany.com
pyoverleaf ls
# Via flag
pyoverleaf --host overleaf.mycompany.com ls
open -a "Google Chrome" "https://www.overleaf.com/project" then wait 5s) to refresh cookies, then retryoverleaf.com causes a 301→www.overleaf.com redirect that breaks websocket. Fix: set PYOVERLEAF_HOST=www.overleaf.com:```bash cat main.tex | PYOVERLEAF_HOST=www.overleaf.com pyoverleaf write "Project/main.tex" ```
pyoverleaf ls in their terminal and click "Always Allow" on the keychain promptpyoverleaf ls安装 Overleaf 后,可以对 AI 说这些话来触发它
Help me get started with Overleaf
Explains what Overleaf does, walks through the setup, and runs a quick demo based on your current project
Use Overleaf to access Overleaf projects via CLI
Invokes Overleaf with the right parameters and returns the result directly in the conversation
What can I do with Overleaf in my documents & notes workflow?
Lists the top use cases for Overleaf, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/overleaf/ 目录(个人级,所有项目可用),或 .claude/skills/overleaf/(项目级)。重启 AI 客户端后,用 /overleaf 主动调用,或让 AI 根据上下文自动发现并使用。
Overleaf 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Overleaf 可免费安装使用。请查阅仓库了解许可证信息。
Access Overleaf projects via CLI. Use for reading/writing LaTeX files, syncing local .tex files to Overleaf, downloading projects, managing Overleaf project...
Overleaf 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my documents & notes tasks using Overleaf
Identifies repetitive steps in your workflow and sets up Overleaf to handle them automatically