hosthtml
Ship your HTML to the world in seconds.
A minimal CLI tool that publishes HTML files to the web via Cloudflare Pages — no git, no build, no config files. Just one command, one URL.
Built for a world where AI generates reports faster than humans can share them.
一个极简的命令行工具,将 HTML 文件通过 Cloudflare Pages 发布到互联网 — 无需 git,无需构建,无需配置文件。一条命令,一个 URL。
为 AI 时代而生:当报告生成快于分享时,你需要 hosthtml。
Quick Start
# Install
go install github.com/athom/hosthtml@latest
# First time setup — just one token, that's it
hosthtml config set token <your-cloudflare-api-token>
hosthtml config set account-id <your-account-id>
# Publish
hosthtml ./report.html
Uploading 1 file(s)...
Done!
Preview: https://a1b2c3d4.hosthtml-x3k.pages.dev
Latest: https://hosthtml-x3k.pages.dev
(URL copied to clipboard)
That's it. URL is on your clipboard. Send it.
就这样。URL 已经在你的剪贴板里了。发出去吧。
Why
AI agents generate beautiful HTML reports. Sharing them shouldn't require deploying infrastructure.
- openclaw spits out a legal analysis →
hosthtml ./analysis.html → send the link on WeChat
- Claude generates a dashboard →
hosthtml ./dashboard/ → open on your phone
- Any AI tool creates a report → one command → shareable URL
AI 生成报告越来越快,但分享依然麻烦。hosthtml 解决最后一公里:
- openclaw 出了法律分析报告 →
hosthtml ./analysis.html → 微信发链接
- Claude 生成了数据看板 →
hosthtml ./dashboard/ → 手机直接打开
- 任何 AI 工具生成的报告 → 一条命令 → 可分享的 URL
Commands
hosthtml <path> # Publish file or directory
hosthtml list # List recent deployments
hosthtml clean --before 7d # Remove deployments older than 7 days
hosthtml config set token <value> # Set API token
hosthtml config set account-id <id> # Set account ID
hosthtml config # Show current config
Single file
hosthtml ./report.html
# → Automatically served as index.html
Directory
hosthtml ./my-site/
# → All files preserved with original structure
Setup
1. Cloudflare Account (free)
Sign up at dash.cloudflare.com/sign-up. No credit card needed.
注册 Cloudflare 免费账号,无需信用卡。
2. API Token
Go to API Tokens → Create Token:
- Permissions:
Cloudflare Pages: Edit
前往 API Tokens → 创建 Token:
- 权限:
Cloudflare Pages: Edit
3. Account ID
Find it in your Cloudflare dashboard URL: https://dash.cloudflare.com/<account-id>
在 Cloudflare 控制台的 URL 中找到:https://dash.cloudflare.com/<account-id>
How It Works
hosthtml ./report.html
│
├─ Hash files (blake3)
├─ Upload to Cloudflare Pages (Direct Upload API)
└─ Return unique preview URL
~1-2 seconds for typical reports
No git push. No CI/CD pipeline. No build step. Just files → URL.
没有 git push,没有 CI/CD,没有构建步骤。文件 → URL,仅此而已。
Each upload creates a unique preview URL. The project URL always points to the latest upload. Old deployments can be cleaned up with hosthtml clean.
每次上传生成唯一的预览 URL,项目 URL 始终指向最新上传。旧部署可以用 hosthtml clean 清理。
Install
Go
go install github.com/athom/hosthtml@latest
From Source
git clone https://github.com/athom/hosthtml.git
cd hosthtml
go build -o hosthtml .
Limits
Cloudflare Pages free tier:
|
|
| Bandwidth |
Unlimited |
| Deployments |
500/month |
| Max file size |
25 MB |
| Max files per deploy |
20,000 |
License
MIT