/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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install baoyu-post-to-x-enhanced - After installation, invoke the skill by name or use
/baoyu-post-to-x-enhanced - Provide required inputs per the skill's parameter spec and get structured output
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 113 downloads so far.
How do I install Post to X Enhanced?
Run "/install baoyu-post-to-x-enhanced" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Post to X Enhanced free?
Yes, Post to X Enhanced is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Post to X Enhanced support?
Post to X Enhanced is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Post to X Enhanced?
It is built and maintained by praguepp (@praguepp); the current version is v3.0.0.