htmlrun

htmlrun: publishes HTML (or HTML generated from Markdown or plain text) as a shareable https://html.run/s/xxx link that can be opened on phones, computers, or WeChat; republishing the same file updates content while keeping the link unchanged; initial use covers htmlrun-cli installation, device activation (htmlrun --check) and token setup. Does not handle PDFs, images, videos, or multi-page website hosting.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "htmlrun" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-192e4ccd6c1670807737bd48ad92c2255aee43b5b5baa37b9ce50920bfddfb9f. Verify the upstream source and version against https://skillhub.cn/skills/org-q447viqi/htmlrun before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

htmlrun: publishes HTML (or HTML generated from Markdown or plain text) as a shareable https://html.run/s/xxx link that can be opened on phones, computers, or WeChat; republishing the same file updates content while keeping the link unchanged; initial use covers htmlrun-cli installation, device activation (htmlrun --check) and token setup. Does not handle PDFs, images, videos, or multi-page website hosting.

0 Downloads

Introduction source: third_party · org-q447viqi · 1.5.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: htmlrun-publish
slug: htmlrun
displayName: htmlrun-把本地 HTML 变成可分享的在线链接
description: 把 HTML(或 Markdown、纯文本转成的 HTML)发布成可分享的 https://html.run/s/xxx 链接,别人用手机、电脑、微信打开就能看;同一文件重复发布只更新内容、链接不变。凡是用户想让别人能打开某个页面就用它,常见说法:发布、上线、部署、发出去、发我看看、发给同事、发给领导、给个链接、生成链接、弄个在线的、传上去、publish、deploy、share。也用于回答「这个怎么发给别人看」「手机上怎么打开」「怎么分享出去」,以及你刚给用户生成完 HTML、ta 紧接着要一个链接的场景。改完页面说「更新一下」「重发一遍」同样走本技能(默认同链接更新)。首次使用时的 htmlrun-cli 安装、htmlrun --check 设备激活与 token 配置也在本技能内。不处理 PDF、图片、视频等非文本文件,也不做多页网站托管。
version: 1.5.0
license: MIT

HTMLRun 发布

调用本地 htmlrun CLI 把 HTML 文件发布到 https://html.run ,返回可分享链接。CLI 源码仓库 https://pypi.org/project/htmlrun-cli/

When to Use

判断标准只有一条:用户希望「别人能打开这个页面」。用户不会说「调用 htmlrun」, ta 说的是下面这些。看到就用,不要先问「你是想发布吗」。

  • 要链接:发布、上线、部署、发出去、传上去、给个链接、生成链接、弄个在线的、 publish / deploy / share / host it
  • 点名收件人:「发给同事看看」「发我看看」「给领导过目」「发群里」——有收件人就意味着要链接
  • 问怎么办:「这个怎么发给别人看」「手机上能打开吗」「微信里怎么看」「能分享出去吗」
  • 接着上一步:你刚生成完 HTML,用户说「可以了」「就这个」「发吧」——ta 要的是链接, 不是再看一遍代码
  • 更新:「改完了重发一遍」「更新一下」「换个版本」(默认同链接更新,见 §3)
  • 首次使用还没装 CLI / 没激活设备(见 §1、§2、§4)
  • 拿到 CLI 输出后要决定下一步(见「核心原则」)

用户自己有 .html 文件、或内容已经在对话里生成好了,就算够条件,不用等 ta 说出 "htmlrun" 或 "发布" 这两个字。判断不准时倾向于用:跑一次 --check 的代价远小于 让用户干等。

When NOT to Use

  • 还没有任何可发布内容,只有一句模糊需求——先把 HTML 生成出来,再回本技能
  • 发 PDF / 图片 / 视频 / 压缩包 / 二进制——本技能只吃 HTML 和能转成 HTML 的文本
  • 要「做个网站」「配域名」「多页面带路由」——htmlrun 发的是单文件工件,不是建站托管
  • 只想本地预览、不打算给别人看——直接打开文件就行,不必发布

核心原则:相信 CLI 输出,不要抢先解释

CLI 的输出已经包含所有 agent 需要的指引,包括:

  • 链接: — 成功返回的可分享链接
  • 敏感词(N): — 命中的敏感词列表
  • ⚠ 已被限制访问 — 内容被审核阻断
  • 说明: — 访问控制说明(公开/带密/私有)
  • 指引: — 服务端下发的 agent 提示摘要
  • ✓ / ✗ / · — 服务端下发的应做/不应做/建议列表,你需要转达给用户,不要抢先解释或改写让用户判断是否执行。
  • 下次: — 服务端建议的下一条命令

你的工作是把 CLI 输出转达给用户,不要抢先解释或改写。 特别是 指引: 及后续的 ✓ / ✗ / · / 下次: 是服务端给 agent 的机器可读指令。你需要转达给用户,不要抢先解释或改写。让用户判断是否按它走。

1. 首次使用前检查

htmlrun --check

这一条同时完成三件事:确认 CLI 已装、确认已激活、未激活时给出激活链接。这一步用它而不用 --version,是因为 --version 判不出激活状态,两条都跑要多一次往返。

htmlrun --version(或 -V)照旧可用,查版本号时用它。

  • 命令不存在,或报未知选项(No such option):
    1. 先判断当前系统,按系统选检查命令:
      • Windows:py -m htmlrun --check
      • macOS / Linux:python3 -m htmlrun --check 能跑 → 包已装上、只是命令不在 PATH,后续命令统一用 -m 形式(Windows 用 py -m,macOS / Linux 用 python3 -m)
    2. 报 No module named htmlrun → 才是真没装,走【2. 安装】。安装命令带 -U,会一并升级旧版本 CLI
  • 无输出、退出码 0 → 已激活,直接【3. 发布】
  • 输出激活链接 → 走【4. 激活】(本地 token 已失效。 后面跟着激活链接,也走这条)
  • 输出 token 不可用: … → 按【4.3 激活失败的处置】的表格走

2. 安装

先判断当前系统,按系统执行:

Windows(Python 官方安装版自带 py launcher;系统目录装不上时报权限错误时,fallback 到 --user 装用户目录):

py -m pip install -U htmlrun-cli \
  || py -m pip install -U --user htmlrun-cli
py -m htmlrun --check

macOS / Linux(三级依次尝试,前一级失败才用下一级):

python3 -m pip install -U htmlrun-cli \
  || python3 -m pip install -U --user htmlrun-cli \
  || python3 -m pip install -U --break-system-packages htmlrun-cli
python3 -m htmlrun --check

各系统常见差异与处置:

现象 原因 处置
py 报 command not found(Windows) 没装 Python,或装的版本没带 launcher 让用户安装 python.org 的 Windows 安装包,勾选 "Add python.exe to PATH",装完再试
Windows 上 python3 报 command not found Windows 只有 py / python,python3 通常不存在 统一用 py -m,不要用 python3 -m
macOS / Linux 上 python 报 command not found macOS 12.3+ 与 Debian/Ubuntu 只有 python3,没有 python 统一用 python3 -m,不要用 python -m
报 No module named pip 系统 Python 没带 pip(macOS 系统自带 3.9 常见) 让用户安装 python.org 的 Python 后再试
报 externally-managed-environment(PEP 668) Homebrew / Debian / Ubuntu 拒绝 pip 写入系统环境 fallback 链已覆盖:--user 装用户目录通常能绕过,仍不行才用 --break-system-packages

正式包地址 https://pypi.org/project/htmlrun-cli/ ,不要从其他源装。

3. 发布

3.0 发布前:先归一化为单文件 HTML

htmlrun publish 的输入应是标准 .html 文件。发布前先判断文件格式:

  • 如果文件已经是完整 HTML(包含 <!doctype html> 或 <html> 结构),可直接发布。
  • 如果是 HTML 片段、Markdown(.md/.markdown)、纯文本(.txt)或其他文本类内容,先转换成一个完整的 .html 文件,再发布生成后的 HTML。
  • 转换时必须把 CSS 和 JavaScript 内嵌在 HTML 中:CSS 放入 <style>,JS 放入 <script>;不要依赖外部 .css、.js 或远程资源来呈现核心内容。
  • Markdown 应转换为语义化 HTML(标题、列表、表格、代码块等),纯文本应转义后放入合适的 HTML 结构中。
  • 生成的 HTML 建议放在原文件同目录,使用同名 .html 后缀,例如 /absolute/path/report.md -> /absolute/path/report.html。
  • 后续更新同一个源文件时,尽量复用同一个生成后的 .html 路径,这样重复发布会更新同一工件、链接不变。

标准调用(路径必须绝对):

htmlrun publish /absolute/path/page.html

带备注(方便用户在管理端看版本历史):

htmlrun publish /absolute/path/page.html -m "调整了配色"

默认行为:同一绝对路径重复发布 = 更新同一工件,链接不变。

只有用户明确要求"全新链接"时才加 --new:

htmlrun publish /absolute/path/page.html --new

发布成功后,把 链接: 那一行返回给用户。如果 CLI 还输出了 指引: 下次: ✓ ✗ ·,一起转达。

4. 激活

未激活时 htmlrun --check 会输出激活链接和一个文本二维码:

htmlrun 0.4.1
请打开这个链接完成激活:

  ➜  https://html.run/login?code=s_xxxxxxxxxxxxxxxxxxxxxxxx

或用微信扫这个码,在手机上完成:

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░███████░░█░░█░███░███░██░░███████░░
  …(37 行 × 37 列,█ 是暗模块、░ 是亮模块)

确认授权后,回来重试即可。

4.1 你要做的事

  1. 把激活链接和那段二维码一起原样转达给用户。二维码必须放进代码块(三个反引号)里逐行照抄,不要重排、不要缩进、不要替换字符、不要省略中间几行——改动任何一个字符码就扫不出来了。请 ta 用微信扫码,或直接打开链接,然后在页面上点「确认授权这台设备」
  2. 等用户回话说已确认
  3. 再跑一次 htmlrun --check

两条路都要给:扫码直接落到手机微信,微信是登录态,一步就到确认按钮;链接落到桌面浏览器,未登录的用户还得先扫一次站内登录码。码显示不正常时不要卡住,把链接给用户就能继续。

码里编的是一次性激活凭据,每次都不一样,不要复用上一次输出的码。

不要循环跑 --check 去等。用户多久去点取决于 ta,轮询只会白耗;链接是长效的,放一会儿再确认也不影响。

第 3 步成功时输出:

✓ 激活成功
  token:      MacBook-Pro (自动创建)
  账号:       微信用户
  默认权限:   带密码(已设默认密码)
  有效期:     长期有效
  访问密码:   k7m2xq
  (自动创建的 token 默认带密,分享链接时要一并给出这个密码)

这里的 访问密码: 必须转达给用户,且只会出现这一次。 自动创建的 token 默认带密,用它发布的页面别人要登录并输入这个密码才能看。用户以后可以去 https://html.run/web/tokens 改成任何人可看。

4.2 用户不用手工创建 token

激活会自动生成 token 并绑定这台设备,不需要让用户去官网创建、也不需要 ta 把 token 贴给你。

绝对不要自己编造 token——格式合法也发不出去,只会浪费用户时间。

4.3 激活失败的处置

--check 输出 token 不可用: … 时,说明本地 token 有主但被停用了,这时不会自动激活(自动新建会绕过用户自己的操作意图):

CLI 输出 含义 怎么做
token 不可用: token 已暂停… 用户在管理端暂停了它 让用户去 https://html.run/web/tokens 重新启用;或跑 htmlrun loginwx 换账号重新激活
token 不可用: token 已吊销 / 已删除 / 已过期 token 不可恢复 跑 htmlrun loginwx 重新激活,把新链接转达用户
无法确认激活状态: … 网络或服务端问题,本地配置未改动 让用户稍后重试。不要因此重新激活
当前服务端不支持设备激活。 服务端版本较旧 按它列出的两步走:让用户去官网建 token,再用【附录】的 login --token

用户想换账号时跑 htmlrun loginwx,它会无条件开一个新激活会话。

5. 命令速查

命令 用途
htmlrun --check 检查是否已激活,未激活时给出激活链接(开工第一条)
htmlrun --version 只看版本号
htmlrun loginwx 重新激活 / 换账号(无条件开新会话)
htmlrun logout 清除本地 token
htmlrun whoami 查看本地记录的服务地址与 token(不联网)
htmlrun whoami --remote 联网查 token 在服务端的当前状态(是否已吊销/过期)
htmlrun publish <绝对路径> 发布(同路径复用工件)
htmlrun publish <path> -m "备注" 发布并附带版本备注
htmlrun publish <path> --new 强制新建工件,拿到全新链接(慎用)
htmlrun publish <path> --no-inline 不内联本地资源(默认会内联)

若 htmlrun 报 command not found,改用 python3 -m htmlrun ...(Windows 用 py -m htmlrun ...),其余命令等价。

常见处置

敏感词命中:CLI 会输出 敏感词(N): 和 ⚠ 已被限制访问。让用户按列出的词修改,同一路径重发——不要加 --new,加了会打断版本链、丢失原链接。

升级提示:CLI 有时会提示 建议升级 htmlrun-cli。告诉用户即可,不要因此重新发布——本次发布已经成功。

发布失败:CLI 返回 发布失败: XXX。把错误信息转达给用户,不要盲目重试;如果是 请求过于频繁(限流),等 1 分钟再试。

发布报 token 相关错误(token 已吊销/已暂停/已过期):token 状态变了。可以跑 htmlrun whoami --remote 确认服务端当前怎么看这个 token,把结果转达用户去管理端处理; 不可恢复时跑 htmlrun loginwx 重新激活。不要反复 login 试探——校验失败会触发限流锁定。

文件不存在:CLI 返回 文件不存在: XXX。让用户确认路径,注意路径必须绝对。

完整对话示例

场景 1:首次发布

用户:帮我发布 /Users/xxx/report.html

你:

  1. 跑 htmlrun --check
  2. 若输出激活链接,把链接转达用户,并把那段文本二维码放进代码块原样照抄,请 ta 扫码或打开链接,然后点「确认授权这台设备」。 停在这里等用户回话,不要循环跑 --check
  3. 用户说确认好了,再跑一次 htmlrun --check。看到 ✓ 激活成功 时,把里面的 访问密码: 一并转达给用户——它只出现这一次
  4. 跑 htmlrun publish /Users/xxx/report.html
  5. 把 链接: 那一行 + 服务端下发的 指引: 转达给用户

场景 2:刚生成完,用户要给别人看

用户(在你写完一个看板 HTML 之后):不错,发给我同事看看

这句里没有"发布"也没有"htmlrun",但"给别人看"就是本技能的触发条件。你:把内容写成 本地 .html 文件(绝对路径),跑 htmlrun --check,未激活先走【4. 激活】,然后 htmlrun publish,把 链接: 给用户。不要反问"你是想发布到线上吗"——ta 已经说了。

场景 3:更新已有页面

用户:我把 report.html 改了,重发一下

你:直接跑 htmlrun publish /Users/xxx/report.html -m "更新说明"。默认同路径 = 同链接,不要加 --new。

场景 4:敏感词命中

CLI 输出:

✓ 更新 → v3
  链接:       https://html.run/s/abc123
  敏感词(2): xxx、yyy
  ⚠ 已被限制访问:请按上面的敏感词修改内容后重发(同一路径、勿加 --new)

你:把这段原样转达给用户,提示 ta 修改 xxx、yyy 两处后再发。修改后同路径重发,不要加 --new——加了链接会变。

附录:手工配置 token

默认不要走这条路。只有两种情况需要它:

  • --check 输出 当前服务端不支持设备激活。(服务端版本较旧)
  • 用户明确要用自己在官网建好的某个 token(比如共享给团队、或 CI 环境没有浏览器)

步骤:让用户去 https://html.run/web/tokens 创建(h_ 开头,34 字符),拿到后执行

htmlrun login --token h_xxxxxxxx

login 会请求服务端校验,校验没过就不写入本地配置,退出码非 0。要看退出码/输出判断成败,不要看到命令跑完就当已登录。

失败时绝对不要重试。 服务端对校验失败的 IP 有严格限流(连续几次失败就锁定 5 分钟),盲目重试会把用户锁在门外——连正确的 token 也登不进去。

CLI 输出 含义 怎么做
登录失败: 无效的 token / token 已吊销 / token 已暂停… / token 已过期 token 本身不可用 把原文转达用户,让 ta 去 https://html.run/web/tokens 处理。不要重试
登录失败: 请求过于频繁…(N 秒后再试) 已被限流 告诉用户等 N 秒。不要重试
登录失败: 服务端暂时不可用(HTTP 5xx) / 无法连接服务… 服务端或网络问题,token 未必有坏 告诉用户稍后再试。不要因此让 ta 重新创建 token
已保存到 … + 注意:当前服务端不支持登录校验… 服务端版本较旧,没做校验(退出码 0) 已保存,可以继续发布;token 是否可用要等首次 publish 才知道

成功时输出 ✓ 登录成功,并列出 token 名称、账号、默认权限、有效期、已绑定设备数。

Current listing version

1.5.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决用户高频刚需:将 HTML/Markdown 发布为可分享链接,覆盖多种实际场景(发给同事、生成链接、更新内容等)
  • 功能定位清晰:专注于单文件 HTML 发布,不越界处理 PDF/图片/建站等无关需求
Trigger Precision90/100

Highlights

  • 触发词覆盖全面且精准:包含发布、上线、部署、发出去、给个链接等多种用户常见表达
  • 边界定义清晰:明确区分了适用与不适用场景,减少误触风险
Structure and Standards95/100

Highlights

  • 文档结构完整:包含使用场景、核心原则、分步骤说明、完整示例、命令速查等必要章节
  • 逻辑清晰易执行:从首次检查、安装、激活到发布、更新,流程完整且易于理解
Execution Reliability90/100

Highlights

  • 工具来源明确:使用官方 htmlrun-cli,提供完整安装与激活流程
  • 异常处理全面:覆盖敏感词、token 失效、文件不存在、网络问题等主要异常场景
  • 操作安全可靠:默认同路径更新保持链接不变,避免意外生成新链接
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • html.run
  • pypi.org

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.