flashhtml-cli
v0.1.0
Published
FlashHTML command line interface — generate, manage and publish HTML slides from AI agents.
Downloads
18
Readme
@flashhtml/cli
FlashHTML 官方 CLI,给 AI Agent / 自动化脚本使用。所有调用通过用户自助生成的 API Key(flk_...)鉴权,
实际消耗一律从账户余额扣费,与网页工作台保持一致。
安装
npm i -g flashhtml-cli
# 或一次性运行
npx flashhtml-cli --help认证
登录 https://flashhtml.com → 工作台 → 我的 API Key → 生成 Key。
复制
flk_...明文(只展示这一次)。运行:
flashhtml login flk_xxxxxxxxxxxx # 或交互式(密码隐藏) flashhtml login
也可以通过环境变量临时覆盖:
export FLASHHTML_API_KEY=flk_xxx
export FLASHHTML_ENDPOINT=https://flashhtml.com常用命令
| 命令 | 说明 |
| --- | --- |
| flashhtml whoami | 查看当前身份与余额 |
| flashhtml library push ./deck.html -t "产品发布" | 上传 HTML 到资源库 |
| flashhtml library list -k 发布 | 搜索资源库 |
| flashhtml library get 12 -o /tmp/deck.html | 下载原文 |
| flashhtml library publish-share 12 | 生成闪传短链(扣 1 次余额)|
| flashhtml share ./deck.html | 一步到位:上传 + 生成短链 |
AI Agent 集成示例
import subprocess, json, pathlib
html_path = pathlib.Path("/tmp/deck.html")
html_path.write_text(generate_html(prompt)) # 你的模型产物
out = subprocess.run(
["flashhtml", "share", str(html_path)], capture_output=True, text=True, check=True
)
# 从 stdout 解析 URL 并告诉用户计费
| 动作 | 计费 | 说明 |
| --- | --- | --- |
| login / whoami / library list/get/push/delete | 免费 | 只做身份验证与元数据读写 |
| library publish-share / share | 1 次余额 | 与网页「闪传」一致 |
开发
pnpm install # 或 npm install
npm run build # 生成 dist/
./dist/index.js --help