腾讯文档Markdown

v1.1.5

腾讯文档 Markdown 技能,支持新建 Markdown 并写入内容、下载、删除、读取、更新、重命名等操作。

3· 4.2k·0 current·0 all-time
byenoyao@wscats

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wscats/tencent-docs-markdown.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "腾讯文档Markdown" (wscats/tencent-docs-markdown) from ClawHub.
Skill page: https://clawhub.ai/wscats/tencent-docs-markdown
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install tencent-docs-markdown

ClawHub CLI

Package manager switcher

npx clawhub@latest install tencent-docs-markdown
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description (Tencent Docs Markdown: create, read, write, download, delete, rename) match the code and CLI: api.py, auth.py, main.py implement those operations against docs.qq.com. No unrelated credentials or services are requested.
Instruction Scope
SKILL.md and the code consistently instruct installing Python deps and Playwright, performing QR login, and then calling APIs or CLI commands. The runtime actions are limited to browser-based login (Playwright), HTTP requests to docs.qq.com, local cookie storage (.cookies.json), and optional reading of local .md files when the user asks to update from a path. There are no instructions to read unrelated system files or transmit data to external hosts beyond Tencent Docs.
Install Mechanism
Registry shows no install spec, but the package includes package.json, requirements.txt and explicit instructions to run 'pip install -r requirements.txt' and 'playwright install chromium'. Playwright will download Chromium when you run it. This is a standard dependency for browser automation but does require additional downloads and system resources; there are no downloads from unknown personal servers in the repo itself.
Credentials
The skill requests no environment variables or external credentials; authentication is done via QR login and cookies saved to a local .cookies.json. The auth code sanitizes cookies and includes a domain whitelist (docs.qq.com/.qq.com) to limit cookie transmission, which is proportional to the stated purpose.
Persistence & Privilege
The skill stores session cookies in a local .cookies.json file for reuse, which is expected for this use case. It does not request always:true or system-wide privileges, nor does it modify other skills' configs. Autonomous invocation is allowed by default (disable-model-invocation: false) but this is normal platform behavior.
Assessment
This skill appears to implement exactly what it says: a Tencent Docs Markdown client that logs in by QR code and stores cookies locally to operate on docs.qq.com. Before installing, consider: 1) Running in an isolated environment (virtualenv or container) because Playwright will download Chromium and you will install Python packages. 2) .cookies.json contains session tokens—treat it as a secret, store it securely, and avoid committing it to public repos. 3) The login process opens a browser window and requires scanning the QR code with your QQ/WeChat account; doing so grants the skill access to your Tencent Docs session. 4) Review the bundled code (auth.py/api.py) if you want to confirm there are no additional network endpoints; the code shown targets docs.qq.com only. If you do not trust storing Tencent Docs session cookies locally or running browser automation on your machine, do not install/use the skill.

Like a lobster shell, security has layers — review code before you run it.

latestvk97frzc6x5qgydfbk26sqe9ya583m00b
4.2kdownloads
3stars
10versions
Updated 1mo ago
v1.1.5
MIT-0

腾讯文档 Markdown 技能

名称: tencent-docs-markdown 许可证: MIT 简介: 腾讯文档 Markdown 技能,支持新建 Markdown 并写入内容、下载、删除、读取、更新、重命名等操作。


Agent 如何使用此技能

触发短语

当用户表达以下意图时,Agent 应激活此技能:

意图示例短语
新建并写入"新建一个Markdown到腾讯文档并写入内容[xxx]" / "帮我新建腾讯文档md,写入以下内容" / "上传xxx.md到腾讯文档" / "上传xxx.md文档" / "同步xxx.md文档" / "提交xxx.md文档" / "把本地文件同步到腾讯文档"
新建空文档"帮我创建名为xxx.md" / "新建一个Markdown文档"
下载"把https://docs.qq.com/markdown/[xxx]文档保存到本地"
读取"读取https://docs.qq.com/markdown/[xxx]文档内容"
更新"更新[xxx]到https://docs.qq.com/markdown/[xxx]"
删除"删除https://docs.qq.com/markdown/[xxx]"
重命名"重命名https://docs.qq.com/markdown/[xxx]文档为xxx"
查看信息"获取https://docs.qq.com/markdown/[xxx]文档的详情"
登录"登录腾讯文档" / "重新登录" / "Cookie过期了"

Agent 工作流程

flowchart TD
    A[用户请求] --> B{Cookies 有效?}
    B -->|是| C[执行操作]
    B -->|否| D[通过扫码登录]
    D --> E[保存 Cookies]
    E --> C
    C --> F[返回结果 + 文档链接]

快速开始

# 1. 安装依赖
pip install -r requirements.txt
playwright install chromium

# 2. 登录(使用微信/QQ 扫描二维码)
python -m src.main login

# 3. 新建文档并写入内容
python -m src.main write "我的文档" "# Hello World"

功能操作

1. 新建并写入文档

新建一个腾讯文档 Markdown,写入内容后返回文档链接。

命令行:

python -m src.main write "我的文档" "# Hello World\n这是我的文档内容。"

编程接口:

from src.main import handle_create_and_write
result = handle_create_and_write('我的文档', '# Hello World\n这是内容。')
# result: {'docUrl': ..., 'padId': ..., 'globalPadId': ..., 'title': ...}
# → 将 result['docUrl'] 分享给用户

2. 新建空文档

创建一个新的空 Markdown 文档。

命令行:

python -m src.main create "我的新文档"

编程接口:

from src.main import handle_create
result = handle_create('我的文档')
# result: {'docUrl': ..., 'padId': ..., 'globalPadId': ..., 'title': ...}

3. 下载文档

将腾讯文档 Markdown 下载为本地 .md 文件。

注意: 系统会自动从文档页面解析真实的 padId(URL 中的标识符与 API 所需的真实 padId 不同)。

命令行:

python -m src.main download https://docs.qq.com/markdown/DQxxxxxxxx
python -m src.main download https://docs.qq.com/markdown/DQxxxxxxxx -o ./output.md

编程接口:

from src.main import handle_download
result = handle_download('https://docs.qq.com/markdown/DQxxxxxxxx', './output.md')
# result: {'path': ..., 'content': ...}

4. 读取文档

读取并返回文档内容。

命令行:

python -m src.main read https://docs.qq.com/markdown/DQxxxxxxxx

编程接口:

from src.main import handle_read
content = handle_read('https://docs.qq.com/markdown/DQxxxxxxxx')

5. 更新文档

覆盖已有文档的内容(支持直接传入文本或 .md 文件路径)。

命令行:

python -m src.main update https://docs.qq.com/markdown/DQxxxxxxxx "# 新内容"
python -m src.main update https://docs.qq.com/markdown/DQxxxxxxxx ./updated.md

编程接口:

from src.main import handle_update
handle_update('https://docs.qq.com/markdown/DQxxxxxxxx', '# 更新后的内容')

6. 删除文档

将文档移入回收站。

命令行:

python -m src.main delete https://docs.qq.com/markdown/DQxxxxxxxx

编程接口:

from src.main import handle_delete
result = handle_delete('https://docs.qq.com/markdown/DQxxxxxxxx')
# result: {'padId': ..., 'deleted': True}

7. 重命名文档

命令行:

python -m src.main rename https://docs.qq.com/markdown/DQxxxxxxxx "新标题"

编程接口:

from src.main import handle_rename
handle_rename('https://docs.qq.com/markdown/DQxxxxxxxx', '新标题')

8. 获取文档信息

命令行:

python -m src.main info https://docs.qq.com/markdown/DQxxxxxxxx

编程接口:

from src.main import handle_info
info = handle_info('https://docs.qq.com/markdown/DQxxxxxxxx')

9. 登录

命令行:

python -m src.main login          # 使用缓存的 Cookies(如有效)
python -m src.main login --force  # 强制重新登录

认证机制

首次使用需扫码登录,之后 Cookie 会缓存在 .cookies.json 中自动复用。

支持两种登录方式:

  1. 扫码登录 — 使用微信/QQ 扫描二维码
  2. 微信快捷登录 — 如果之前在当前浏览器已有微信登录记录,系统会自动检测并点击"微信快捷登录"按钮,页面显示"登录中..."后自动完成登录
flowchart TD
    A[开始] --> B{.cookies.json 存在?}
    B -->|是| C{Cookies 有效?}
    B -->|否| D[启动浏览器]
    C -->|是| E[就绪]
    C -->|否| D
    D --> F{微信快捷登录可用?}
    F -->|是| G[点击'微信快捷登录'按钮]
    G --> H[页面显示'登录中...']
    H --> I[每10秒轮询检测页面变化]
    F -->|否| J[展示二维码供扫描]
    J --> I
    I --> K{检测到登录成功?}
    K -->|是| L[获取并验证 Cookies]
    K -->|否 / 超时| I
    L --> M[保存 Cookies 到 .cookies.json]
    M --> E

API 参考

接口方法路径关键参数
创建文档GET/cgi-bin/online_docs/createdoc_newdoc_type=14, create_type=1, folder_id=/, title, xsrf
删除文档POST/cgi-bin/online_docs/doc_deletepad_id, domain_id, xsrf
读取内容POST/api/markdown/read/datafile_id(globalPadId)
写入内容POST/api/markdown/write/datafile_id, mark_down
文档信息POST/cgi-bin/online_docs/doc_infofile_id
重命名POST/cgi-bin/online_docs/doc_changetitlepad_id, title, xsrf
解析真实 padIdGET文档页面 HTMLbasicClientVars 中提取 padId

项目结构

tencent-docs-markdown/
├── requirements.txt      # Python 依赖
├── SKILL.md              # 技能定义文件(本文件)
├── publish.sh            # 版本发布脚本
├── .cookies.json         # 保存的登录 Cookies(自动生成,已加入 .gitignore)
└── src/
    ├── __init__.py       # Python 包初始化
    ├── main.py           # 主入口 & CLI 命令
    ├── auth.py           # 扫码登录 & Cookie 管理
    ├── api.py            # 腾讯文档 Markdown API 客户端
    └── login_with_polling.py  # 轮询登录脚本

核心概念

URL 标识符与真实 padId

腾讯文档 Markdown 的 URL 格式为 https://docs.qq.com/markdown/DSxxxxxxxx,其中 DSxxxxxxxxURL 标识符,并非 API 所需的真实 padId

系统通过 resolve_real_pad_id() 函数访问文档页面,从嵌入的 basicClientVars JSON 中提取真实的 padId,然后拼接为 globalPadId(格式:{domainId}${padId})用于 API 调用。

此机制对 下载(download)读取(read)更新(update) 操作自动生效,用户无需关注。


错误处理

错误原因解决方案
Cookie 过期会话超时自动通过扫码重新登录
retcode !== 0API 返回错误显示详细错误信息
无效 URL腾讯文档 URL 格式不正确确保格式为:https://docs.qq.com/markdown/xxxxx
资源不存在URL 标识符无法解析为真实 padId检查文档是否存在或是否有访问权限

备注

  • Markdown 文档类型编号为 14doc_type=14
  • 默认 domain_id300000000
  • XSRF Token 从 TOK Cookie 中提取
  • Cookies 存储在 .cookies.json 中(已加入 .gitignore)
  • 安全提示: .cookies.json 包含敏感的会话 Cookie,请勿提交到版本控制或分享给他人,建议限制其文件权限(如 chmod 600 .cookies.json
  • 删除操作会将文档移至回收站(可恢复)
  • 下载/读取/更新操作会自动解析 URL 中的标识符为真实 padId
  • 建议在受控或受信环境中运行此工具,因为 Playwright 会下载 Chromium 并使用浏览器自动化权限
  • Python 版本要求: Python >= 3.10

所需配置

配置项路径说明
Cookie 存储.cookies.json(项目根目录,自动生成)存储腾讯文档会话 Cookie,首次登录后自动创建。此文件包含敏感信息,请勿泄露。

Comments

Loading comments...