← 返回 Skills 市场
328
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install feishu-doc-extended
功能描述
飞书文档扩展工具,提供图片下载和 OCR 识别功能。需要配合内置 feishu 插件使用。
使用说明 (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
- 在文件末尾(
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,
};
}
- 在 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 功能
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install feishu-doc-extended - 安装完成后,直接呼叫该 Skill 的名称或使用
/feishu-doc-extended触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
常见问题
feishu-doc-extended 是什么?
飞书文档扩展工具,提供图片下载和 OCR 识别功能。需要配合内置 feishu 插件使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 328 次。
如何安装 feishu-doc-extended?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-doc-extended」即可一键安装,无需额外配置。
feishu-doc-extended 是免费的吗?
是的,feishu-doc-extended 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
feishu-doc-extended 支持哪些平台?
feishu-doc-extended 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 feishu-doc-extended?
由 xing2xian(@xing2xian)开发并维护,当前版本 v1.0.0。
推荐 Skills