feishu-docx
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFeishu Docx Exporter
Feishu Docx 导出工具
Export Feishu/Lark cloud documents to Markdown format for AI analysis.
将Feishu/Lark云文档导出为Markdown格式,以便进行AI分析。
Instructions
使用说明
Setup (One-time)
设置(仅需一次)
- Install the tool:
bash
pip install feishu-docx- Configure Feishu app credentials:
bash
feishu-docx config set --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRET- 安装工具:
bash
pip install feishu-docx- 配置Feishu应用凭证:
bash
feishu-docx config set --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRETor use environment variables
或使用环境变量
3. Authorize with OAuth (opens browser):
```bash
feishu-docx auth
3. 通过OAuth授权(将打开浏览器):
```bash
feishu-docx authExport Documents
导出文档
Export any Feishu document URL to Markdown:
bash
feishu-docx export "<FEISHU_URL>" -o ./outputThe exported Markdown file will be saved with the document's title as filename.
将任意Feishu文档URL导出为Markdown:
bash
feishu-docx export "<FEISHU_URL>" -o ./output导出的Markdown文件将以文档标题作为文件名保存。
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
- docx:Feishu云文档 → 带图片的Markdown格式
- sheet:电子表格 → Markdown表格
- bitable:多维表格 → Markdown表格
- wiki:知识库节点 → 自动解析并导出
Examples
示例
Export a wiki page
导出知识库页面
bash
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -o ./docsbash
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -o ./docsExport a document with custom filename
使用自定义文件名导出文档
bash
feishu-docx export "https://xxx.feishu.cn/docx/XYZ789" -o ./docs -n meeting_notesbash
feishu-docx export "https://xxx.feishu.cn/docx/XYZ789" -o ./docs -n meeting_notesExport spreadsheet as Markdown table
将电子表格导出为Markdown表格
bash
feishu-docx export "https://xxx.feishu.cn/sheets/DEF456" --table mdbash
feishu-docx export "https://xxx.feishu.cn/sheets/DEF456" --table mdRead content directly (recommended for AI Agent)
直接读取内容(推荐AI Agent使用)
bash
undefinedbash
undefinedOutput content to stdout instead of saving to file
将内容输出到标准输出而非保存到文件
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" --stdout
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" --stdout
or use short flag
或使用短标志
feishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -c
undefinedfeishu-docx export "https://xxx.feishu.cn/wiki/ABC123" -c
undefinedRead content without saving to file (Python)
不保存文件直接读取内容(Python)
python
from feishu_docx import FeishuExporter
exporter = FeishuExporter(app_id="xxx", app_secret="xxx")
content = exporter.export_content("https://xxx.feishu.cn/wiki/xxx")
print(content)python
from feishu_docx import FeishuExporter
exporter = FeishuExporter(app_id="xxx", app_secret="xxx")
content = exporter.export_content("https://xxx.feishu.cn/wiki/xxx")
print(content)Command Reference
命令参考
| Command | Description |
|---|---|
| Export document to Markdown |
| OAuth authorization |
| Set credentials |
| Show current config |
| Clear token cache |
| 命令 | 描述 |
|---|---|
| 将文档导出为Markdown格式 |
| OAuth授权 |
| 设置凭证 |
| 查看当前配置 |
| 清除令牌缓存 |
Tips
提示
- Images are automatically downloaded to a folder named after the document
- Use for Markdown tables instead of HTML
--table md - Token is cached and auto-refreshed, no need to re-authorize
- For Lark (overseas), add flag
--lark
- 图片将自动下载到以文档命名的文件夹中
- 使用参数生成Markdown表格而非HTML表格
--table md - 令牌会被缓存并自动刷新,无需重新授权
- 针对海外版Lark,添加参数
--lark