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 從公開儲存庫中收錄這些內容。

檢舉或申請下架