Install
openclaw skills install yuque-knowledge-base语雀 (Yuque) 知识库管理。搜索、阅读、创建、编辑语雀文档,管理知识库和目录。 Use when: user mentions 语雀/Yuque, or wants to search/read/create/edit documents, manage knowledge bases, organize notes on Yuque, upload articles to Yuque.
openclaw skills install yuque-knowledge-baseThis skill enables AI agents to interact with Yuque (语雀) — a Chinese knowledge management platform — through its OpenAPI. It works across Claude Code, opencode, openclaw, and any agent with shell access.
Install this skill, then tell your AI agent:
帮我配置语雀 API,我的 token 是 xxxxxxxx
The agent will automatically create config.json and verify connectivity.
Authentication requires a Yuque API token. The scripts look for it in this order:
config.json (preferred): Create config.json in this skill's root directory:
{
"api_token": "your-yuque-api-token",
"base_url": "https://www.yuque.com"
}
See config.example.json for the template.
Environment variable (fallback): export YUQUE_TOKEN="your-token"
When the user provides their API token, create config.json by copying config.example.json and filling in the token, then run python scripts/get_user.py to verify. If verification succeeds, show the user's name to confirm.
Verify setup: python scripts/get_user.py
All scripts are in the scripts/ directory. They use only Python standard library (zero dependencies). Output is JSON to stdout, errors go to stderr.
| Script | Usage | Description |
|---|---|---|
search.py | python scripts/search.py "keyword" | Search docs or repos |
get_doc.py | python scripts/get_doc.py --repo REPO --doc DOC | Get full document content |
list_docs.py | python scripts/list_docs.py --repo REPO | List all docs in a repo |
doc_versions.py | python scripts/doc_versions.py --doc DOC | Document version history |
| Script | Usage | Description |
|---|---|---|
create_doc.py | python scripts/create_doc.py --repo REPO --title "Title" --body-file file.md | Create a document |
update_doc.py | python scripts/update_doc.py --repo REPO --doc DOC --body-file file.md | Update a document |
delete_doc.py | python scripts/delete_doc.py --repo REPO --doc DOC | Delete a document |
| Script | Usage | Description |
|---|---|---|
list_repos.py | python scripts/list_repos.py | List user's repos |
create_repo.py | python scripts/create_repo.py --name "Name" --slug slug | Create a new repo |
| Script | Usage | Description |
|---|---|---|
get_toc.py | python scripts/get_toc.py --repo REPO | Get repo TOC tree |
update_toc.py | python scripts/update_toc.py --repo REPO --action appendNode ... | Update TOC structure |
| Script | Usage | Description |
|---|---|---|
get_user.py | python scripts/get_user.py | Get current user info |
When the user asks to find or read content from Yuque:
python scripts/search.py "keyword" — returns titles, IDs, and summariespython scripts/get_doc.py --repo REPO_ID --doc DOC_IDdata.body field contains the markdown content. If body is empty, use body_html or body_lake as fallback.When the user asks to write content and upload it to Yuque (e.g., "write a dev doc and upload to Yuque"):
/tmp/yuque_doc.md)python scripts/list_repos.py — ask the user which repo to usepython scripts/create_doc.py --repo REPO_ID --title "Title" --body-file /tmp/yuque_doc.mddata.slug — combine with repo namespace to form the full URLWhen the user asks to update an existing Yuque document:
python scripts/search.py "doc title" or python scripts/list_docs.py --repo REPO_IDpython scripts/get_doc.py --repo REPO_ID --doc DOC_IDpython scripts/update_doc.py --repo REPO_ID --doc DOC_ID --body-file /tmp/updated.mdWhen the user asks to organize or restructure their knowledge base:
python scripts/get_toc.py --repo REPO_IDpython scripts/update_toc.py --repo REPO_ID --action appendNode --action-mode child --doc-ids DOC_ID--action removeNode to remove nodes, --action editNode to renameDocuments support three ways to provide body content:
--body "inline content" — for short content--body-file /path/to/file.md — for files (recommended for long content)echo "content" | python scripts/create_doc.py ...List endpoints support --offset and --limit parameters. Default limit is 100.
The --repo parameter accepts either:
--repo 12345--repo group_login/book_slug (more readable)Default format is markdown. All scripts default to creating/updating in markdown format. Use --format html or --format lake if needed.
| User says | Action |
|---|---|
| "搜索/查找语雀上关于 X 的文档" | search.py "X" → get_doc.py |
| "读取/打开这篇语雀文档" | get_doc.py --repo R --doc D |
| "写一篇文档上传到语雀" | Write locally → list_repos.py → create_doc.py |
| "更新/修改语雀上的文档" | search.py → get_doc.py → edit → update_doc.py |
| "列出我的知识库" | list_repos.py |
| "查看知识库目录" | get_toc.py --repo R |
| "整理/重新组织笔记" | get_toc.py → update_toc.py |
| "创建新的知识库" | create_repo.py --name "X" --slug x |
| "删除这篇文档" | delete_doc.py --repo R --doc D |
| "查看文档历史版本" | doc_versions.py --doc D |