/install baoyu-post-to-x-enhanced
\r \r
Post to X (Twitter)\r
\r Posts text, images, videos, and long-form articles to X via real Chrome browser (bypasses anti-bot detection).\r \r
Script Directory\r
\r
Important: All scripts are located in the scripts/ subdirectory of this skill.\r
\r
Agent Execution Instructions:\r
- Determine this SKILL.md file's directory path as
{baseDir}\r - Script path =
{baseDir}/scripts/\x3Cscript-name>.ts\r - Replace all
{baseDir}in this document with the actual path\r - Resolve
${BUN_X}runtime: ifbuninstalled →bun; ifnpxavailable →npx -y bun; else suggest installing bun\r \r Script Reference:\r | Script | Purpose |\r |--------|---------|\r |scripts/x-browser.ts| Regular posts (text + images) |\r |scripts/x-video.ts| Video posts (text + video) |\r |scripts/x-quote.ts| Quote tweet with comment |\r |scripts/x-article.ts| Long-form article publishing (Markdown) |\r |scripts/md-to-html.ts| Markdown → HTML conversion |\r |scripts/copy-to-clipboard.ts| Copy content to clipboard |\r |scripts/paste-from-clipboard.ts| Send real paste keystroke |\r |scripts/check-paste-permissions.ts| Verify environment & permissions |\r \r
Preferences (EXTEND.md)\r
\r Check EXTEND.md existence (priority order):\r \r
# macOS, Linux, WSL, Git Bash\r
test -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo "project"\r
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "xdg"\r
test -f "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "user"\r
```\r
\r
```powershell\r
# PowerShell (Windows)\r
if (Test-Path .baoyu-skills/baoyu-post-to-x/EXTEND.md) { "project" }\r
$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { "$HOME/.config" }\r
if (Test-Path "$xdg/baoyu-skills/baoyu-post-to-x/EXTEND.md") { "xdg" }\r
if (Test-Path "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md") { "user" }\r
```\r
\r
┌──────────────────────────────────────────────────┬───────────────────┐\r
│ Path │ Location │\r
├──────────────────────────────────────────────────┼───────────────────┤\r
│ .baoyu-skills/baoyu-post-to-x/EXTEND.md │ Project directory │\r
├──────────────────────────────────────────────────┼───────────────────┤\r
│ $HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md │ User home │\r
└──────────────────────────────────────────────────┴───────────────────┘\r
\r
┌───────────┬───────────────────────────────────────────────────────────────────────────┐\r
│ Result │ Action │\r
├───────────┼───────────────────────────────────────────────────────────────────────────┤\r
│ Found │ Read, parse, apply settings │\r
├───────────┼───────────────────────────────────────────────────────────────────────────┤\r
│ Not found │ Use defaults │\r
└───────────┴───────────────────────────────────────────────────────────────────────────┘\r
\r
**EXTEND.md Supports**: Default Chrome profile\r
\r
## Prerequisites\r
\r
- Google Chrome or Chromium\r
- `bun` runtime\r
- First run: log in to X manually (session saved)\r
\r
## Pre-flight Check (Optional)\r
\r
Before first use, suggest running the environment check. User can skip if they prefer.\r
\r
```bash\r
${BUN_X} {baseDir}/scripts/check-paste-permissions.ts\r
```\r
\r
Checks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.\r
\r
**If any check fails**, provide fix guidance per item:\r
\r
| Check | Fix |\r
|-------|-----|\r
| Chrome | Install Chrome or set `X_BROWSER_CHROME_PATH` env var |\r
| Profile dir | Shared profile at `baoyu-skills/chrome-profile` (see CLAUDE.md Chrome Profile section) |\r
| Bun runtime | `brew install oven-sh/bun/bun` (macOS) or `npm install -g bun` |\r
| Accessibility (macOS) | System Settings → Privacy & Security → Accessibility → enable terminal app |\r
| Clipboard copy | Ensure Swift/AppKit available (macOS Xcode CLI tools: `xcode-select --install`) |\r
| Paste keystroke (macOS) | Same as Accessibility fix above |\r
| Paste keystroke (Linux) | Install `xdotool` (X11) or `ydotool` (Wayland) |\r
\r
## References\r
\r
- **Regular Posts**: See `references/regular-posts.md` for manual workflow, troubleshooting, and technical details\r
- **X Articles**: See `references/articles.md` for long-form article publishing guide\r
\r
---\r
\r
## Post Type Selection\r
\r
Unless the user explicitly specifies the post type:\r
- **Plain text** + within 10,000 characters → **Regular Post** (Premium members support up to 10,000 characters, non-Premium: 280)\r
- **Markdown file** (.md) → **X Article**\r
\r
## Regular Posts\r
\r
```bash\r
${BUN_X} {baseDir}/scripts/x-browser.ts "Hello!" --image ./photo.png\r
```\r
\r
**Parameters**:\r
| Parameter | Description |\r
|-----------|-------------|\r
| `\x3Ctext>` | Post content (positional) |\r
| `--image \x3Cpath>` | Image file (repeatable, max 4) |\r
| `--profile \x3Cdir>` | Custom Chrome profile |\r
\r
**Note**: Script opens browser with content filled in. User reviews and publishes manually.\r
\r
---\r
\r
## Video Posts\r
\r
Text + video file.\r
\r
```bash\r
${BUN_X} {baseDir}/scripts/x-video.ts "Check this out!" --video ./clip.mp4\r
```\r
\r
**Parameters**:\r
| Parameter | Description |\r
|-----------|-------------|\r
| `\x3Ctext>` | Post content (positional) |\r
| `--video \x3Cpath>` | Video file (MP4, MOV, WebM) |\r
| `--profile \x3Cdir>` | Custom Chrome profile |\r
\r
**Note**: Script opens browser with content filled in. User reviews and publishes manually.\r
\r
**Limits**: Regular 140s max, Premium 60min. Processing: 30-60s.\r
\r
---\r
\r
## Quote Tweets\r
\r
Quote an existing tweet with comment.\r
\r
```bash\r
${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"\r
```\r
\r
**Parameters**:\r
| Parameter | Description |\r
|-----------|-------------|\r
| `\x3Ctweet-url>` | URL to quote (positional) |\r
| `\x3Ccomment>` | Comment text (positional, optional) |\r
| `--profile \x3Cdir>` | Custom Chrome profile |\r
\r
**Note**: Script opens browser with content filled in. User reviews and publishes manually.\r
\r
---\r
\r
## X Articles\r
\r
Long-form Markdown articles (requires X Premium).\r
\r
```bash\r
${BUN_X} {baseDir}/scripts/x-article.ts article.md\r
${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\r
```\r
\r
**Parameters**:\r
| Parameter | Description |\r
|-----------|-------------|\r
| `\x3Cmarkdown>` | Markdown file (positional) |\r
| `--cover \x3Cpath>` | Cover image |\r
| `--title \x3Ctext>` | Override title |\r
\r
**Frontmatter**: `title`, `cover_image` supported in YAML front matter.\r
\r
**Note**: Script opens browser with article filled in. User reviews and publishes manually.\r
\r
**Post-Composition Check**: The script automatically verifies after all images are inserted:\r
- Remaining `XIMGPH_` placeholders in editor content\r
- Expected vs actual image count\r
\r
If the check fails (warnings in output), alert the user with the specific issues before they publish.\r
\r
---\r
\r
## Troubleshooting\r
\r
### Chrome debug port not ready\r
\r
If a script fails with `Chrome debug port not ready` or `Unable to connect`, kill existing Chrome CDP instances first, then retry:\r
\r
```bash\r
pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2\r
```\r
\r
**Important**: This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.\r
\r
## Notes\r
\r
- First run: manual login required (session persists)\r
- All scripts only fill content into the browser, user must review and publish manually\r
- Cross-platform: macOS, Linux, Windows\r
\r
## Extension Support\r
\r
Custom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install baoyu-post-to-x-enhanced - 安装完成后,直接呼叫该 Skill 的名称或使用
/baoyu-post-to-x-enhanced触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Post to X Enhanced 是什么?
Posts content and articles to X (Twitter). Custom fork with image upload fix: DOM.setFileInputFiles first, path leak cleanup, post-publish verification. Use... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 113 次。
如何安装 Post to X Enhanced?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install baoyu-post-to-x-enhanced」即可一键安装,无需额外配置。
Post to X Enhanced 是免费的吗?
是的,Post to X Enhanced 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Post to X Enhanced 支持哪些平台?
Post to X Enhanced 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Post to X Enhanced?
由 praguepp(@praguepp)开发并维护,当前版本 v3.0.0。