← 返回
效率工具 Key

Yuque

Manage Yuque (语雀) knowledge base documents and repositories. Use when users need to interact with Yuque for document operations including reading documents,...
Manage Yuque (语雀) knowledge base documents and repositories. Use when users need to interact with Yuque for document operations including reading documents,...
a6590072
效率工具 clawhub v1.0.0 1 版本 99846.4 Key: 需要
★ 0
Stars
📥 650
下载
💾 134
安装
1
版本
#latest

概述

Yuque Skill

Interact with Yuque (语雀) knowledge base platform via the Yuque Open API.

Prerequisites

  • Yuque API Token (stored in environment variable YUQUE_TOKEN)
  • Base URL: https://www.yuque.com/api/v2

Authentication

All API requests require an X-Auth-Token header with your Yuque token.

Core Workflows

1. Get User Info

curl -s -H "X-Auth-Token: $YUQUE_TOKEN" https://www.yuque.com/api/v2/user

2. List User Repositories

curl -s -H "X-Auth-Token: $YUQUE_TOKEN" https://www.yuque.com/api/v2/users/<login>/repos

3. List Repository Documents

curl -s -H "X-Auth-Token: $YUQUE_TOKEN" https://www.yuque.com/api/v2/repos/<namespace>/docs

4. Get Document Detail

curl -s -H "X-Auth-Token: $YUQUE_TOKEN" https://www.yuque.com/api/v2/repos/<namespace>/docs/<slug>

5. Get Document Content (HTML/Markdown)

# Get HTML content
curl -s -H "X-Auth-Token: $YUQUE_TOKEN" https://www.yuque.com/api/v2/repos/<namespace>/docs/<slug>?raw=1

# Get Markdown content
curl -s -H "X-Auth-Token: $YUQUE_TOKEN" https://www.yuque.com/api/v2/repos/<namespace>/docs/<slug>?raw=1 | python scripts/parse_yuque.py --format md

6. Create Document

curl -s -X POST \
  -H "X-Auth-Token: $YUQUE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "Document Title", "body": "Document content in Markdown"}' \
  https://www.yuque.com/api/v2/repos/<namespace>/docs

7. Update Document

curl -s -X PUT \
  -H "X-Auth-Token: $YUQUE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "New Title", "body": "Updated content"}' \
  https://www.yuque.com/api/v2/repos/<namespace>/docs/<id>

8. Search Documents

Yuque API doesn't have a direct search endpoint. Use list + filter approach:

# List all docs in a repo and filter by title
python scripts/search_yuque.py --namespace <namespace> --query "keyword"

Common Namespace Formats

  • Personal repo: username/repo-slug
  • Team repo: teamname/repo-slug

Response Format

All API responses are JSON with this structure:

{
  "data": { ... },
  "meta": { ... }
}

Error Handling

Common HTTP status codes:

  • 401: Unauthorized (check token)
  • 403: Forbidden (no permission)
  • 404: Resource not found
  • 429: Rate limited (wait and retry)

Helper Scripts

Use the provided Python scripts for common operations:

  • scripts/yuque_cli.py - Full CLI for Yuque operations
  • scripts/parse_yuque.py - Parse Yuque HTML to Markdown
  • scripts/search_yuque.py - Search documents in repositories

References

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-20 04:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,867
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 439 📥 147,745
productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 432 📥 103,799