hyperscribe-share

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hyperscribe — Share mode

Hyperscribe — 分享模式

Deploys an existing
.html
file (typically from
~/.hyperscribe/out/
) to Vercel and returns a public URL. Thin wrapper over the
hyperscribe
skill's
scripts/share.sh
.
将现有的
.html
文件(通常位于
~/.hyperscribe/out/
目录下)部署到Vercel,并返回一个公开URL。这是对
hyperscribe
skill中
scripts/share.sh
脚本的轻量封装。

When to use

使用场景

  • User just rendered a Hyperscribe page and says "share this", "send me a link", "can I send this to someone".
  • User explicitly asks to deploy an HTML file.
  • User wants a public URL for an existing output.
Do not use for: generating new pages (use
hyperscribe
or
hyperscribe-slides
), deploying arbitrary sites (this only handles Hyperscribe outputs).
  • 用户刚渲染完一个Hyperscribe页面,并说“分享这个”“给我一个链接”“我能把这个发给别人吗”。
  • 用户明确要求部署一个HTML文件。
  • 用户希望为已有的输出内容获取一个公开URL。
请勿用于:生成新页面(请使用
hyperscribe
hyperscribe-slides
)、部署任意网站(此功能仅处理Hyperscribe的输出内容)。

Preconditions

前置条件

  1. vercel
    CLI must be on PATH. If missing, the script exits 127 and tells the user:
    npm i -g vercel && vercel login
    .
  2. An
    .html
    file must exist at the path you pass.
  3. User should have run
    vercel login
    at least once (interactive — don't try to do it yourself).
  1. vercel
    CLI必须在系统PATH中。如果缺失,脚本会以状态码127退出,并提示用户:
    npm i -g vercel && vercel login
  2. 你传入的路径下必须存在一个
    .html
    文件。
  3. 用户至少已执行过一次
    vercel login
    (该过程为交互式操作,请勿尝试自动执行)。

Resolve the HTML path

解析HTML路径

  1. Explicit path given — use it (verify it exists).
  2. "last" / "just now" / no path — find the most recent output:
    bash
    HTML=$(ls -1t ~/.hyperscribe/out/*.html 2>/dev/null | head -1)
    If nothing exists, ask the user to render one first with
    hyperscribe
    /
    hyperscribe-slides
    /
    hyperscribe-diff
    .
  1. 给定明确路径 — 使用该路径(需验证文件是否存在)。
  2. "last" / "just now" / no path — 查找最新的输出文件:
    bash
    HTML=$(ls -1t ~/.hyperscribe/out/*.html 2>/dev/null | head -1)
    如果没有找到任何文件,请让用户先使用
    hyperscribe
    /
    hyperscribe-slides
    /
    hyperscribe-diff
    渲染一个页面。

Deploy

部署流程

bash
undefined
bash
undefined

Locate the share script (installed alongside the hyperscribe skill).

Locate the share script (installed alongside the hyperscribe skill).

SHARE=$(for p in
./.claude/skills/hyperscribe ~/.claude/skills/hyperscribe
./.codex/skills/hyperscribe ~/.codex/skills/hyperscribe
./.cursor/skills/hyperscribe ~/.cursor/skills/hyperscribe
./.opencode/skills/hyperscribe ~/.opencode/skills/hyperscribe
~/.claude/plugins/cache/hyperscribe-marketplace/*/plugins/hyperscribe do [ -f "$p/scripts/share.sh" ] && { echo "$p/scripts/share.sh"; break; }; done)
if [ -z "$SHARE" ]; then echo "hyperscribe share script not found. Install with: npx skills add Atipico1/hyperscribe" >&2 exit 1 fi
bash "$SHARE" "$HTML"

On success, the script prints `Deployed: https://<id>.vercel.app`. Extract that URL and report it back.
SHARE=$(for p in
./.claude/skills/hyperscribe ~/.claude/skills/hyperscribe
./.codex/skills/hyperscribe ~/.codex/skills/hyperscribe
./.cursor/skills/hyperscribe ~/.cursor/skills/hyperscribe
./.opencode/skills/hyperscribe ~/.opencode/skills/hyperscribe
~/.claude/plugins/cache/hyperscribe-marketplace/*/plugins/hyperscribe do [ -f "$p/scripts/share.sh" ] && { echo "$p/scripts/share.sh"; break; }; done)
if [ -z "$SHARE" ]; then echo "hyperscribe share script not found. Install with: npx skills add Atipico1/hyperscribe" >&2 exit 1 fi
bash "$SHARE" "$HTML"

部署成功后,脚本会输出`Deployed: https://<id>.vercel.app`。提取该URL并反馈给用户。

Report to user

向用户反馈

After a successful deploy, tell them:
  • The live URL.
  • That the page is
    cleanUrls: true
    on Vercel's edge network.
  • That re-running this skill issues a fresh URL (old ones remain live unless deleted).
部署成功后,告知用户:
  • 实时访问URL。
  • 该页面在Vercel边缘网络上启用了
    cleanUrls: true
    配置。
  • 再次运行此skill会生成一个新的URL(旧URL会保持可用,除非手动删除)。

Failure modes

失败场景

ExitCauseFix
127
vercel
CLI missing
npm i -g vercel && vercel login
2path missing/invalidCheck
~/.hyperscribe/out/
exists; render something first
1deploy ran but no URL parsedRead the full deploy log (path printed in stderr)
退出码原因解决方法
127
vercel
CLI缺失
执行
npm i -g vercel && vercel login
2路径不存在/无效检查
~/.hyperscribe/out/
目录是否存在;先渲染内容
1部署执行但未解析到URL查看完整的部署日志(日志路径会输出到stderr)

Avoid

注意事项

  • Deploying HTML containing secrets — if the content has API keys or credentials, warn the user first.
  • Running
    vercel login
    yourself — it's interactive; the user must do it.
  • Deploying files outside
    ~/.hyperscribe/out/
    unless the user explicitly asks.
  • 请勿部署包含敏感信息的HTML文件——如果内容包含API密钥或凭据,请先警告用户。
  • 请勿自行执行
    vercel login
    ——该过程为交互式操作,必须由用户完成。
  • 除非用户明确要求,否则请勿部署
    ~/.hyperscribe/out/
    目录以外的文件。