feishu-doc-extended

飞书文档扩展工具,提供图片下载和 OCR 识别功能。需要配合内置 feishu 插件使用。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "feishu-doc-extended" with this command: npx skills add xing2xian/feishu-doc-extended

feishu-doc-extended

飞书文档扩展工具,提供图片下载和 OCR 识别功能。

功能

功能说明
get_image获取飞书文档中图片的下载 URL
image_ocr下载图片并进行 OCR 文字识别(需要 tesseract)

依赖

  • tesseract + 中文语言包(用于 OCR)
  • 飞书开放平台应用权限
  • OpenClaw 内置 feishu 插件

安装

# 安装 tesseract
brew install tesseract

# 安装中文语言包
brew install tesseract-lang

修改内置插件

本技能需要修改 OpenClaw 内置的 feishu 插件:

1. 修改 doc-schema.ts

文件路径: /usr/local/lib/node_modules/openclaw/extensions/feishu/src/doc-schema.ts

FeishuDocSchema 的 Union 类型末尾添加:

// Image download
Type.Object({
  action: Type.Literal("get_image"),
  image_token: Type.String({ description: "Image token (from block image.token)" }),
}),

2. 修改 docx.ts

文件路径: /usr/local/lib/node_modules/openclaw/extensions/feishu/src/docx.ts

  1. 在文件末尾(uploadFileBlock 函数后)添加:
async function getImage(client: Lark.Client, imageToken: string) {
  const domain = client.domain ?? "https://open.feishu.cn";
  const token = await client.tokenManager.getTenantAccessToken();

  const res = await client.httpInstance.get<{ code?: number; data?: { image_url?: string } }>(
    `${domain}/open-apis/image/v4/get`,
    {
      params: { image_token: imageToken },
      headers: { Authorization: `Bearer ${token}` },
    },
  );

  if (res.data?.code !== 0 && res.data?.code !== undefined) {
    throw new Error(`Failed to get image: ${res.data}`);
  }

  return {
    image_url: res.data?.data?.image_url,
    image_token: imageToken,
  };
}
  1. 在 switch 语句中添加 case:
case "get_image":
  return json(await getImage(client, p.image_token));

3. 重启 Gateway

openclaw gateway restart

使用方法

1. 获取文档中的图片 token

使用 feishu_doc 工具的 list_blocks 获取文档中的图片 block:

{
  "action": "list_blocks",
  "doc_token": "文档Token"
}

从返回结果中获取图片的 token(在 block.image.token 中)。

2. 获取图片下载 URL

{
  "action": "get_image",
  "image_token": "图片Token"
}

返回:

{
  "image_url": "https://xxx...",
  "image_token": "图片Token"
}

3. OCR 识别

获取图片 URL 后,可以用浏览器打开并截图,然后用 tesseract 识别:

tesseract /path/to/screenshot.jpg - -l chi_sim

工作流程

1. feishu_doc list_blocks → 获取图片 block 和 token
2. feishu_doc get_image → 获取图片下载 URL
3. 浏览器访问 URL → 截图
4. tesseract OCR → 识别文字

注意事项

  • get_image 返回的 URL 是飞书临时 URL,有时效性
  • 如果 URL 过期,需要重新调用 get_image
  • OCR 识别效果取决于图片清晰度

更新日志

  • 2026-03-12: 初始版本,添加 get_image 功能

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

飞书图片发送技能

使用自有飞书应用配置,上传并发送本地图片到指定飞书用户或群聊,支持PNG/JPG/GIF/WEBP格式。

Registry SourceRecently Updated
1050Profile unavailable
General

china-doc-ocr

智能文档OCR识别与结构化提取。Use when the user has a complex document, PDF, scanned image, photo, invoice, receipt, ID card, table, or chart that needs to be recognized a...

Registry SourceRecently Updated
1.3K0Profile unavailable
General

Tesseract OCR文字识别

基于Tesseract引擎的OCR文字识别技能,支持中文、英文、中英混合三种模式,输出text/structured/question_answer三种格式。

Registry SourceRecently Updated
2430Profile unavailable
Research

Knowledge Base Skill

Multi-business knowledge base with image attachment + OCR support. Manage Q&A databases by business type, auto page splitting, and intelligent search.

Registry SourceRecently Updated
2380Profile unavailable