| name | feishu-docx |
| description | Export Feishu/Lark cloud documents to Markdown. Supports docx, sheets, bitable, wiki, and batch wiki space export. Use this skill when you need to read, analyze, write, or reference content from Feishu knowledge base. |
Feishu Docx Exporter
Export Feishu/Lark cloud documents to Markdown format for AI analysis.
Setup (One-time)
pip install feishu-docx
feishu-docx config set --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRET
Token auto-refreshes. No user interaction required.
Export Documents
feishu-docx export "<FEISHU_URL>" -o ./output
The exported Markdown file will be saved with the document's title as filename.
Supported Document Types
- docx: Feishu cloud documents → Markdown with images
- sheet: Spreadsheets → Markdown tables
- bitable: Multidimensional tables → Markdown tables
- wiki: Knowledge base nodes → Auto-resolved and exported
Command Reference
| Command | Description |
|---|
feishu-docx export <URL> | Export document to Markdown |
feishu-docx create <TITLE> | Create new document |
feishu-docx write <URL> | Append content to document |
feishu-docx update <URL> | Update specific block |
feishu-docx export-wiki-space <URL> | Batch export entire wiki space |
feishu-docx export-workspace-schema <ID> | Export bitable database schema |
feishu-docx auth | OAuth authorization |
feishu-docx config set | Set credentials |
feishu-docx config show | Show current config |
feishu-docx config clear | Clear token cache |
feishu-docx tui | Interactive TUI interface |
Examples
Export a wiki page
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -o ./docs
Export a document with custom filename
feishu-docx export "https://xxx.feishu.cn/docx/XYZ789" -o ./docs -n meeting_notes
Read content directly (recommended for AI Agent)
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" --stdout
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -c
Export with Block IDs (for later updates)
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" --with-block-ids
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -b
Batch Export Entire Wiki Space
feishu-docx export-wiki-space "https://xxx.feishu.cn/wiki/ABC123" -o ./wiki_backup
feishu-docx export-wiki-space "https://xxx.feishu.cn/wiki/ABC123" -o ./docs --max-depth 3
feishu-docx export-wiki-space "https://xxx.feishu.cn/wiki/ABC123" -o ./docs -b
Export Database Schema
feishu-docx export-workspace-schema <workspace_id>
feishu-docx export-workspace-schema <workspace_id> -o ./schema.md
Write Documents (CLI)
Create Document
feishu-docx create "我的笔记"
feishu-docx create "会议记录" -c "# 会议纪要\n\n- 议题一\n- 议题二"
feishu-docx create "周报" -f ./weekly_report.md
feishu-docx create "笔记" --folder fldcnXXXXXX
如何获取 folder token:
- 在浏览器中打开目标文件夹
- 从 URL 中提取 token:
https://xxx.feishu.cn/drive/folder/fldcnXXXXXX
fldcnXXXXXX 就是 folder token
Append Content to Existing Document
feishu-docx write "https://xxx.feishu.cn/docx/xxx" -c "## 新章节\n\n内容"
feishu-docx write "https://xxx.feishu.cn/docx/xxx" -f ./content.md
Update Specific Block
feishu-docx export "https://xxx.feishu.cn/docx/xxx" -b -o ./
feishu-docx update "https://xxx.feishu.cn/docx/xxx" -b blk123abc -c "新内容"
Tip for AI Agents: When you need to update a specific section:
- Export with
-b to get block IDs
- Find the target block ID from HTML comments
- Use
feishu-docx update with that block ID
Tips
- Images auto-download to
{doc_title}/ folder
- Use
--stdout or -c for direct content output (recommended for agents)
- Use
-b to export with block IDs for later updates
- Token auto-refreshes, no re-auth needed
- For Lark (overseas): add
--lark flag