Feishu Doc Reader logo

Feishu Doc Reader

Community
evan966890
feishu-doc-reader

Read and extract content from all Feishu (Lark) document types using the official Feishu Open API

Overview

Publisherevan966890
Repositoryopenclaw-bestroll-skills
Skill namefeishu-doc-reader
Stars
32
Forks
0
Bundled files
16
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.

  • 16 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 Doc Reader 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-document-reader
  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-document-reader .claude/skills/feishu-doc-reader
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Feishu Doc Reader 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 Doc Reader 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 Doc Reader 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.

Feishu Document Reader

This skill enables reading and extracting content from all Feishu (Lark) document types using the official Feishu Open API.

Configuration

Set Up the Skill

  1. Create the configuration file at ./reference/feishu_config.json with your Feishu app credentials:
json
{
  "app_id": "your_feishu_app_id_here",
  "app_secret": "your_feishu_app_secret_here"
}
  1. Make sure the scripts are executable:
bash
chmod +x scripts/read_doc.sh
chmod +x scripts/read_feishu.sh
chmod +x scripts/get_blocks.sh

Security Note: The configuration file should be kept secure and not committed to version control. Consider using proper file permissions (chmod 600 ./reference/feishu_config.json).

Usage

Unified Document Reader (推荐)

使用统一文档读取器可以自动识别并读取所有支持的文档类型:

bash
# 自动识别文档类型并读取
./scripts/read_feishu.sh "docx_xxxxxxxxxxxxxx"
./scripts/read_feishu.sh "sheet_xxxxxxxxxxxxx"
./scripts/read_feishu.sh "basexxxxxxxxxxxxxx"
./scripts/read_feishu.sh "wikcnxxxxxxxxxxxxx"

# 从URL直接读取
./scripts/read_feishu.sh "https://xxx.feishu.cn/docx/xxxxx"

# 指定文档类型
./scripts/read_feishu.sh "token" --type bitable

# 格式化JSON输出
./scripts/read_feishu.sh "token" --pretty

# 只输出文本内容
./scripts/read_feishu.sh "docx_token" --output text

Wiki Knowledge Base (知识库)

读取飞书知识库节点和内容:

bash
# 读取单个Wiki节点
./scripts/read_feishu.sh "wikcnxxxxxxxxxxxxxx" --type wiki

# 读取整个知识空间
./scripts/read_feishu.sh --wiki-space "SPACE_ID"

# 递归读取所有子节点内容
./scripts/read_feishu.sh --wiki-space "SPACE_ID" --recursive

Bitable (多维表格)

读取飞书多维表格数据:

bash
# 读取多维表格(包含所有数据表和记录)
./scripts/read_feishu.sh "basexxxxxxxxxxxxxx" --type bitable

Basic Document Reading

bash
# 读取新版文档
./scripts/read_doc.sh "docx_xxxxxxxxxxxxxx"

# 读取电子表格
./scripts/read_doc.sh "sheet_xxxxxxxxxxxxx" sheet

# 读取多维表格
./scripts/read_doc.sh "basexxxxxxxxxxxxxx" bitable

# 读取知识库节点
./scripts/read_doc.sh "wikcnxxxxxxxxxxxxx" wiki

Get Detailed Document Blocks

For complete document structure with all blocks:

bash
# Get full document blocks structure
./scripts/get_blocks.sh "docx_AbCdEfGhIjKlMnOpQrStUv"

Using Python directly:

bash
python scripts/feishu_reader.py "docx_token" --pretty
python scripts/feishu_reader.py "sheet_token" --type sheet
python scripts/feishu_reader.py --wiki-space "SPACE_ID" --recursive

Supported Document Types

类型Token前缀说明支持程度
docxdocx_新版飞书文档✅ 完整支持
docdoc_旧版飞书文档✅ 基本支持
sheetsheet_, shtcn电子表格✅ 完整支持
bitablebase, bascn多维表格✅ 完整支持
wikiwikcn知识库节点✅ 完整支持
slides-幻灯片⚠️ 仅元数据

Features

Enhanced Content Extraction

  • Structured output: Clean JSON with document metadata, content blocks, and hierarchy
  • Complete blocks access: Full access to all document blocks including text, tables, images, headings, lists, etc.
  • Block hierarchy: Proper parent-child relationships between blocks
  • Text extraction: Automatic text extraction from complex block structures
  • Table support: Proper table parsing with row/column structure
  • Image handling: Image URLs and metadata extraction
  • Link resolution: Internal and external link extraction

Block Types Supported

  • text: Plain text and rich text content
  • heading1/2/3: Document headings with proper hierarchy
  • bullet/ordered: List items with nesting support
  • table: Complete table structures with cells and formatting
  • image: Image blocks with tokens and metadata
  • quote: Block quotes
  • code: Code blocks with language detection
  • equation: Mathematical equations
  • divider: Horizontal dividers
  • page: Page breaks (in multi-page documents)

Error Handling & Diagnostics

  • Detailed error messages: Clear explanations for common issues
  • Permission validation: Checks required permissions before making requests
  • Token validation: Validates document tokens before processing
  • Retry logic: Automatic retries for transient network errors
  • Rate limiting: Handles API rate limits gracefully

Security Features

  • Secure credential storage: Supports both environment variables and secure file storage
  • No credential logging: Credentials never appear in logs or output
  • Minimal permissions: Uses only required API permissions
  • Access token caching: Efficient token reuse to minimize API calls

Command Line Options

Main Document Reader

bash
# Python script options
python scripts/read_feishu_doc.py --help

# Shell script usage
./scripts/read_doc.sh <doc_token> [doc|sheet|slide]

Blocks Reader (NEW)

bash
# Get full document blocks
./scripts/get_blocks.sh <doc_token>

# Get specific block
./scripts/get_blocks.sh <doc_token> <block_id>

# Include children blocks
./scripts/get_blocks.sh <doc_token> "" true

# Python options
python scripts/get_feishu_doc_blocks.py --help

API Permissions Required

Your Feishu app needs the following permissions based on document types:

基础权限(必需)

  • docx:document:readonly - 读取新版文档内容
  • doc:document:readonly - 读取旧版文档内容

电子表格

  • sheets:spreadsheet:readonly - 读取电子表格内容

多维表格 (Bitable)

  • bitable:app:readonly - 读取多维表格元信息
  • bitable:record:read - 读取多维表格记录

知识库 (Wiki)

  • wiki:wiki:readonly - 读取知识库节点信息

云空间(可选)

  • drive:drive:readonly - 读取云空间文件信息

Error Handling

Common errors and solutions:

认证错误

  • 401 Unauthorized: 检查 App ID 和 App Secret 是否正确
  • Token expired: 访问令牌2小时过期,会自动刷新

权限错误

  • 403 Forbidden: 检查应用权限配置和文档共享设置
  • 99991663: 应用没有访问该文档的权限
  • 10002: 应用权限不足,请在开放平台配置所需权限

资源错误

  • 404 Not Found: 检查文档token是否正确
  • 99991664: 文档不存在或已被删除

特定类型错误

  • Wiki节点无法读取: 检查 wiki:wiki:readonly 权限
  • Bitable记录为空: 检查 bitable:record:read 权限
  • Sheet数据缺失: 检查工作表是否有数据,权限是否足够

Examples

读取各类文档

bash
# 新版文档 (docx)
./scripts/read_feishu.sh "docx_AbCdEfGhIjKlMnOp" --pretty

# 电子表格 (sheet)
./scripts/read_feishu.sh "sheet_XyZ123AbCdEfGh" --type sheet

# 多维表格 (bitable)
./scripts/read_feishu.sh "baseAbCdEfGhIjKlMn" --type bitable --pretty

# 知识库节点 (wiki)
./scripts/read_feishu.sh "wikcnAbCdEfGhIjKl" --type wiki

知识库操作

bash
# 读取单个节点及其内容
./scripts/read_feishu.sh "wikcnAbCdEfGhIjKl" --type wiki --pretty

# 读取整个知识空间
./scripts/read_feishu.sh --wiki-space "7xxxxxxxxxx" --pretty

# 递归读取知识空间所有内容
./scripts/read_feishu.sh --wiki-space "7xxxxxxxxxx" --recursive

从URL读取

bash
# 直接从飞书URL读取(自动识别类型)
./scripts/read_feishu.sh "https://xxx.feishu.cn/docx/xxxxx"
./scripts/read_feishu.sh "https://xxx.feishu.cn/wiki/xxxxx"
./scripts/read_feishu.sh "https://xxx.feishu.cn/base/xxxxx"

输出格式控制

bash
# JSON格式(默认)
./scripts/read_feishu.sh "docx_token"

# 格式化JSON
./scripts/read_feishu.sh "docx_token" --pretty

# 仅输出纯文本
./scripts/read_feishu.sh "docx_token" --output text

Python直接调用

bash
# 统一读取器
python scripts/feishu_reader.py "docx_token" --pretty
python scripts/feishu_reader.py "base_token" --type bitable
python scripts/feishu_reader.py --wiki-space "SPACE_ID" --recursive

# 文档blocks专用
python scripts/get_feishu_doc_blocks.py "docx_token"

Security Notes

  • Never commit credentials: Keep app secrets out of version control
  • Use minimal permissions: Only request permissions your use case requires
  • Secure file permissions: Set proper file permissions on secret files (chmod 600)
  • Environment isolation: Use separate apps for development and production
  • Audit access: Regularly review which documents your app can access

Troubleshooting

Authentication Issues

  1. Verify your App ID and App Secret in Feishu Open Platform
  2. Ensure the app has been published with required permissions
  3. Check that environment variables or config files are properly set
  4. Test with the test_auth.py script to verify credentials

Document Access Issues

  1. Ensure the document is shared with your app or in an accessible space
  2. Verify the document token format (should start with docx_, doc_, or sheet_)
  3. Check if the document requires additional sharing permissions

Network Issues

  1. Ensure your server can reach open.feishu.cn
  2. Check firewall rules if running in restricted environments
  3. The script includes retry logic for transient network failures

Blocks-Specific Issues

  1. Empty blocks response: Document might be empty or have no accessible blocks
  2. Missing block types: Some block types require additional permissions
  3. Incomplete hierarchy: Use --include-children flag for complete block tree

References

官方文档

文档相关

表格相关

知识库相关

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 Doc Reader AI skill do?

Read and extract content from all Feishu (Lark) document types using the official Feishu Open API

Why use Feishu Doc Reader on TypingMind?

Because you install it once and use it with any model. Feishu Doc Reader 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 Doc Reader in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/evan966890/openclaw-bestroll-skills/tree/main/skills/feishu-document-reader. 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 Doc Reader?

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 Doc Reader?

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

Is the Feishu Doc Reader 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 👇