This is a tool for downloading Feishu documents as Markdown files, implemented using Go language.
Please see here: Recruit developers with needs and interests to discuss development and maintenance together. If you are interested, please contact us.
"One skill a day | This small tool I developed can easily help you convert Feishu documents into Markdown"
The configuration file needs to fill in the APP ID and APP SECRET information. Please refer to Feishu official documentation to obtain it. The recommended setting is
docx:document:readonly
docx:document:readonly
docs:document.media:download
drive:file:readonly
wiki:wiki:readonly
Note: The download tool for old versions of Feishu documents has been decided not to be maintained anymore, but the branch v1_support can still be used, and the corresponding archive is v1.4.0. Please be informed.
With the cross-platform feature of Go language, the executable files of the main platforms have been compiled and can be downloaded in Release, and the feishu2md executable file of the corresponding platform can be placed in the PATH path.
Check the help documentation
$ 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)
Generate configuration file
The tool's configuration file can be generated through the feishu2md config --appId
command.
You can use the feishu2md config
command to check the configuration file path and whether the configuration is successful.
For more configuration options, please manually open the configuration file changes.
Download a single document as Markdown
Download directly through feishu2md dl
, the document link can be obtained by sharing > turn on link sharing > people who get the link on the Internet can read > copy the link .
Example:
$ feishu2md dl " https://domain.feishu.cn/docx/docxtoken "
Batch download all documents in a folder as Markdown
This feature does not currently support Docker versions
Download directly through feishu2md dl --batch
. The folder link can be obtained by sharing > turn on link sharing > people who get the link on the Internet can read > copy the link .
Example:
$ feishu2md dl --batch -o output_directory " https://domain.feishu.cn/drive/folder/foldertoken "
Batch download all documents of a knowledge base as Markdown
Download directly through feishu2md dl --wiki
, the wiki settings link can be obtained by opening the knowledge base settings.
Example:
$ feishu2md dl --wiki -o output_directory " https://domain.feishu.cn/wiki/settings/123456789101112 "
Docker image: https://hub.docker.com/r/wwwsine/feishu2md
Docker command: docker run -it --rm -p 8080:8080 -e FEISHU_APP_ID=
Docker Compose:
# docker-compose.yml
version : ' 3 '
services :
feishu2md :
image : wwwsine/feishu2md
environment :
FEISHU_APP_ID :
FEISHU_APP_SECRET :
GIN_MODE : release
ports :
- " 8080:8080 "
Start the service docker compose up -d
Then visit https://127.0.0.1:8080 and paste the document link. The document link can be obtained by sharing > Enable link sharing > Copy link .
I used my personal test API Token to deploy an Unstable version on the Render platform. This version will not save any documentation and pictures in the container, and directly returns the compressed package file from the memory through HTTP, but the Log of the Render platform may Log some HTTP information.
The current version is only for temporary use by users who don't care about privacy or are too lazy to configure it. It can also be used to test and compare whether there is a problem with their own Token permission configuration. The Render platform uses free quota and only has 512M of memory. High availability is not guaranteed. The trust chain relies entirely on open source code, so please use it at your own discretion.
Visit https://feishu2md.onrender.com/ and paste the document link. The document link can be obtained by sharing > Enable link sharing > Copy link .