x-composer
X Composer
Post to X.com via browser automation. No API key required.
Mode Priority
- Playwright MCP (recommended) — Headless, most reliable, supports image upload
- CDP mode — Auto-scans ports 9222-9230 for Chrome CDP
- Clipboard fallback — Copies to clipboard and pastes via AppleScript
Playwright MCP Mode (Recommended)
Use Playwright MCP tools directly. Handles text, images, and posting without visible browser.
Post with text only
1. browser_navigate → https://x.com/compose/post
2. browser_snapshot → find textbox ref
3. browser_run_code → force click textbox, keyboard.type(content, {delay: 10})
4. browser_take_screenshot → verify draft
5. Ask user confirmation
6. browser_run_code → page.locator('[data-testid="tweetButton"]').dispatchEvent('click')
Post with image
1. Type content (same as above)
2. browser_run_code → page.locator('input[type="file"][accept*="image"]').first().setInputFiles('/path/to/image.png')
3. browser_take_screenshot → verify image attached
4. Post after confirmation
Key notes
- X.com has an overlay that blocks normal clicks — always use
{ force: true }ordispatchEvent('click') - To clear text:
Cmd+AthenBackspaceviapage.keyboard - Login persists in Playwright session — if not logged in, user must log in once manually
fill()can cause duplicate text — preferkeyboard.type()with delay
CDP Mode (Fallback)
Quick Post
bash scripts/x-post.sh "Your post content here"
CDP Auto Port Detection
- Scans ports 9222-9230 for existing Chrome CDP (verifies it's Chrome, not Electron apps)
- Finds first available port to launch new Chrome instance
- Saves active port to
~/.chrome-cdp-port
Individual Scripts
# Open compose page
NODE_PATH=$(npm root -g) node scripts/cdp-launch.js [URL]
# Type text
echo '[{"text":"Hello"},{"enter":true},{"text":"World"}]' | NODE_PATH=$(npm root -g) node scripts/cdp-type.js
Clipboard Fallback
If CDP is unavailable (Chrome already running without debugging):
- Copies text to clipboard via
pbcopy - Focuses Chrome via AppleScript
- Pastes via Cmd+V
Prerequisites
- Playwright MCP:
playwrightMCP server configured - CDP mode:
npm install -g chrome-remote-interface
Rules
- NEVER auto-post — always show draft and ask user for confirmation
- If X.com requires login, inform user to log in manually
- Take screenshot to verify content before posting
- For image posts, verify image is attached before posting
Troubleshooting
| Issue | Fix |
|---|---|
| Overlay blocks clicks | Use { force: true } or dispatchEvent('click') |
fill() duplicates text |
Use keyboard.type() with { delay: 10 } instead |
| Port 9222 occupied | Auto-handled — scans 9222-9230 |
| Not logged in | User must log in manually once, session persists |
More from junghoonghae/skills
openkakao-cli
Work with OpenKakao CLI (`openkakao-rs`) for KakaoTalk on macOS. Use whenever the user asks to authenticate, inspect chats, read messages, send messages, watch real-time traffic, automate from chat data, build hooks or webhooks, verify webhook signing, manage tokens, inspect auth recovery state, search cached messages, view chat analytics/stats, or operate unattended KakaoTalk workflows from the terminal. This should also trigger when the user mentions `watch`, `hook`, `webhook`, `LOCO`, `chat_id`, `auth-status`, `doctor`, `launchd`, `cache`, `stats`, `analytics`, `local-chats`, `local-read`, `local-search`, `dry-run`, `allow_loco_write`, or wants to wire OpenKakao into local scripts, agents, SQLite, cron, or launchd.
28ships-with-steipete
IMPERSONATE steipete (Peter Steinberger) to coach on project ideas, tech decisions, and shipping strategy. Trigger when user: (1) describes an idea/project and wants steipete's feedback, (2) asks 'what would steipete think about X', (3) needs help choosing between CLI/MCP/UI approach, (4) wants advice on shipping faster or simplifying, (5) asks about AI coding workflow, agent setup, or model selection, (6) mentions steipete by name, (7) wants to validate a startup/side-project idea. Responds IN CHARACTER as steipete - direct, opinionated, challenges assumptions, asks 'would YOU use this?'. Based on 168 GitHub repos and 107 blog posts (2012-2026).
17discord-admin-py
Discord server administration via inference.sh - Multi-function app for channel, role, member management, messages, and more. Use for Discord bot operations, server management, channel creation, role assignment, and message handling.
16readme-doctor
README diagnosis and treatment. Diagnoses README problems, analyzes reference styles, and prescribes improvements. Use for "fix my README", "analyze this README", "make README like [reference]", "create README based on my GitHub style", or when user provides reference URLs/files for README guidance.
14oh-my-lilys
CLI tool for lilys.ai - Summarize YouTube, PDF, websites, and audio. Manage sessions, generate reports, search, export, and organize collections directly from the terminal. Use when user wants to summarize content from URLs, list/search/delete sessions, generate or fetch AI reports with note types, export reports as PDF or Markdown, manage collections, share sessions publicly, check usage/quota, chat with AI about sessions, extract video thumbnails, translate reports, or authenticate with lilys.ai. Triggers: summarize URL, generate report, get sessions, lilys, YouTube summary, search sessions, export PDF, collections, chat, thumbnail, translate.
14capx
>
7