baoyu-post-to-x by jimliu/baoyu-skills
npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-post-to-x通过真实的 Chrome 浏览器发布文本、图片、视频和长篇文章到 X(绕过反机器人检测)。
重要提示:所有脚本都位于此技能的 scripts/ 子目录中。
智能体执行指令:
{baseDir}{baseDir}/scripts/<script-name>.ts{baseDir} 替换为实际路径${BUN_X} 运行时:如果已安装 bun → bun;如果 npx 可用 → ;否则建议安装 bun广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx -y bun脚本参考:
| 脚本 | 用途 |
|---|---|
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 | 发送真实的粘贴按键 |
scripts/check-paste-permissions.ts | 验证环境与权限 |
检查 EXTEND.md 是否存在(优先级顺序):
# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "user"
# PowerShell (Windows)
if (Test-Path .baoyu-skills/baoyu-post-to-x/EXTEND.md) { "project" }
$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { "$HOME/.config" }
if (Test-Path "$xdg/baoyu-skills/baoyu-post-to-x/EXTEND.md") { "xdg" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md") { "user" }
┌──────────────────────────────────────────────────┬───────────────────┐ │ 路径 │ 位置 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-post-to-x/EXTEND.md │ 项目目录 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md │ 用户主目录 │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ 操作 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 找到 │ 读取、解析、应用设置 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 未找到 │ 使用默认值 │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md 支持:默认 Chrome 配置文件
bun 运行时首次使用前,建议运行环境检查。如果用户愿意,可以跳过。
${BUN_X} {baseDir}/scripts/check-paste-permissions.ts
检查项目:Chrome、配置文件隔离、Bun、辅助功能、剪贴板、粘贴按键、Chrome 冲突。
如果任何检查失败,根据项目提供修复指导:
| 检查项 | 修复方法 |
|---|---|
| Chrome | 安装 Chrome 或设置 X_BROWSER_CHROME_PATH 环境变量 |
| 配置文件目录 | 共享配置文件位于 baoyu-skills/chrome-profile(参见 CLAUDE.md Chrome 配置文件部分) |
| Bun 运行时 | brew install oven-sh/bun/bun (macOS) 或 npm install -g bun |
| 辅助功能 (macOS) | 系统设置 → 隐私与安全性 → 辅助功能 → 启用终端应用 |
| 剪贴板复制 | 确保 Swift/AppKit 可用(macOS Xcode CLI 工具:xcode-select --install) |
| 粘贴按键 (macOS) | 同上(辅助功能修复) |
| 粘贴按键 (Linux) | 安装 xdotool (X11) 或 ydotool (Wayland) |
references/regular-posts.md 了解手动工作流程、故障排除和技术细节references/articles.md 了解长篇文章发布指南除非用户明确指定帖子类型:
${BUN_X} {baseDir}/scripts/x-browser.ts "Hello!" --image ./photo.png
参数:
| 参数 | 描述 |
|---|---|
<text> | 帖子内容(位置参数) |
--image <path> | 图片文件(可重复,最多 4 个) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填充内容。用户需要手动审核并发布。
文本 + 视频文件。
${BUN_X} {baseDir}/scripts/x-video.ts "Check this out!" --video ./clip.mp4
参数:
| 参数 | 描述 |
|---|---|
<text> | 帖子内容(位置参数) |
--video <path> | 视频文件(MP4, MOV, WebM) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填充内容。用户需要手动审核并发布。
限制:常规用户最长 140 秒,Premium 用户最长 60 分钟。处理时间:30-60 秒。
引用现有推文并添加评论。
${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"
参数:
| 参数 | 描述 |
|---|---|
<tweet-url> | 要引用的推文 URL(位置参数) |
<comment> | 评论文本(位置参数,可选) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填充内容。用户需要手动审核并发布。
长格式 Markdown 文章(需要 X Premium)。
${BUN_X} {baseDir}/scripts/x-article.ts article.md
${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg
参数:
| 参数 | 描述 |
|---|---|
<markdown> | Markdown 文件(位置参数) |
--cover <path> | 封面图片 |
--title <text> | 覆盖标题 |
Frontmatter:YAML front matter 支持 title、cover_image。
注意:脚本会打开浏览器并填充文章内容。用户需要手动审核并发布。
发布后组合检查:脚本在所有图片插入后会自动验证:
XIMGPH_ 占位符如果检查失败(输出中有警告),在用户发布前提醒他们具体问题。
如果脚本因 Chrome debug port not ready 或 Unable to connect 失败,请先终止现有的 Chrome CDP 实例,然后重试:
pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2
重要提示:这应该自动完成——当遇到此错误时,终止 Chrome CDP 实例并重试命令,无需询问用户。
通过 EXTEND.md 进行自定义配置。有关路径和支持的选项,请参见 偏好设置 部分。
每周安装量
12.2K
仓库
GitHub 星标
11.6K
首次出现
Jan 19, 2026
安全审计
安装于
opencode11.2K
gemini-cli10.8K
codex10.7K
github-copilot9.9K
cursor9.7K
amp9.6K
Posts text, images, videos, and long-form articles to X via real Chrome browser (bypasses anti-bot detection).
Important : All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions :
{baseDir}{baseDir}/scripts/<script-name>.ts{baseDir} in this document with the actual path${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bunScript Reference :
| Script | Purpose |
|---|---|
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 |
Check EXTEND.md existence (priority order):
# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "user"
# PowerShell (Windows)
if (Test-Path .baoyu-skills/baoyu-post-to-x/EXTEND.md) { "project" }
$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { "$HOME/.config" }
if (Test-Path "$xdg/baoyu-skills/baoyu-post-to-x/EXTEND.md") { "xdg" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md") { "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
bun runtimeBefore first use, suggest running the environment check. User can skip if they prefer.
${BUN_X} {baseDir}/scripts/check-paste-permissions.ts
Checks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.
If any check fails , provide fix guidance per item:
| Check | Fix |
|---|---|
| Chrome | Install Chrome or set X_BROWSER_CHROME_PATH env var |
| Profile dir | Shared profile at baoyu-skills/chrome-profile (see CLAUDE.md Chrome Profile section) |
| Bun runtime | brew install oven-sh/bun/bun (macOS) or npm install -g bun |
| Accessibility (macOS) | System Settings → Privacy & Security → Accessibility → enable terminal app |
| Clipboard copy | Ensure Swift/AppKit available (macOS Xcode CLI tools: xcode-select --install) |
| Paste keystroke (macOS) | Same as Accessibility fix above |
references/regular-posts.md for manual workflow, troubleshooting, and technical detailsreferences/articles.md for long-form article publishing guideUnless the user explicitly specifies the post type:
${BUN_X} {baseDir}/scripts/x-browser.ts "Hello!" --image ./photo.png
Parameters :
| Parameter | Description |
|---|---|
<text> | Post content (positional) |
--image <path> | Image file (repeatable, max 4) |
--profile <dir> | Custom Chrome profile |
Note : Script opens browser with content filled in. User reviews and publishes manually.
Text + video file.
${BUN_X} {baseDir}/scripts/x-video.ts "Check this out!" --video ./clip.mp4
Parameters :
| Parameter | Description |
|---|---|
<text> | Post content (positional) |
--video <path> | Video file (MP4, MOV, WebM) |
--profile <dir> | Custom Chrome profile |
Note : Script opens browser with content filled in. User reviews and publishes manually.
Limits : Regular 140s max, Premium 60min. Processing: 30-60s.
Quote an existing tweet with comment.
${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"
Parameters :
| Parameter | Description |
|---|---|
<tweet-url> | URL to quote (positional) |
<comment> | Comment text (positional, optional) |
--profile <dir> | Custom Chrome profile |
Note : Script opens browser with content filled in. User reviews and publishes manually.
Long-form Markdown articles (requires X Premium).
${BUN_X} {baseDir}/scripts/x-article.ts article.md
${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg
Parameters :
| Parameter | Description |
|---|---|
<markdown> | Markdown file (positional) |
--cover <path> | Cover image |
--title <text> | Override title |
Frontmatter : title, cover_image supported in YAML front matter.
Note : Script opens browser with article filled in. User reviews and publishes manually.
Post-Composition Check : The script automatically verifies after all images are inserted:
XIMGPH_ placeholders in editor contentIf the check fails (warnings in output), alert the user with the specific issues before they publish.
If a script fails with Chrome debug port not ready or Unable to connect, kill existing Chrome CDP instances first, then retry:
pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2
Important : This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Weekly Installs
12.2K
Repository
GitHub Stars
11.6K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode11.2K
gemini-cli10.8K
codex10.7K
github-copilot9.9K
cursor9.7K
amp9.6K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
AI智能体长期记忆系统 - 精英级架构,融合6种方法,永不丢失上下文
1,200 周安装
AI新闻播客制作技能:实时新闻转对话式播客脚本与音频生成
1,200 周安装
Word文档处理器:DOCX创建、编辑、分析与修订痕迹处理全指南 | 自动化办公解决方案
1,200 周安装
React Router 框架模式指南:全栈开发、文件路由、数据加载与渲染策略
1,200 周安装
Nano Banana AI 图像生成工具:使用 Gemini 3 Pro 生成与编辑高分辨率图像
1,200 周安装
SVG Logo Designer - AI 驱动的专业矢量标识设计工具,生成可缩放品牌标识
1,200 周安装
| Copy content to clipboard |
scripts/paste-from-clipboard.ts | Send real paste keystroke |
scripts/check-paste-permissions.ts | Verify environment & permissions |
| Paste keystroke (Linux) | Install xdotool (X11) or ydotool (Wayland) |