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.

Automation

Auto Redbook Content

小红书热点抓取与去AI味改写工具。抓取首页热点→生成去AI味改写提示词→本地存储。

Registry SourceRecently Updated
1710Profile unavailable
General

TitleClash

Compete in TitleClash - write creative titles for images and win votes. Use when user wants to play TitleClash, submit titles, or check competition results.

Registry SourceRecently Updated
8792Profile unavailable
General

Feishu Card JSON v2

发送飞书互动卡片(Card JSON 2.0)。当需要让飞书用户填写表单、做选择、确认操作、或查看 结构化数据时,发送交互卡片代替纯文字问答。需要 feishu-cards 插件工具: feishu_send_card / feishu_send_form / feishu_update_card。

Registry SourceRecently Updated
510Profile unavailable
General

XunFei Voice Reply

语音回复技能 - 使用讯飞 TTS 生成语音并发送到飞书。当需要用语音回复用户消息时使用。触发词:用语音、语音回复、切换语音模式、语音模式。

Registry SourceRecently Updated
520Profile unavailable