Feishu Docs logo

Feishu Docs

Community
evan966890
feishu-docs

飞书文档(Docx)API技能。用于创建、读取、更新和删除飞书文档。支持Markdown/HTML内容转换、文档权限管理。

Overview

Publisherevan966890
Repositoryopenclaw-bestroll-skills
Skill namefeishu-docs
Stars
32
Forks
0
Bundled files
11
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 11 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by evan966890 on GitHub. Read the source before you install it.

Installation

Install the Feishu Docs AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/evan966890/openclaw-bestroll-skills/tree/main/skills/feishu-docs
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/evan966890/openclaw-bestroll-skills.git /tmp/openclaw-bestroll-skills
mkdir -p .claude/skills
cp -r /tmp/openclaw-bestroll-skills/skills/feishu-docs .claude/skills/feishu-docs
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Feishu Docs in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Feishu Docs on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Feishu Docs is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

飞书文档(Docx)技能

操作飞书新版文档(Docx)的openClaw技能,基于飞书开放平台 API 实现文档全生命周期管理。

功能特性

功能说明
文档 CRUD创建、获取、更新(全量替换)、删除文档
内容追加向已有文档末尾追加 Markdown/HTML 内容
内容转换通过飞书服务端 API 将 Markdown/HTML 转换为文档块
块操作获取文档块列表(自动分页)、插入子块、删除块
权限管理添加协作者、查看权限成员列表
文件管理按文件夹列出文件、按关键词搜索文档

环境变量

bash
export FEISHU_APP_ID=cli_xxxxxx          # 飞书应用 App ID
export FEISHU_APP_SECRET=your_app_secret  # 飞书应用 App Secret

也可通过 .env 文件配置(项目使用 dotenv 自动加载)。

快速开始

bash
# 安装依赖
npm install

# 查看帮助
node bin/cli.js --help

# 创建文档(含 Markdown 内容)
node bin/cli.js create -f fldxxxxxx -t "项目计划" -c "# 概述\n\n内容..."

# 获取文档
node bin/cli.js get -d dcnxxxxxx --format markdown --include-content

# 全量替换文档内容
node bin/cli.js update -d dcnxxxxxx --content-file new-content.md

# 追加内容
node bin/cli.js update -d dcnxxxxxx --append -c "## 补充\n\n新增内容"

# 删除文档
node bin/cli.js delete -d dcnxxxxxx

CLI 命令

命令说明必要参数
create创建文档(有内容时自动使用转换流程)-f文件夹token, -t标题
create-with-content创建文档并通过转换API插入内容-f文件夹token, -t标题
get获取文档信息-d文档ID
update替换或追加文档内容-d文档ID, -c内容或--content-file
delete删除文档-d文档ID
search搜索文档-q关键词
list列出文件夹中的文件-f文件夹token
share分享文档给用户-d文档ID, -u用户ID
permissions查看文档权限成员-d文档ID
convert将Markdown/HTML转换为文档块(预览)-t内容类型

所有命令均支持 --app-id 和 --app-secret 参数覆盖环境变量。

API 方法

文档管理

方法说明
createDocument(folderToken, title)创建空文档
createDocumentWithContent(folderToken, title, content, contentType)创建文档并插入内容
getDocument(documentId)获取文档信息
getDocumentRawContent(documentId)获取文档纯文本内容
deleteDocument(documentId)删除文档(通过 Drive API)

文档块操作

方法说明
getDocumentBlocks(documentId, pageSize, pageToken)获取文档块列表(单页)
getAllDocumentBlocks(documentId)获取所有块(自动分页)
updateDocumentBlock(documentId, blockId, updateRequest)更新指定块
createDocumentBlocks(documentId, blockId, children, index)在指定块下插入子块
deleteDocumentBlock(documentId, blockId)删除指定块
batchDeleteBlocks(documentId, blockIds)批量删除块

内容操作

方法说明
appendToDocument(documentId, content, contentType)向文档末尾追加内容
replaceDocumentContent(documentId, content, contentType)全量替换文档内容
convertContent(contentType, content, userIdType)将 Markdown/HTML 转换为文档块

文件与搜索

方法说明
listFolderFiles(folderToken, type)列出文件夹下的文件
searchDocuments(query, folderToken)按关键词搜索文档

权限管理

方法说明
addPermissionMember(token, memberId, memberType, perm)添加权限成员
getPermissionMembers(token)获取权限成员列表

格式转换(本地)

方法说明
markdownToBlocks(markdown)Markdown → 飞书块结构(本地转换)
blocksToMarkdown(blocks)飞书块结构 → Markdown(支持数字/字符串 block_type)

飞书 API 端点

代码实际调用的飞书开放平台端点:

POST   /docx/v1/documents                                    # 创建文档
GET    /docx/v1/documents/{document_id}                      # 获取文档信息
GET    /docx/v1/documents/{document_id}/raw_content          # 获取文档纯文本
GET    /docx/v1/documents/{document_id}/blocks               # 获取文档块列表
PATCH  /docx/v1/documents/{document_id}/blocks/{block_id}    # 更新块
DELETE /docx/v1/documents/{document_id}/blocks/{block_id}    # 删除块
POST   /docx/v1/documents/{document_id}/blocks/{block_id}/children  # 插入子块
POST   /docx/v1/documents/blocks/convert                     # Markdown/HTML→块
DELETE /drive/v1/files/{file_token}?type=docx                # 删除文档
GET    /drive/v1/files?folder_token=xxx                      # 列出文件夹文件
POST   /drive/v1/permissions/{token}/members?type=docx       # 添加权限成员
GET    /drive/v1/permissions/{token}/members?type=docx       # 获取权限成员
POST   /auth/v3/tenant_access_token/internal/                # 获取 tenant_access_token

可靠性机制

  • Token 缓存与并发控制:access_token 缓存复用,多个并发请求不会重复刷新
  • 自动重试:401 未授权自动刷新 token 重试;429 限流和 5xx 错误指数退避重试(最多 2 次)
  • Token 过期码识别:检测飞书错误码 99991663/99991661 自动刷新 token
  • 安全错误处理:安全访问 error.response.data,避免非 JSON 响应导致崩溃

注意事项

  1. 应用权限:飞书应用需具备 docs:doc、drive:drive、drive:file 等相关权限
  2. 内容插入:create 命令含 content 时自动走 convertContent → createDocumentBlocks 流程,确保文档结构正确
  3. 批量插入限制:每批最多插入 50 个块(飞书 API 限制)
  4. 表格处理:转换含表格的内容时自动去除 merge_info 字段;block_type 为 31/32 的表格块暂被过滤
  5. 内容大小:单次转换内容不超过 10MB

项目结构

├── src/api.js        # FeishuDocsAPI 类(所有 API 方法 + 格式转换)
├── bin/cli.js        # Commander 命令行工具
├── package.json      # 依赖:axios, commander, dotenv
├── test-convert.js   # 转换接口测试
├── SKILL.md          # 本文件
└── README.md         # 项目说明

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Feishu Docs AI skill do?

飞书文档(Docx)API技能。用于创建、读取、更新和删除飞书文档。支持Markdown/HTML内容转换、文档权限管理。

Why use Feishu Docs on TypingMind?

Because you install it once and use it with any model. Feishu Docs is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Feishu Docs in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/evan966890/openclaw-bestroll-skills/tree/main/skills/feishu-docs. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Feishu Docs?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Feishu Docs?

As many as you like. As long as a model supports skills, you can use Feishu Docs with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Feishu Docs AI skill free?

It is published on GitHub by evan966890. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇