重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
canghe-post-to-x by freestylefly/canghe-skills
npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-post-to-x通过真实的 Chrome 浏览器发布文本、图片、视频和长篇文章到 X(绕过反机器人检测)。
重要提示:所有脚本都位于此技能的 scripts/ 子目录中。
代理执行指令:
SKILL_DIR${SKILL_DIR}/scripts/<脚本名称>.ts${SKILL_DIR} 替换为实际路径脚本参考:
| 脚本 | 用途 |
|---|---|
scripts/x-browser.ts | 常规发布(文本 + 图片) |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
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 | 验证环境与权限 |
使用 Bash 检查 EXTEND.md 是否存在(优先级顺序):
# 首先检查项目级别
test -f .canghe-skills/canghe-post-to-x/EXTEND.md && echo "project"
# 然后检查用户级别(跨平台:$HOME 在 macOS/Linux/WSL 上有效)
test -f "$HOME/.canghe-skills/canghe-post-to-x/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────┬───────────────────┐ │ 路径 │ 位置 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .canghe-skills/canghe-post-to-x/EXTEND.md │ 项目目录 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-post-to-x/EXTEND.md │ 用户主目录 │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ 操作 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 找到 │ 读取、解析、应用设置 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 未找到 │ 使用默认值 │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md 支持:默认 Chrome 配置文件
bun 运行时首次使用前,建议运行环境检查。用户可以选择跳过。
npx -y bun ${SKILL_DIR}/scripts/check-paste-permissions.ts
检查项:Chrome、配置文件隔离、Bun、辅助功能、剪贴板、粘贴按键、Chrome 冲突。
如果任何检查失败,请根据项目提供修复指导:
| 检查项 | 修复方法 |
|---|---|
| Chrome | 安装 Chrome 或设置 X_BROWSER_CHROME_PATH 环境变量 |
| 配置文件目录 | 确保 ~/.local/share/x-browser-profile 可写 |
| Bun 运行时 | `curl -fsSL https://bun.sh/install |
| 辅助功能 (macOS) | 系统设置 → 隐私与安全性 → 辅助功能 → 启用终端应用 |
| 剪贴板复制 | 确保 Swift/AppKit 可用(macOS Xcode CLI 工具:xcode-select --install) |
| 粘贴按键 (macOS) | 同上(辅助功能修复) |
| 粘贴按键 (Linux) | 安装 xdotool (X11) 或 ydotool (Wayland) |
references/regular-posts.md 了解手动工作流程、故障排除和技术细节references/articles.md 了解长篇文章发布指南文本 + 最多 4 张图片。
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png
参数:
| 参数 | 描述 |
|---|---|
<text> | 发布内容(位置参数) |
--image <path> | 图片文件(可重复,最多 4 个) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填入内容。用户需要手动审核并发布。
文本 + 视频文件。
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Check this out!" --video ./clip.mp4
参数:
| 参数 | 描述 |
|---|---|
<text> | 发布内容(位置参数) |
--video <path> | 视频文件(MP4, MOV, WebM) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填入内容。用户需要手动审核并发布。
限制:普通用户 140 秒最大,Premium 用户 60 分钟。处理时间:30-60 秒。
引用现有推文并添加评论。
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"
参数:
| 参数 | 描述 |
|---|---|
<tweet-url> | 要引用的推文 URL(位置参数) |
<comment> | 评论文本(位置参数,可选) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填入内容。用户需要手动审核并发布。
长篇幅 Markdown 文章(需要 X Premium)。
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
参数:
| 参数 | 描述 |
|---|---|
<markdown> | Markdown 文件(位置参数) |
--cover <path> | 封面图片 |
--title <text> | 覆盖标题 |
Frontmatter:支持 YAML front matter 中的 title、cover_image。
注意:脚本会打开浏览器并填入文章内容。用户需要手动审核并发布。
如果脚本因 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 进行自定义配置。请参阅偏好设置部分了解路径和支持的选项。
每周安装量
102
代码仓库
GitHub 星标数
182
首次出现
2026年2月24日
安全审计
安装于
github-copilot101
gemini-cli101
codex101
kimi-cli101
cursor101
opencode101
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 :
SKILL_DIR${SKILL_DIR}/scripts/<script-name>.ts${SKILL_DIR} in this document with the actual pathScript 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 | Copy content to clipboard |
scripts/paste-from-clipboard.ts | Send real paste keystroke |
scripts/check-paste-permissions.ts | Verify environment & permissions |
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .canghe-skills/canghe-post-to-x/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.canghe-skills/canghe-post-to-x/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .canghe-skills/canghe-post-to-x/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-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.
npx -y bun ${SKILL_DIR}/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 | Ensure ~/.local/share/x-browser-profile is writable |
| Bun runtime | `curl -fsSL https://bun.sh/install |
| 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 |
| Paste keystroke (Linux) | Install xdotool (X11) or (Wayland) |
references/regular-posts.md for manual workflow, troubleshooting, and technical detailsreferences/articles.md for long-form article publishing guideText + up to 4 images.
npx -y bun ${SKILL_DIR}/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.
npx -y bun ${SKILL_DIR}/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.
npx -y bun ${SKILL_DIR}/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).
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
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.
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
102
Repository
GitHub Stars
182
First Seen
Feb 24, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
github-copilot101
gemini-cli101
codex101
kimi-cli101
cursor101
opencode101
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
48,700 周安装
ydotool