
feishu2md
CLIExports Feishu/Lark docs, whole folders or wikis to Markdown with images, so agents can read, migrate or archive them. Requires creating a custom app on the Feishu/Lark Open Platform and configuring its App ID and App Secret.
feishu2md
这是一个下载飞书文档为 Markdown 文件的工具,使用 Go 语言实现。
请看这里:由于原作者已不再使用飞书文档,项目转为社区维护,欢迎 PR,有能力的维护者会被选择为主协调员。
动机
《一日一技 | 我开发的这款小工具,轻松助你将飞书文档转为 Markdown》
获取 API Token
配置文件需要填写 APP ID 和 APP SECRET 信息,请参考 飞书官方文档 获取。推荐设置为
- 进入飞书开发者后台
- 创建企业自建应用(个人版),信息随意填写
- (重要)打开权限管理,开通以下必要的权限(可点击以下链接参考 API 调试台->权限配置字段)
- 获取文档基本信息,「查看新版文档」权限
docx:document:readonly - 获取文档所有块,「查看新版文档」权限
docx:document:readonly - 下载素材,「下载云文档中的图片和附件」权限
docs:document.media:download - 获取文件夹中的文件清单,「查看、评论、编辑和管理云空间中所有文件」权限
drive:file:readonly - 获取知识空间节点信息,「查看知识库」权限
wiki:wiki:readonly
- 获取文档基本信息,「查看新版文档」权限
- 打开凭证与基础信息,获取 App ID 和 App Secret
如何使用
注意:飞书旧版文档的下载工具已决定不再维护,但分支 v1_support 仍可使用,对应的归档为 v1.4.0,请知悉。
命令行版本
借助 Go 语言跨平台的特性,已编译好了主要平台的可执行文件,可以在 Release 中下载,并将相应平台的 feishu2md 可执行文件放置在 PATH 路径中即可。
查阅帮助文档
$ feishu2md -h
NAME:
feishu2md - Download feishu/larksuite document to markdown file
USAGE:
feishu2md [global options] command [command options] [arguments...]
VERSION:
v2-0e25fa5
COMMANDS:
config Read config file or set field(s) if provided
download, dl Download feishu/larksuite document to markdown file
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help (default: false)
--version, -v print the version (default: false)
$ feishu2md config -h
NAME:
feishu2md config - Read config file or set field(s) if provided
USAGE:
feishu2md config [command options] [arguments...]
OPTIONS:
--appId value Set app id for the OPEN API
--appSecret value Set app secret for the OPEN API
--help, -h show help (default: false)
$ feishu2md dl -h
NAME:
feishu2md download - Download feishu/larksuite document to markdown file
USAGE:
feishu2md download [command options] <url>
OPTIONS:
--output value, -o value Specify the output directory for the markdown files (default: "./")
--dump Dump json response of the OPEN API (default: false)
--batch Download all documents under a folder (default: false)
--wiki Download all documents within the wiki. (default: false)
--help, -h show help (default: false)
生成配置文件
通过 feishu2md config --appId <your_id> --appSecret <your_secret> 命令即可生成该工具的配置文件。
通过 feishu2md config 命令可以查看配置文件路径以及是否成功配置。
更多的配置选项请手动打开配置文件更改。
下载单个文档为 Markdown
通过 feishu2md dl <your feishu docx url> 直接下载,文档链接可以通过 分享 > 开启链接分享 > 互联网上获得链接的人可阅读 > 复制链接 获得。
示例:
$ feishu2md dl "https://domain.feishu.cn/docx/docxtoken"
批量下载某文件夹内的全部文档为 Markdown
此功能暂时不支持Docker版本
通过feishu2md dl --batch <your feishu folder url> 直接下载,文件夹链接可以通过 分享 > 开启链接分享 > 互联网上获得链接的人可阅读 > 复制链接 获得。
示例:
$ feishu2md dl --batch -o output_directory "https://domain.feishu.cn/drive/folder/foldertoken"
批量下载某知识库的全部文档为 Markdown
通过feishu2md dl --wiki <your feishu wiki setting url> 直接下载,wiki settings链接可以通过 打开知识库设置获得。
示例:
$ feishu2md dl --wiki -o output_directory "https://domain.feishu.cn/wiki/settings/123456789101112"
Docker版本
Docker 镜像:https://hub.docker.com/r/wwwsine/feishu2md
Docker 命令:docker run -it --rm -p 8080:8080 -e FEISHU_APP_ID=<your id> -e FEISHU_APP_SECRET=<your secret> -e GIN_MODE=release wwwsine/feishu2md
Docker Compose:
# docker-compose.yml
version: '3'
services:
feishu2md:
image: wwwsine/feishu2md
environment:
FEISHU_APP_ID: <your id>
FEISHU_APP_SECRET: <your secret>
GIN_MODE: release
ports:
- "8080:8080"
启动服务 docker compose up -d
然后访问 https://127.0.0.1:8080 粘贴文档链接即可,文档链接可以通过 分享 > 开启链接分享 > 复制链接 获得。
感谢
Related resources

feishu-cli
CLICommunity CLI for Feishu (Lark) focused on two-way conversion between Markdown and Feishu docs; also works with wikis, sheets, Bitable, messages, calendar, tasks and meeting notes, and ships 9 agent skills. Setup creates an app via QR scan; search and mail need extra user authorization.
riba2534/feishu-cli1.4k
lark-doc
SkillOfficial Lark (Feishu) skill to read, create and edit Lark docs and wiki pages, insert or download images and attachments, and work with whiteboards and mind notes. Depends on lark-cli and the lark-shared skill; requires Lark authorization.
larksuite/cli17.7k
lark-cli (Lark CLI)
CLIOfficial Lark (Feishu) CLI with 200+ commands for messages, docs, Base, Sheets, calendar, mail, approvals, OKRs, meetings and Minutes, plus 20+ bundled lark-* agent skills and structured output. Create a Lark app and sign in first.
larksuite/cli17.7k
NotesMD CLI
CLIReads and writes Obsidian vaults from the terminal: search, view, create, edit, move and delete notes, and manage frontmatter and daily notes, without Obsidian running. Good for agents maintaining a personal knowledge base. Formerly Obsidian CLI.
Yakitrak/notesmd-cli1.6k
Obsidian Skills
SkillTeaches agents to read and write Obsidian vaults: Obsidian-flavored Markdown, Bases data views, JSON Canvas and the Obsidian CLI, plus Defuddle web content extraction and Knap template rendering. Maintained by Obsidian CEO kepano.
kepano/obsidian-skills49.6k
claude-obsidian
PluginTurns an Obsidian vault into a local-first knowledge base: imports sources into interlinked notes with citations, answers questions from what is already in the vault, and adds 15 skills including search, vault health checks and Canvas knowledge graphs.
AgriciDaniel/claude-obsidian15.6k