baoyu-post-to-x

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Post to X (Twitter)

发布内容至X(Twitter)

Posts text, images, videos, and long-form articles to X via real Chrome browser (bypasses anti-bot detection).
通过真实Chrome浏览器将文字、图片、视频和长文发布至X(可绕过反机器人检测)。

Script Directory

脚本目录

Important: All scripts are located in the
scripts/
subdirectory of this skill.
Agent Execution Instructions:
  1. Determine this SKILL.md file's directory path as
    SKILL_DIR
  2. Script path =
    ${SKILL_DIR}/scripts/<script-name>.ts
  3. Replace all
    ${SKILL_DIR}
    in this document with the actual path
Script Reference:
ScriptPurpose
scripts/x-browser.ts
Regular posts (text + images)
scripts/x-video.ts
Video posts (text + video)
scripts/x-quote.ts
Quote tweet with comment
scripts/x-article.ts
Long-form article publishing (Markdown)
scripts/md-to-html.ts
Markdown → HTML conversion
scripts/copy-to-clipboard.ts
Copy content to clipboard
scripts/paste-from-clipboard.ts
Send real paste keystroke
重要提示:所有脚本均位于此Skill的
scripts/
子目录中。
Agent执行说明:
  1. 确定此SKILL.md文件的目录路径为
    SKILL_DIR
  2. 脚本路径 =
    ${SKILL_DIR}/scripts/<script-name>.ts
  3. 将本文档中所有
    ${SKILL_DIR}
    替换为实际路径
脚本参考:
脚本用途
scripts/x-browser.ts
常规推文(文字+图片)
scripts/x-video.ts
视频推文(文字+视频)
scripts/x-quote.ts
带评论的引用推文
scripts/x-article.ts
长文发布(Markdown格式)
scripts/md-to-html.ts
Markdown转HTML格式
scripts/copy-to-clipboard.ts
将内容复制到剪贴板
scripts/paste-from-clipboard.ts
发送真实粘贴按键指令

Preferences (EXTEND.md)

偏好设置(EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):
bash
undefined
使用Bash检查EXTEND.md文件是否存在(优先级顺序):
bash
undefined

Check project-level first

先检查项目级路径

test -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo "project"
test -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo "project"

Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)

再检查用户级路径(跨平台:$HOME适用于macOS/Linux/WSL)

test -f "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "user"

┌──────────────────────────────────────────────────┬───────────────────┐
│                       Path                       │     Location      │
├──────────────────────────────────────────────────┼───────────────────┤
│ .baoyu-skills/baoyu-post-to-x/EXTEND.md          │ Project directory │
├──────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md    │ User home         │
└──────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐
│  Result   │                                  Action                                   │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ Found     │ Read, parse, apply settings                                               │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ Not found │ Use defaults                                                              │
└───────────┴───────────────────────────────────────────────────────────────────────────┘

**EXTEND.md Supports**: Default Chrome profile | Auto-submit preference
test -f "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "user"

┌──────────────────────────────────────────────────┬───────────────────┐
│                       路径                       │     位置     │
├──────────────────────────────────────────────────┼───────────────────┤
│ .baoyu-skills/baoyu-post-to-x/EXTEND.md          │ 项目目录 │
├──────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md    │ 用户主目录 │
└──────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐
│  结果   │                                  操作                                   │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ 已找到     │ 读取、解析并应用设置                                               │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ 未找到     │ 使用默认设置                                                              │
└───────────┴───────────────────────────────────────────────────────────────────────────┘

**EXTEND.md支持**:默认Chrome配置文件 | 自动提交偏好设置

Prerequisites

前置要求

  • Google Chrome or Chromium
  • bun
    runtime
  • First run: log in to X manually (session saved)
  • Google Chrome或Chromium浏览器
  • bun
    运行时环境
  • 首次运行:需手动登录X(会话将被保存)

References

参考文档

  • Regular Posts: See
    references/regular-posts.md
    for manual workflow, troubleshooting, and technical details
  • X Articles: See
    references/articles.md
    for long-form article publishing guide

  • 常规推文:查看
    references/regular-posts.md
    获取手动操作流程、故障排除和技术细节
  • X长文:查看
    references/articles.md
    获取长文发布指南

Regular Posts

常规推文

Text + up to 4 images.
bash
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png          # Preview
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png --submit  # Post
Parameters:
ParameterDescription
<text>
Post content (positional)
--image <path>
Image file (repeatable, max 4)
--submit
Post (default: preview)
--profile <dir>
Custom Chrome profile

文字 + 最多4张图片。
bash
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png          # 预览
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png --submit  # 发布
参数:
参数说明
<text>
推文内容(位置参数)
--image <path>
图片文件(可重复使用,最多4张)
--submit
发布推文(默认:预览)
--profile <dir>
自定义Chrome配置文件

Video Posts

视频推文

Text + video file.
bash
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Check this out!" --video ./clip.mp4          # Preview
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Amazing content" --video ./demo.mp4 --submit  # Post
Parameters:
ParameterDescription
<text>
Post content (positional)
--video <path>
Video file (MP4, MOV, WebM)
--submit
Post (default: preview)
--profile <dir>
Custom Chrome profile
Limits: Regular 140s max, Premium 60min. Processing: 30-60s.

文字 + 视频文件。
bash
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Check this out!" --video ./clip.mp4          # 预览
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Amazing content" --video ./demo.mp4 --submit  # 发布
参数:
参数说明
<text>
推文内容(位置参数)
--video <path>
视频文件(支持MP4、MOV、WebM格式)
--submit
发布推文(默认:预览)
--profile <dir>
自定义Chrome配置文件
限制:普通用户最长140秒,Premium用户最长60分钟。处理时间:30-60秒。

Quote Tweets

引用推文

Quote an existing tweet with comment.
bash
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"          # Preview
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 "I agree!" --submit       # Post
Parameters:
ParameterDescription
<tweet-url>
URL to quote (positional)
<comment>
Comment text (positional, optional)
--submit
Post (default: preview)
--profile <dir>
Custom Chrome profile

引用现有推文并添加评论。
bash
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"          # 预览
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 "I agree!" --submit       # 发布
参数:
参数说明
<tweet-url>
要引用的推文链接(位置参数)
<comment>
评论文字(位置参数,可选)
--submit
发布推文(默认:预览)
--profile <dir>
自定义Chrome配置文件

X Articles

X长文

Long-form Markdown articles (requires X Premium).
bash
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md                        # Preview
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --cover ./cover.jpg    # With cover
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --submit               # Publish
Parameters:
ParameterDescription
<markdown>
Markdown file (positional)
--cover <path>
Cover image
--title <text>
Override title
--submit
Publish (default: preview)
Frontmatter:
title
,
cover_image
supported in YAML front matter.

Markdown格式长文(需X Premium订阅)。
bash
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md                        # 预览
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --cover ./cover.jpg    # 带封面图
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --submit               # 发布
参数:
参数说明
<markdown>
Markdown文件(位置参数)
--cover <path>
封面图片
--title <text>
自定义标题(覆盖原标题)
--submit
发布长文(默认:预览)
Frontmatter支持:YAML前置部分支持
title
cover_image
字段。

Notes

注意事项

  • First run: manual login required (session persists)
  • Always preview before
    --submit
  • Cross-platform: macOS, Linux, Windows
  • 首次运行:需手动登录X(会话将持久保存)
  • 发布前请务必先使用预览模式,再添加
    --submit
    参数
  • 跨平台支持:macOS、Linux、Windows

Extension Support

扩展支持

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
通过EXTEND.md进行自定义配置。请查看偏好设置部分获取路径和支持的选项。