baoyu-post-to-x

Posts text, images, videos, and Markdown articles to X via Chrome CDP automation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chhpt/skills --skill baoyu-post-to-x-chhpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-post-to-x
Source: https://github.com/chhpt/skills/tree/main/skills/baoyu-post-to-x
Command: npx skills add https://github.com/chhpt/skills --skill baoyu-post-to-x-chhpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires front-matter, highlight.js, marked, remark-cjk-friendly, remark-parse, remark-stringify, unified, and includes scripts (resource) and references (resource) components.

What problem does it solve? Posting content to X (Twitter) programmatically is blocked by anti-automation detection that rejects Playwright/Puppeteer and synthetic paste events. This Skill drives a real Chrome browser via the Chrome DevTools Protocol with a persistent login profile, letting you compose posts, videos, quote tweets, and long-form articles without fighting bot detection. ## Core Features & Use Cases - Regular Posts: Compose text posts with up to 4 images using real clipboard paste keystrokes that bypass synthetic-event detection. - Video & Quote Tweets: Attach MP4/MOV/WebM videos or quote an existing tweet URL with a comment. - X Articles: Convert Markdown (with frontmatter title/cover, images, and CJK-friendly formatting) into X's long-form article editor, inserting images at placeholder positions. - Use Case: Draft a blog post in Markdown, then run the article script to have Chrome open x.com/compose/articles with the title, cover image, formatted body, and inline images already filled in for your review. ## Quick Start Ask the agent to post "Hello from my skill" with the image ./photo.png to X, and it will open Chrome with the post composed for your review.

Frequently Asked Questions about baoyu-post-to-x

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I post to X (Twitter) from the command line?

Run the x-browser.ts script with Bun, passing your text and optional --image flags. It launches real Chrome with a persistent profile, fills the compose editor via CDP, and leaves the browser open so you can review and publish manually.

How to publish a Markdown article to X Articles?

Use the x-article.ts script with your Markdown file, optionally adding --cover and --title. It converts Markdown to HTML, uploads the cover, pastes the body into the DraftJS editor, and replaces image placeholders with actual images. X Premium is required.

Why use real Chrome instead of Playwright for X automation?

X detects and ignores synthetic input events from automation frameworks like Playwright and Puppeteer. This skill launches genuine Chrome with --disable-blink-features=AutomationControlled and sends real paste keystrokes via osascript or xdotool, which X accepts.

Does this X posting skill work on Linux and Windows?

Yes, it is cross-platform. macOS uses Swift/AppKit and osascript for clipboard and paste, Linux uses wl-copy/xclip plus xdotool or ydotool, and Windows uses PowerShell SendKeys. Chrome and the Bun runtime are required on all platforms.

Why does image pasting fail when posting to X?

Image paste usually fails because the terminal lacks Accessibility permission on macOS, or xdotool/ydotool is missing on Linux. Run the check-paste-permissions.ts script to diagnose Chrome, clipboard, and keystroke issues, then grant the indicated permissions.

What are the limitations of automated X posting with this approach?

Scripts only fill content into the browser; the user reviews and publishes manually unless --submit is passed. Regular videos are limited to 140 seconds without Premium, articles require X Premium, and the first run needs a manual login to save the session.