tool-x-article-publisher

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

X Article Publisher

X Article 发布工具

Publish Markdown content into X (Twitter) Articles as a draft, preserving formatting via rich text paste and deterministic image insertion.
将Markdown内容发布为X(Twitter) Articles的草稿,通过富文本粘贴和固定规则的图片插入来保留格式。

Hard Rules (Safety)

硬性规则(安全要求)

  1. Never auto-publish (draft only; user publishes manually).
  2. User must be logged in before automation starts.
  3. First image = cover image (if any).
  1. 绝不自动发布(仅生成草稿;由用户手动发布)。
  2. 自动化开始前,用户必须已登录
  3. 首张图片将作为封面图(如果存在图片的话)。

Prerequisites

前提条件

  • Browser automation available (Playwright MCP or equivalent)
  • X account can access Articles (Premium / Premium Plus)
  • macOS recommended (clipboard helper uses Cocoa)
  • Python 3.9+ with:
    • pip install Pillow pyobjc-framework-Cocoa
  • 具备浏览器自动化能力(如Playwright MCP或同类工具)
  • X账户可访问Articles功能(需Premium或Premium Plus订阅)
  • 推荐使用macOS系统(剪贴板辅助工具依赖Cocoa)
  • Python 3.9及以上版本,需安装:
    • pip install Pillow pyobjc-framework-Cocoa

Inputs / Outputs (Recommended)

输入/输出(推荐配置)

Inputs (paths only):
  • article_md_path
    : Markdown file to publish
  • Optional:
    run_dir
    for artifacts (otherwise use
    /tmp/
    )
Outputs (recommended artifacts):
  • /tmp/x_article.json
    (parsed structure)
  • /tmp/x_article.html
    (HTML body for paste)
  • Optional:
    run_dir/evidence/x-article-draft.md
    (what was done + links)
输入(仅支持路径):
  • article_md_path
    : 待发布的Markdown文件路径
  • 可选:
    run_dir
    用于存储产物(未指定则默认使用
    /tmp/
输出(推荐产物):
  • /tmp/x_article.json
    (解析后的结构文件)
  • /tmp/x_article.html
    (用于粘贴的HTML正文)
  • 可选:
    run_dir/evidence/x-article-draft.md
    (操作记录及相关链接)

Bundled Scripts

内置脚本

Installed path (typical):
  • ~/.claude/skills/tool-x-article-publisher/scripts/parse_markdown.py
  • ~/.claude/skills/tool-x-article-publisher/scripts/copy_to_clipboard.py
默认安装路径:
  • ~/.claude/skills/tool-x-article-publisher/scripts/parse_markdown.py
  • ~/.claude/skills/tool-x-article-publisher/scripts/copy_to_clipboard.py

Runbook (Step-by-step)

操作手册(分步指南)

Follow:
references/runbook.md
请参考:
references/runbook.md