{"id":13454926,"url":"https://github.com/Wsine/feishu2md","last_synced_at":"2025-03-24T07:32:16.382Z","repository":{"id":37725538,"uuid":"492828269","full_name":"Wsine/feishu2md","owner":"Wsine","description":"一键命令下载飞书文档为 Markdown","archived":false,"fork":false,"pushed_at":"2024-11-26T11:58:32.000Z","size":213,"stargazers_count":1371,"open_issues_count":13,"forks_count":134,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-17T16:06:06.526Z","etag":null,"topics":["feishu","lark","markdown"],"latest_commit_sha":null,"homepage":"https://feishu2md.onrender.com/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wsine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Wsine"]}},"created_at":"2022-05-16T12:36:35.000Z","updated_at":"2025-03-17T08:52:59.000Z","dependencies_parsed_at":"2024-04-09T03:33:40.864Z","dependency_job_id":"4250ef5c-6fb9-46b8-b4db-b0f4ee6c9597","html_url":"https://github.com/Wsine/feishu2md","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wsine%2Ffeishu2md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wsine%2Ffeishu2md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wsine%2Ffeishu2md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wsine%2Ffeishu2md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wsine","download_url":"https://codeload.github.com/Wsine/feishu2md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245227550,"owners_count":20580898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feishu","lark","markdown"],"created_at":"2024-07-31T08:00:59.462Z","updated_at":"2025-03-24T07:32:16.036Z","avatar_url":"https://github.com/Wsine.png","language":"Go","readme":"# feishu2md\n\n[![Golang - feishu2md](https://img.shields.io/github/go-mod/go-version/wsine/feishu2md?color=%2376e1fe\u0026logo=go)](https://go.dev/)\n[![Unittest](https://github.com/Wsine/feishu2md/actions/workflows/unittest.yaml/badge.svg)](https://github.com/Wsine/feishu2md/actions/workflows/unittest.yaml)\n[![Release](https://img.shields.io/github/v/release/wsine/feishu2md?color=orange\u0026logo=github)](https://github.com/Wsine/feishu2md/releases)\n[![Docker - feishu2md](https://img.shields.io/badge/Docker-feishu2md-2496ed?logo=docker\u0026logoColor=white)](https://hub.docker.com/r/wwwsine/feishu2md)\n[![Render - feishu2md](https://img.shields.io/badge/Render-feishu2md-4cfac9?logo=render\u0026logoColor=white)](https://feishu2md.onrender.com)\n![Last Review](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fbadge-last-review.wsine.workers.dev%2FWsine%2Ffeishu2md\u0026query=%24.reviewed_at\u0026label=last%20review)\n\n这是一个下载飞书文档为 Markdown 文件的工具，使用 Go 语言实现。\n\n**请看这里：招募有需求和有兴趣的开发者，共同探讨开发维护，有兴趣请联系。**\n\n## 动机\n\n[《一日一技 | 我开发的这款小工具，轻松助你将飞书文档转为 Markdown》](https://sspai.com/post/73386)\n\n## 获取 API Token\n\n配置文件需要填写 APP ID 和 APP SECRET 信息，请参考 [飞书官方文档](https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/get-) 获取。推荐设置为\n\n- 进入飞书[开发者后台](https://open.feishu.cn/app)\n- 创建企业自建应用（个人版），信息随意填写\n- （重要）打开权限管理，开通以下必要的权限（可点击以下链接参考 API 调试台-\u003e权限配置字段）\n  - [获取文档基本信息](https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/get)，「查看新版文档」权限 `docx:document:readonly`\n  - [获取文档所有块](https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/list)，「查看新版文档」权限 `docx:document:readonly`\n  - [下载素材](https://open.feishu.cn/document/server-docs/docs/drive-v1/media/download)，「下载云文档中的图片和附件」权限 `docs:document.media:download`\n  - [获取文件夹中的文件清单](https://open.feishu.cn/document/server-docs/docs/drive-v1/folder/list)，「查看、评论、编辑和管理云空间中所有文件」权限 `drive:file:readonly`\n  - [获取知识空间节点信息](https://open.feishu.cn/document/server-docs/docs/wiki-v2/space-node/get_node)，「查看知识库」权限 `wiki:wiki:readonly`\n- 打开凭证与基础信息，获取 App ID 和 App Secret\n\n## 如何使用\n\n注意：飞书旧版文档的下载工具已决定不再维护，但分支 [v1_support](https://github.com/Wsine/feishu2md/tree/v1_support) 仍可使用，对应的归档为 [v1.4.0](https://github.com/Wsine/feishu2md/releases/tag/v1.4.0)，请知悉。\n\n\u003cdetails\u003e\n  \u003csummary\u003e命令行版本\u003c/summary\u003e\n\n  借助 Go 语言跨平台的特性，已编译好了主要平台的可执行文件，可以在 [Release](https://github.com/Wsine/feishu2md/releases) 中下载，并将相应平台的 feishu2md 可执行文件放置在 PATH 路径中即可。\n\n   **查阅帮助文档**\n\n   ```bash\n   $ feishu2md -h\n   NAME:\n     feishu2md - Download feishu/larksuite document to markdown file\n\n   USAGE:\n     feishu2md [global options] command [command options] [arguments...]\n\n   VERSION:\n     v2-0e25fa5\n\n   COMMANDS:\n     config        Read config file or set field(s) if provided\n     download, dl  Download feishu/larksuite document to markdown file\n     help, h       Shows a list of commands or help for one command\n\n   GLOBAL OPTIONS:\n     --help, -h     show help (default: false)\n     --version, -v  print the version (default: false)\n\n   $ feishu2md config -h\n   NAME:\n      feishu2md config - Read config file or set field(s) if provided\n\n   USAGE:\n      feishu2md config [command options] [arguments...]\n\n   OPTIONS:\n      --appId value      Set app id for the OPEN API\n      --appSecret value  Set app secret for the OPEN API\n      --help, -h         show help (default: false)\n\n   $ feishu2md dl -h\n   NAME:\n     feishu2md download - Download feishu/larksuite document to markdown file\n \n   USAGE:\n     feishu2md download [command options] \u003curl\u003e\n \n   OPTIONS:\n     --output value, -o value  Specify the output directory for the markdown files (default: \"./\")\n     --dump                    Dump json response of the OPEN API (default: false)\n     --batch                   Download all documents under a folder (default: false)\n     --wiki                    Download all documents within the wiki. (default: false)\n     --help, -h                show help (default: false)\n\n   ```\n\n   **生成配置文件**\n\n   通过 `feishu2md config --appId \u003cyour_id\u003e --appSecret \u003cyour_secret\u003e` 命令即可生成该工具的配置文件。\n\n   通过 `feishu2md config` 命令可以查看配置文件路径以及是否成功配置。\n\n   更多的配置选项请手动打开配置文件更改。\n\n   **下载单个文档为 Markdown**\n\n   通过 `feishu2md dl \u003cyour feishu docx url\u003e` 直接下载，文档链接可以通过 **分享 \u003e 开启链接分享 \u003e 互联网上获得链接的人可阅读 \u003e 复制链接** 获得。\n\n   示例：\n\n   ```bash\n   $ feishu2md dl \"https://domain.feishu.cn/docx/docxtoken\"\n   ```\n\n  **批量下载某文件夹内的全部文档为 Markdown**\n\n  此功能暂时不支持Docker版本\n\n  通过`feishu2md dl --batch \u003cyour feishu folder url\u003e` 直接下载，文件夹链接可以通过 **分享 \u003e 开启链接分享 \u003e 互联网上获得链接的人可阅读 \u003e 复制链接** 获得。\n\n  示例：\n\n  ```bash\n  $ feishu2md dl --batch -o output_directory \"https://domain.feishu.cn/drive/folder/foldertoken\"\n  ```\n\n  **批量下载某知识库的全部文档为 Markdown**\n\n  通过`feishu2md dl --wiki \u003cyour feishu wiki setting url\u003e` 直接下载，wiki settings链接可以通过 打开知识库设置获得。\n\n  示例：\n\n  ```bash\n  $ feishu2md dl --wiki -o output_directory \"https://domain.feishu.cn/wiki/settings/123456789101112\"\n  ```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eDocker版本\u003c/summary\u003e\n\n  Docker 镜像：https://hub.docker.com/r/wwwsine/feishu2md\n\n   Docker 命令：`docker run -it --rm -p 8080:8080 -e FEISHU_APP_ID=\u003cyour id\u003e -e FEISHU_APP_SECRET=\u003cyour secret\u003e -e GIN_MODE=release wwwsine/feishu2md`\n\n   Docker Compose:\n\n   ```yml\n   # docker-compose.yml\n   version: '3'\n   services:\n     feishu2md:\n       image: wwwsine/feishu2md\n       environment:\n         FEISHU_APP_ID: \u003cyour id\u003e\n         FEISHU_APP_SECRET: \u003cyour secret\u003e\n         GIN_MODE: release\n       ports:\n         - \"8080:8080\"\n   ```\n\n   启动服务 `docker compose up -d`\n\n   然后访问 https://127.0.0.1:8080 粘贴文档链接即可，文档链接可以通过 **分享 \u003e 开启链接分享 \u003e 复制链接** 获得。\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e在线版本\u003c/summary\u003e\n\n  我使用个人的测试 API Token 部署了一个 Unstable 版本在 Render 平台上，该版本不会保存任何的文档资料和图片在容器中，直接通过 HTTP 从**内存**中返回压缩包文件，但是 Render 平台的 Log 可能会记录一些 HTTP 信息。\n\n  在版本仅供不在意隐私或懒于配置的用户临时使用，也可用于测试对比是否自己的 Token 权限配置有问题。Render 平台使用免费配额，仅有 512M 内存，不保证高可用性，信任链全靠开源代码，请自行斟酌。\n\n  访问 https://feishu2md.onrender.com/ 粘贴文档链接即可，文档链接可以通过 **分享 \u003e 开启链接分享 \u003e 复制链接** 获得。\n\u003c/details\u003e\n\n## 感谢\n\n- [chyroc/lark](https://github.com/chyroc/lark)\n- [chyroc/lark_docs_md](https://github.com/chyroc/lark_docs_md)\n","funding_links":["https://github.com/sponsors/Wsine"],"categories":["Go","云文档","转换工具"],"sub_categories":["开发组件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWsine%2Ffeishu2md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWsine%2Ffeishu2md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWsine%2Ffeishu2md/lists"}