网站离线打包为单二进制文件
推荐指数 46.0 NO. 022 · 2026.06.15
发布2026/06/14Score95Comments27
为什么值得看
Kage 是一个 Go 编写的 CLI 工具,可将任意网站抓取并打包成单个可执行二进制文件,自动剥离 JavaScript,支持完全离线浏览。适合需要保存文档、教程或静态站点用于无网络环境或长期归档的开发者。
媒体预览
编辑判断
之前做离线文档站通常依赖 wget --mirror 或 httrack,但配置繁琐且产物分散。Kage 的差异化在于输出单文件可执行体,分发和运行零依赖,类似单文件版 ZIM 但无需阅读器。
剥离 JS 的设计很关键——多数文档站、博客不需要交互,去掉 JS 能大幅减少体积并避免外链失效导致的渲染错误。做技术文档出海、给客户交付离线资料包的团队可以替换掉现有的 wget 脚本,实测能省掉一半的后期清理工作。
社区反馈
正面 25 条评论
核心争论:单页打包 vs 整站镜像:Kage 的核心定位是否清晰,以及浏览器原生方案是否足够
I find SingleFile [0] to be a much more robust version of this. It strips out all the JavaScript too, but also packs everything into a single HTML file that is easy to transfer. Binary assets (like web fonts and images) are packed as base64 strings. They also offer a CLI powered by Puppeteer. [1] [0
It seems this repo only saves one web page? What I'm implementing here is mirroring a whole website, with all its subpages, so you can browse it all offline. For example, all essays from paulgraham.com.
Oh, I see. In that case, feature-wise, it is actually a modern alternative to HTTrack. I think the misunderstanding stems from the browser's "Save As" reference in the description. It is misleading. You use "Save As" to save a single page, not an entire website. Also, the description lacks a clear e