← Back to Skills Marketplace
xing2xian

feishu-doc-extended

by xing2xian · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
328
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install feishu-doc-extended
Description
飞书文档扩展工具,提供图片下载和 OCR 识别功能。需要配合内置 feishu 插件使用。
README (SKILL.md)

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\x3C{ 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 功能
Usage Guidance
This skill does what it says (fetch Feishu image URLs and use tesseract for OCR), but it requires you to edit OpenClaw's built-in feishu extension code and restart the gateway — a sensitive, persistent change. Before installing: (1) review the exact code changes (the repo includes getImage.ts and doc-schema.ts — compare these to the actual files on your system); (2) prefer contributing the change upstream or implement a safer plugin hook rather than editing node_modules directly; (3) back up the original files and test in a non-production environment; (4) verify the getImage code only calls api endpoints under open.feishu.cn and does not exfiltrate tokens; (5) be cautious because the SKILL.md filenames and included files do not exactly match, which increases risk of accidental mis-modification. If you are not comfortable making these persistent platform edits, do not install or run the modification steps.
Capability Analysis
Type: OpenClaw Skill Name: feishu-doc-extended Version: 1.0.0 The skill bundle instructs the AI agent to modify the source code of OpenClaw's core Feishu plugin located in `/usr/local/lib/node_modules/`, which is a high-risk operation that bypasses standard plugin isolation. While the provided code snippets in `src/docx.ts` and `src/doc-schema.ts` appear to legitimately implement image retrieval via the official Feishu API (`open.feishu.cn`), the requirement to tamper with system-wide application files is a significant security concern and a potential vector for system-wide persistence or unauthorized code injection.
Capability Assessment
Purpose & Capability
The skill's purpose (fetch image URL from Feishu + OCR) matches required binary tesseract. However, the runtime instructions require editing OpenClaw's built-in feishu extension sources under /usr/local/lib/node_modules/openclaw/extensions/feishu — a system-level change not declared in 'required config paths'. Also the packaged files (src/getImage.ts) don't exactly match the filenames referenced in the SKILL.md (docx.ts), creating ambiguity about what to change.
Instruction Scope
SKILL.md tells the operator/agent to modify other extension source files (schema and docx handlers), add a new action, and restart the gateway. That goes beyond a normal skill's runtime instructions (which usually call APIs or run binaries) and requires write access to node_modules and restarting a system component. The instructions are specific about paths, so they will cause persistent code changes to platform files if followed.
Install Mechanism
Install steps are limited to brew installing tesseract and language data (tesseract-lang), which is a standard, low-risk package install on macOS. There is no arbitrary URL download or extracted archive in the install spec.
Credentials
The skill itself does not request environment variables or secrets. However, the added getImage implementation calls the existing feishu plugin's token manager (getTenantAccessToken) and client.httpInstance, meaning it relies on the feishu extension's credentials at runtime. That is expected for the stated purpose but implies access to tenant tokens via the modified plugin.
Persistence & Privilege
The skill requires persistent, in-place modification of the built-in feishu extension source code and a gateway restart. Those changes are persistent across runs and affect platform code beyond this skill, but the manifest does not declare any required config paths or elevated privileges. This persistent modification increases blast radius if the change is incorrect or malicious.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-doc-extended
  3. After installation, invoke the skill by name or use /feishu-doc-extended
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
feishu-doc-extended 1.0.0 - Initial release of Feishu document extension tool. - Provides image download (get_image) and OCR recognition (image_ocr) functionality. - Requires tesseract (with Chinese language pack) and the Feishu built-in plugin. - Includes instructions for modifying OpenClaw’s Feishu plugin to support image download. - Usage guide and troubleshooting notes included. - Changelog: 2026-03-12, initial version with get_image feature.
Metadata
Slug feishu-doc-extended
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is feishu-doc-extended?

飞书文档扩展工具,提供图片下载和 OCR 识别功能。需要配合内置 feishu 插件使用。 It is an AI Agent Skill for Claude Code / OpenClaw, with 328 downloads so far.

How do I install feishu-doc-extended?

Run "/install feishu-doc-extended" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is feishu-doc-extended free?

Yes, feishu-doc-extended is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does feishu-doc-extended support?

feishu-doc-extended is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created feishu-doc-extended?

It is built and maintained by xing2xian (@xing2xian); the current version is v1.0.0.

💬 Comments