# Send X CDP Automation to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "x-cdp",
    "name": "X CDP Automation",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/stwith/x-cdp",
    "canonicalUrl": "https://clawhub.ai/stwith/x-cdp",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/x-cdp",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=x-cdp",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/quote-tweet.js",
      "scripts/reply-tweet.js",
      "scripts/post-tweet.js",
      "scripts/setup.js",
      "scripts/post-article.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "x-cdp",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-11T05:36:10.858Z",
      "expiresAt": "2026-05-18T05:36:10.858Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=x-cdp",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=x-cdp",
        "contentDisposition": "attachment; filename=\"x-cdp-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "x-cdp"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/x-cdp"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/x-cdp",
    "downloadUrl": "https://openagent3.xyz/downloads/x-cdp",
    "agentUrl": "https://openagent3.xyz/skills/x-cdp/agent",
    "manifestUrl": "https://openagent3.xyz/skills/x-cdp/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/x-cdp/agent.md"
  }
}
```
## Documentation

### First-Time Setup

Run the setup wizard. It checks everything and auto-fixes what it can:

node scripts/setup.js [--port 18802] [--profile ~/chromium-profiles/x-cdp]

The wizard does 4 things:

Finds Chromium/Chrome on your system (or tells you how to install it)
Checks puppeteer-core (auto-installs to /tmp/node_modules if missing)
Launches Chromium with CDP enabled on the specified port
Verifies X login (tells you to log in manually if needed)

### Manual setup (if you prefer)

Install Chromium (recommended over Chrome for version stability):

# macOS
brew install --cask chromium

# Linux
sudo apt install chromium-browser

Install puppeteer-core:

cd /tmp && npm init -y && npm install puppeteer-core

Launch Chromium with CDP:

chromium --remote-debugging-port=18802 --user-data-dir=~/chromium-profiles/x-cdp --no-first-run

Log in to X: Open x.com in the Chromium window and log in once. The session persists in the profile directory.

### Why Chromium, not Chrome?

Chrome auto-updates silently. One update can change DOM selectors and break all automation overnight. Chromium lets you pin a known-good version. That said, Chrome works fine too if you don't mind occasional breakage.

### Architecture

All scripts connect to a running Chromium instance via CDP (Chrome DevTools Protocol).
This is not API-based. It drives the real browser UI, identical to a human clicking.

### Multi-account isolation

Each X account gets its own Chromium instance with a separate port and profile:

Port 18800, profile chromium-profiles/main: @your_main_account
Port 18801, profile chromium-profiles/second: @your_second_account
Port 18802, profile chromium-profiles/third: @your_third_account

Launch multiple instances for multi-account use. All scripts accept --port to target a specific account.

### Post a tweet

NODE_PATH=/tmp/node_modules node scripts/post-tweet.js "Hello world" [--image /path/to/img.png] [--port 18802] [--dry-run]

### Reply to a tweet

NODE_PATH=/tmp/node_modules node scripts/reply-tweet.js <tweet_url> "Nice post!" [--image /path/to/img.png] [--port 18802] [--dry-run]

### Quote retweet

NODE_PATH=/tmp/node_modules node scripts/quote-tweet.js <tweet_url> "My thoughts" [--port 18802] [--dry-run]

### Publish an article (X Premium)

NODE_PATH=/tmp/node_modules node scripts/post-article.js --title "Title" --body "Body text" [--body-file /path/to/content.md] [--cover /path/to/cover.jpg] [--port 18800] [--dry-run]

All scripts support --dry-run to fill content without sending. A screenshot is saved to /tmp/.

### Agent Integration

When the user asks to interact with X:

### Pre-flight check

Before running any script, verify the environment:

Check if Chromium is running on the target port: curl -s http://localhost:<port>/json/version
If not running, run node scripts/setup.js --port <port> to launch and configure
If setup fails, report the specific step that failed

### Compose flow

User provides intent (e.g., "reply to this tweet saying thanks")
Agent drafts the text, shows it to user for approval
On confirmation, run the script via exec
Report success/failure

### Error recovery

If a script fails with "not found" errors, X may have changed its DOM. Check and update:

references/selectors.md for the latest selectors
scripts/lib/cdp-utils.js SELECTORS object

### Risk Notes

Rate limiting: Space out actions. No more than ~10 tweets/hour.
Detection: CDP automation looks like real browser usage. Much harder to detect than API abuse.
Account safety: Human-like delays are built into all scripts. Avoid bulk operations.
vs API tools (bird etc.): API wrappers get DMCA'd or break on API changes. CDP works as long as the website works.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: stwith
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-11T05:36:10.858Z
- Expires at: 2026-05-18T05:36:10.858Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/x-cdp)
- [Send to Agent page](https://openagent3.xyz/skills/x-cdp/agent)
- [JSON manifest](https://openagent3.xyz/skills/x-cdp/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/x-cdp/agent.md)
- [Download page](https://openagent3.xyz/downloads/x-cdp)