Feishu Doc

m1heng/clawdbot-feishu/skills/feishu-doc

作者 m1hengb07885b756ac无许可证4.2K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库6个月前更新

Feishu document read/write operations + comment management. Activate when user mentions Feishu docs, cloud docs, docx links, or document comments.

仅含说明Documents & Office
AI 生成的概览

通过单一 feishu_doc 工具读取、创建和编辑飞书云文档,并管理其评论。

功能
提供一个 feishu_doc 工具,通过 action 参数覆盖文档读取、写入、追加、创建、创建并写入、块列表与获取、块文本更新与删除,以及评论的列出、获取和创建。读取会返回标题、纯文本内容和块统计信息,表格、图片等结构化内容可通过 list_blocks 获取。写入会用 Markdown 替换整篇文档,支持标题、列表、代码块、引用、链接、自动上传的图片和行内格式,但不支持 Markdown 表格。评论操作支持分页列出评论与回复,并区分整篇文档评论与块级评论。
适用场景
当用户提到飞书文档、云文档、docx 链接或文档评论,或提供需要提取 token 的飞书文档链接时使用。适用于读取文档内容、生成或替换文档正文、追加内容,以及查看或添加文档评论。不适用于 Markdown 表格,也不支持创建评论回复,因为当前 SDK 未开放该接口。技能附带一份关于块类型的参考文件,用于处理结构化内容。
运行要求
需要配置飞书渠道工具(doc: true),并具备飞书 API 权限:docx:document、docx:document:readonly、docx:document.block:convert、drive:drive,评论操作还需 docx:document.comment:read 与 docx:document.comment。需要访问飞书的网络连接。不附带脚本,仅为说明文档。

Feishu Document Tool

Single tool feishu_doc with action parameter for all document operations including comment management.

Token Extraction

From URL https://xxx.feishu.cn/docx/ABC123def → doc_token = ABC123def From URL https://xxx.feishu.cn/docs/doccn123c → doc_token = doccn123c

Actions

Read Document

json
{ "action": "read", "doc_token": "ABC123def" }

Returns: title, plain text content, block statistics. Check hint field - if present, structured content (tables, images) exists that requires list_blocks.

Write Document (Replace All)

json
{ "action": "write", "doc_token": "ABC123def", "content": "# Title\n\nMarkdown content..." }

Replaces entire document with markdown content. Supports: headings, lists, code blocks, quotes, links, images (![](url) auto-uploaded), bold/italic/strikethrough.

Limitation: Markdown tables are NOT supported.

Create + Write (Atomic, Recommended)

json
{  "action": "create_and_write",  "title": "New Document",  "content": "# Title\n\nMarkdown content..."}

With folder:

json
{  "action": "create_and_write",  "title": "New Document",  "content": "# Title\n\nMarkdown content...",  "folder_token": "fldcnXXX"}

Creates the document and writes content in one call. Prefer this over separate create + write.

Append Content

json
{ "action": "append", "doc_token": "ABC123def", "content": "Additional content" }

Appends markdown to end of document.

Create Document

json
{ "action": "create", "title": "New Document" }

With folder:

json
{ "action": "create", "title": "New Document", "folder_token": "fldcnXXX" }

Creates an empty document (title only).

List Blocks

json
{ "action": "list_blocks", "doc_token": "ABC123def" }

Returns full block data including tables, images. Use this to read structured content.

Get Single Block

json
{ "action": "get_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }

Update Block Text

json
{ "action": "update_block", "doc_token": "ABC123def", "block_id": "doxcnXXX", "content": "New text" }

Delete Block

json
{ "action": "delete_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }

List Comments

json
{ "action": "list_comments", "doc_token": "ABC123def", "page_size": 50 }

Returns all comments for the document. Use page_token for pagination. Comments include is_whole field to distinguish between whole-document comments (true) and block-level comments (false).

Get Single Comment

json
{ "action": "get_comment", "doc_token": "ABC123def", "comment_id": "comment_xxx" }

Create Comment

json
{ "action": "create_comment", "doc_token": "ABC123def", "content": "Comment text" }

List Comment Replies

json
{ "action": "list_comment_replies", "doc_token": "ABC123def", "comment_id": "comment_xxx", "page_size": 50 }

page_size should be a positive integer. If omitted, tool defaults to 50.

Comment Write Scope

Current tool provides documented comment write action create_comment (global comment creation). For replies, use list_comment_replies for retrieval; the reply creation endpoint is not exposed in current SDK surface.

Reading Workflow

  1. Start with action: "read" - get plain text + statistics
  2. Check block_types in response for Table, Image, Code, etc.
  3. If structured content exists, use action: "list_blocks" for full data

Configuration

yaml
channels:  feishu:    tools:      doc: true  # default: true

Note: feishu_wiki depends on this tool - wiki page content is read/written via feishu_doc.

Permissions

Required: docx:document, docx:document:readonly, docx:document.block:convert, drive:drive

For comment operations:

  • Read comments: docx:document.comment:read
  • Write comments: docx:document.comment (optional, for create_comment)

来源与署名

来源:m1heng/clawdbot-feishu位于skills/feishu-doc提交b07885b

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架