Loading...
Loading...
Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file/URL to X Articles, or mentions "publish to X", "post article to Twitter", "X article", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically.
npx skill4agent add joeseesun/qiaomu-x-article-publisher x-article-publisherpip install Pillow pyobjc-framework-Cocoa patchrightcd ~/.claude/skills/x-article-publisher/scripts
python auth_manager.py setup# 检查认证状态
python auth_manager.py status
# 验证认证是否有效
python auth_manager.py validate
# 清除认证数据(需重新登录)
python auth_manager.py clear
# 重新认证(清除 + 设置)
python auth_manager.py reauthauth_manager.py setup~/.claude/skills/x-article-publisher/data/browser_state/~/.claude/skills/x-article-publisher/scripts/# 基本用法
python publish_article.py --file article.md
# 显示浏览器(调试用)
python publish_article.py --file article.md --show-browser
# 自定义标题
python publish_article.py --file article.md --title "自定义标题"python parse_markdown.py <markdown_file> [--output json|html] [--html-only]# Copy image (with optional compression)
python copy_to_clipboard.py image /path/to/image.jpg [--quality 80]
# Copy HTML for rich text paste
python copy_to_clipboard.py html --file /path/to/content.htmlpython auth_manager.py setupcd ~/.claude/skills/x-article-publisher/scripts
python publish_article.py --file /path/to/article.mdpython parse_markdown.py article.mdparse_markdown.pyneeds_title_generation: true--title "生成的标题"# 解析文章
python parse_markdown.py article.md
# 如果 needs_title_generation: true,Claude 生成标题后:
python publish_article.py --file article.md --title "AI时代,普通人的3个生存法则"parse_markdown.pyneeds_cover_generation: truegemini-image-generatorjimeng-image-generator为一篇关于「{文章主题}」的文章生成封面图。
风格:简洁、现代、科技感
元素:{1-3个核心视觉元素}
文字:可选,如果加文字只放{1-3个关键词}
尺寸:16:9 横版# 1. 解析文章
python parse_markdown.py article.md
# 输出: needs_cover_generation: true
# 2. Claude 调用生图 skill 生成封面(假设保存到 /tmp/cover.png)
# 3. 将封面图插入文章开头,或手动上传{
"title": "Article Title",
"title_source": "h1", // "h1", "h2", "first_line", or "none"
"needs_title_generation": false, // true if no H1 title
"cover_image": "/path/to/first-image.jpg",
"needs_cover_generation": false, // true if no cover image
"content_images": [
{"path": "/path/to/img2.jpg", "block_index": 5}
],
"html": "<p>Content...</p><h2>Section</h2>...",
"total_blocks": 45
}title_sourceh1h2first_linenoneneeds_title_generationneeds_cover_generation@@@IMG_X@@@cd ~/.claude/skills/x-article-publisher/scripts
python publish_article.py --file /path/to/article.md📄 解析文件:/path/to/article.md
📝 标题:文章标题
🖼️ 封面图:/path/to/cover.jpg
📷 内容图:2 张
🌐 启动浏览器...
📍 导航到 X Articles...
🔘 点击 create 按钮...
📝 填写标题...
📋 粘贴内容...
✅ 草稿已创建!
💡 请在浏览器中检查并手动发布
🖥️ 浏览器保持打开,请检查草稿并手动发布
⏎ 完成后按回车键关闭浏览器...