简介
通过 CLI 与 Overleaf 项目交互,支持 LaTeX 文件的读写、同步与版本管理,适合科研协作场景。
原始描述
Access Overleaf projects via CLI. Use for reading/writing LaTeX files, syncing local .tex files to Overleaf, downloading projects, managing Overleaf project...
通过你的 Agent 添加
安装目录:overleaf/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Overleaf Skill 是一个命令行工具封装,使用户能够通过 CLI 与 Overleaf 云端 LaTeX 编辑平台进行交互。其核心功能包括:列出云端项目、读取和写入 .tex 文件、创建目录结构、下载完整项目压缩包,以及管理项目文件。认证方式独特——通过读取用户浏览器中已登录的 Cookie 实现,无需额外配置 API 密钥。
显著优点
- 零配置认证:利用现有浏览器登录状态,省去复杂的 OAuth 或 API 密钥配置流程
- 版本历史保留:通过 Python API 直接覆盖上传时,完整保留 Overleaf 的版本历史功能,便于追踪修改和回滚
- 自托管支持:兼容企业私有化部署的 Overleaf 实例,通过环境变量或命令行参数灵活切换目标服务器
- 双向同步能力:既可将本地编辑成果推送到云端,也能下载云端项目到本地进行离线处理
- 学术场景优化:专为 LaTeX 学术写作设计,完美契合论文协作、期刊投稿等场景
潜在缺点与局限性
- 平台限制:仅支持 macOS/Windows 上的 Chrome/Firefox,Linux 用户或 Safari 用户无法使用
- 初次授权门槛:首次使用需用户在终端手动运行并批准系统钥匙串访问权限,体验不够流畅
- CLI 写入不稳定:官方明确提示
write 命令存在 WebSocket 问题,复杂上传场景必须使用 Python API
- 无实时同步:区别于官方的 Git 集成或 Dropbox 同步,本工具为手动触发式同步,非自动实时同步
- 项目 ID 依赖:批量操作时需先查询获取项目 ID,交互流程较为繁琐
适合的目标群体
- 学术研究者与研究生:需要频繁在本地 IDE 与 Overleaf 协作平台间切换的 LaTeX 用户
- 技术文档团队:使用自托管 Overleaf 的企业技术写作团队
- 自动化工作流构建者:希望将 Overleaf 集成到 CI/CD 或文档生成流水线中的开发者
- 多设备写作用户:需要在不同机器间迁移或备份 Overleaf 项目的用户
使用风险
- 隐私授权风险:工具需"始终允许"访问系统钥匙串读取浏览器 Cookie,用户需理解此权限范围
- 网络依赖:所有操作依赖 overleaf.com 或自定义服务器的网络可达性,无离线降级能力
- 版本冲突:多人协作场景下,本地覆盖上传可能造成冲突,建议配合 Overleaf 历史功能谨慎使用
- 供应链依赖:依赖 jkulhanek/pyoverleaf 第三方库,需关注其安全更新,建议锁定已审计的 v0.1.7 版本
- 误操作风险:
rm 命令直接删除云端文件无二次确认,建议在关键操作前手动备份
- 平台限制:仅支持 macOS/Windows 上的 Chrome/Firefox,Linux 用户或 Safari 用户无法使用
- 初次授权门槛:首次使用需用户在终端手动运行并批准系统钥匙串访问权限,体验不够流畅
- CLI 写入不稳定:官方明确提示
write命令存在 WebSocket 问题,复杂上传场景必须使用 Python API - 无实时同步:区别于官方的 Git 集成或 Dropbox 同步,本工具为手动触发式同步,非自动实时同步
- 项目 ID 依赖:批量操作时需先查询获取项目 ID,交互流程较为繁琐
适合的目标群体
- 学术研究者与研究生:需要频繁在本地 IDE 与 Overleaf 协作平台间切换的 LaTeX 用户
- 技术文档团队:使用自托管 Overleaf 的企业技术写作团队
- 自动化工作流构建者:希望将 Overleaf 集成到 CI/CD 或文档生成流水线中的开发者
- 多设备写作用户:需要在不同机器间迁移或备份 Overleaf 项目的用户
使用风险
- 隐私授权风险:工具需"始终允许"访问系统钥匙串读取浏览器 Cookie,用户需理解此权限范围
- 网络依赖:所有操作依赖 overleaf.com 或自定义服务器的网络可达性,无离线降级能力
- 版本冲突:多人协作场景下,本地覆盖上传可能造成冲突,建议配合 Overleaf 历史功能谨慎使用
- 供应链依赖:依赖 jkulhanek/pyoverleaf 第三方库,需关注其安全更新,建议锁定已审计的 v0.1.7 版本
- 误操作风险:
rm 命令直接删除云端文件无二次确认,建议在关键操作前手动备份
- 隐私授权风险:工具需"始终允许"访问系统钥匙串读取浏览器 Cookie,用户需理解此权限范围
- 网络依赖:所有操作依赖 overleaf.com 或自定义服务器的网络可达性,无离线降级能力
- 版本冲突:多人协作场景下,本地覆盖上传可能造成冲突,建议配合 Overleaf 历史功能谨慎使用
- 供应链依赖:依赖 jkulhanek/pyoverleaf 第三方库,需关注其安全更新,建议锁定已审计的 v0.1.7 版本
- 误操作风险:
rm命令直接删除云端文件无二次确认,建议在关键操作前手动备份
技能正文
name: overleaf
description: Access Overleaf projects via CLI. Use for reading/writing LaTeX files, syncing local .tex files to Overleaf, downloading projects, and managing Overleaf project structure. Triggers on Overleaf, LaTeX sync, or tex file uploads to Overleaf.
Overleaf
CLI tool to interact with Overleaf projects using browser cookies for authentication.
GitHub: https://github.com/jkulhanek/pyoverleaf
Requirements
- Python 3.8+
- pyoverleaf (
pipx install pyoverleaf)
- User logged into Overleaf in Chrome/Firefox
Security Considerations
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.
Authentication Setup
pyoverleaf authenticates by reading cookies from your browser. The user must:
- Log into Overleaf in Chrome or Firefox (visit overleaf.com and sign in)
- Grant keychain access on first run (macOS will prompt for "Always Allow")
# Test auth - user should run this in their terminal first
pyoverleaf ls
If you get auth errors:
- Ask user: "Are you logged into Overleaf in your browser?"
- If on macOS: "Did you approve the keychain access prompt with 'Always Allow'?"
- User may need to run
pyoverleaf lsmanually in terminal to trigger the keychain prompt
Note: The agent cannot log in for the user. Browser authentication must be done by the user directly.
CLI Commands
# 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
Common Workflows
Download from Overleaf
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
Upload to Overleaf (Python API recommended)
# 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
Download from Overleaf
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.
Self-hosted Overleaf
# Via env var
export PYOVERLEAF_HOST=overleaf.mycompany.com
pyoverleaf ls
# Via flag
pyoverleaf --host overleaf.mycompany.com ls
Troubleshooting
- Auth error: User needs to log into Overleaf in browser first
- Keychain Access Denied (macOS): pyoverleaf needs keychain access to read browser cookies. User must run
pyoverleaf ls in their terminal and click "Always Allow" on the keychain prompt
- Project not found: Use exact project name (case-sensitive), check with
pyoverleaf ls
- Permission denied: User may not have edit access to the project
# Via env var
export PYOVERLEAF_HOST=overleaf.mycompany.com
pyoverleaf ls
# Via flag
pyoverleaf --host overleaf.mycompany.com ls
- Auth error: User needs to log into Overleaf in browser first
- Keychain Access Denied (macOS): pyoverleaf needs keychain access to read browser cookies. User must run
pyoverleaf lsin their terminal and click "Always Allow" on the keychain prompt - Project not found: Use exact project name (case-sensitive), check with
pyoverleaf ls - Permission denied: User may not have edit access to the project
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。