with one click
medium-push
// 将 Markdown 文件推送到浏览器中打开的 Medium 编辑器。当用户说"发布到 medium"、"推送到 medium"、"paste to medium"、"push to medium"或在完成文章生成后要求发送到 Medium 时触发。
// 将 Markdown 文件推送到浏览器中打开的 Medium 编辑器。当用户说"发布到 medium"、"推送到 medium"、"paste to medium"、"push to medium"或在完成文章生成后要求发送到 Medium 时触发。
| name | medium-push |
| category | publishing |
| description | 将 Markdown 文件推送到浏览器中打开的 Medium 编辑器。当用户说"发布到 medium"、"推送到 medium"、"paste to medium"、"push to medium"或在完成文章生成后要求发送到 Medium 时触发。 |
通过 Chrome 扩展 + Bridge 服务(HTTP + SSE),将本地 Markdown 文件转换为富文本并推送到浏览器中打开的 Medium 编辑器。
Claude Code (读取 Markdown 文件)
→ curl POST http://localhost:18766/paste
→ Bridge Server (SSE 推送)
→ Chrome Extension (content script)
→ Markdown → HTML 转换
→ Medium 编辑器 (模拟粘贴富文本)
curl -s http://localhost:18766/health 2>/dev/null || echo "NOT_RUNNING"
| 结果 | 操作 |
|---|---|
{"status":"ok",...} | Bridge 已运行,跳到步骤 2 |
NOT_RUNNING | 启动 Bridge 服务 |
启动 Bridge:
nohup node <skill-path>/scripts/bridge.mjs > /tmp/medium-push-bridge.log 2>&1 &
echo $!
等待 1 秒后再次检查 /health 确认启动成功。
提示用户在 Chrome 中打开 Medium 新文章页面:
https://medium.com/new-story
读取用户指定的 Markdown 文件路径。如果用户没有指定,查找 blog-external/ 目录下的 medium.md 文件。
方式 A:通过文件路径(推荐)
curl -s -X POST http://localhost:18766/paste \
-H "Content-Type: application/json" \
-d '{"filePath": "<absolute-path-to-markdown-file>"}'
方式 B:直接发送内容
curl -s -X POST http://localhost:18766/paste \
-H "Content-Type: application/json" \
-d @- <<'PAYLOAD'
{"content": "<markdown-content-here>"}
PAYLOAD
检查响应中的字段:
| 字段 | 含义 |
|---|---|
success: true | 请求成功 |
clientsSent > 0 | 内容已推送到浏览器扩展 |
clientsSent = 0 | 没有连接的扩展客户端 |
如果 clientsSent = 0,提示用户:
https://medium.com/new-story 页面输出格式:
文章已推送到 Medium 编辑器!
文件:{file_path}
内容长度:{contentLength} 字符
浏览器客户端:{clientsSent} 个
请在浏览器中查看 Medium 编辑器并检查内容格式。
chrome://extensions/<skill-path>/extension/ 目录Bridge 为纯 Node.js 实现,零外部依赖,无需 npm install。
默认端口 18766(避免与 md-push 的 18765 冲突),可通过 BRIDGE_PORT 环境变量修改。
# 标题会自动填入 Medium 的标题字段Write a new Pareto blog post targeting a specific long-tail SEO keyword and prepare its three external-platform copies (Medium, dev.to, 掘金). Use when the user says "写一篇博客", "写一篇 SEO 博客", "针对 X 关键词写博客", "新增一篇博客", "create a new pareto blog post", "publish a new blog post", "write SEO content", or names a slug from blog-external/SEO-KEYWORDS.md and asks to draft it. Generates the bilingual website canonical post (EN + ZH), updates both blog index pages, and produces medium.md / devto.md / juejin.md ready to publish through the existing flow (curl for dev.to, /medium-push, manual copy for 掘金).
Write blog posts for the Pareto documentation site and create external platform versions for 掘金 (Juejin), Medium, and Dev.to. Handles bilingual content (English + Chinese), updates the blog listing pages, verifies internal links, and builds to confirm. Use when the user says "write a blog post", "发布文章", "写博客", "new blog post", "publish article", "blog about X", or wants to announce a feature/release. Also use when the user asks to prepare content for external platforms like Juejin, Medium, or Dev.to.