feishu-doc

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feishu Doc Skill

Feishu Doc Skill

快速索引

Quick Index

文档操作

Document Operations

用户意图moduletool_action必填参数
创建文档doccreate可空(建议 title)
读取文档docreaddocument_id
读取文档内容docread_contentdocument_id
写入 Markdowndocwrite_markdowndocument_id, content(或 markdown)
列出文档块doclist_blocksdocument_id
更新文本块docupdate_block_textdocument_id, block_id, content
User Intentmoduletool_actionRequired Parameters
Create DocumentdoccreateOptional (title recommended)
Read Documentdocreaddocument_id
Read Document Contentdocread_contentdocument_id
Write Markdowndocwrite_markdowndocument_id, content (or markdown)
List Document Blocksdoclist_blocksdocument_id
Update Text Blockdocupdate_block_textdocument_id, block_id, content

Wiki 操作

Wiki Operations

用户意图moduletool_action必填参数
列出知识空间wikilist_spaces-
列出节点wikilist_nodesspace_id
创建节点wikicreate_nodespace_id, title
获取节点wikiget_nodespace_id, node_token
User Intentmoduletool_actionRequired Parameters
List Knowledge Spaceswikilist_spaces-
List Nodeswikilist_nodesspace_id
Create Nodewikicreate_nodespace_id, title
Get Nodewikiget_nodespace_id, node_token

调用示例

Usage Examples

创建文档

Create Document

bash
python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "create",
  "title": "Q1 工作总结",
  "folder_token": "fldcnXXXX"
}'
bash
python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "create",
  "title": "Q1 Work Summary",
  "folder_token": "fldcnXXXX"
}'

读取文档内容

Read Document Content

bash
python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "read_content",
  "document_id": "doccnXXXX"
}'
bash
python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "read_content",
  "document_id": "doccnXXXX"
}'

写入 Markdown 内容

Write Markdown Content

bash
python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "write_markdown",
  "document_id": "doccnXXXX",
  "content": "## 概述\n\n本季度完成了以下关键目标:\n\n1. 项目 A 上线\n2. 性能优化 30%"
}'
bash
python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "write_markdown",
  "document_id": "doccnXXXX",
  "content": "## Overview\n\nThis quarter completed the following key objectives:\n\n1. Project A launched\n2. Performance optimized by 30%"
}'

Wiki 操作

Wiki Operations

bash
undefined
bash
undefined

列出知识空间

List Knowledge Spaces

python3 skills/feishu-cli/run.py '{"action":"tool","module":"wiki","tool_action":"list_spaces"}'
python3 skills/feishu-cli/run.py '{"action":"tool","module":"wiki","tool_action":"list_spaces"}'

列出节点

List Nodes

python3 skills/feishu-cli/run.py '{"action":"tool","module":"wiki","tool_action":"list_nodes","space_id":"7xxx"}'
undefined
python3 skills/feishu-cli/run.py '{"action":"tool","module":"wiki","tool_action":"list_nodes","space_id":"7xxx"}'
undefined

核心约束

Core Constraints

文档 ID 来源

Document ID Sources

  • URL 中提取:
    https://xxx.feishu.cn/docx/doccnXXXX
    document_id = "doccnXXXX"
  • Wiki URL:先用
    wiki get_node
    获取
    obj_token
    ,再作为
    document_id
    使用
  • API 返回:创建文档后返回
  • Extract from URL:
    https://xxx.feishu.cn/docx/doccnXXXX
    document_id = "doccnXXXX"
  • Wiki URL: First use
    wiki get_node
    to get
    obj_token
    , then use it as
    document_id
  • API Response: Returned after document creation

Lark Markdown 与标准 Markdown 差异

Differences between Lark Markdown and Standard Markdown

飞书文档支持的 Markdown 是 Lark 风味,与标准 GFM 有一些差异:
  • 标题: 支持
    #
    ######
  • 代码块: 支持
    ```language
    语法
  • 表格: 使用
    | col1 | col2 |
    标准表格语法
  • 任务列表: 使用
    - [ ]
    - [x]
  • 引用: 使用
    > 
    前缀
  • 特殊块: 支持
    callout
    grid
    mermaid
    plantuml
Feishu documents support Lark-flavored Markdown, which has some differences from standard GFM:
  • Headings: Supports
    #
    to
    ######
  • Code Blocks: Supports
    ```language
    syntax
  • Tables: Uses standard table syntax
    | col1 | col2 |
  • Task Lists: Uses
    - [ ]
    and
    - [x]
  • Blockquotes: Uses
    > 
    prefix
  • Special Blocks: Supports
    callout
    ,
    grid
    ,
    mermaid
    ,
    plantuml
    , etc.

权限与默认行为

Permissions and Default Behaviors

  • 读取需要
    docx:document:readonly
    scope
  • 写入需要
    docx:document
    scope
  • Wiki 操作需要
    wiki:wiki
    相关 scope
  • 通过 CLI 创建文档时,会自动返回
    url
    applink_url
  • 创建文档后,CLI 会尝试默认给当前用户开启 管理权限(full_access),无需额外参数;若当前调用身份无法修改协作者权限,则会在返回中给出
    manage_permission_warning
  • Reading requires
    docx:document:readonly
    scope
  • Writing requires
    docx:document
    scope
  • Wiki operations require
    wiki:wiki
    related scopes
  • When creating a document via CLI, it will automatically return
    url
    and
    applink_url
  • After document creation, the CLI will attempt to enable full_access management permission for the current user by default, no additional parameters needed; if the current calling identity cannot modify collaborator permissions, a
    manage_permission_warning
    will be included in the response