Skip to main content

Overview

The /x-integration skill adds X (formerly Twitter) capabilities to NanoClaw Pro through browser automation. Post tweets, like, reply, retweet, and quote tweets directly from your messaging channels.
Currently supports WhatsApp channel. Browser automation runs in the agent container.

Features

ActionToolDescription
Postx_postPublish new tweets
Likex_likeLike any tweet
Replyx_replyReply to tweets
Retweetx_retweetRetweet without comment
Quotex_quoteQuote tweet with comment

Prerequisites

1

Install dependencies

npm install playwright dotenv-cli
2

Configure Chrome path (if needed)

If Chrome is not at the default location, add to .env:
# Find Chrome path on macOS
mdfind "kMDItemCFBundleIdentifier == 'com.google.Chrome'" | head -1

# Add to .env
CHROME_PATH=/path/to/Google Chrome.app/Contents/MacOS/Google Chrome

How to Apply

1

Setup authentication

Run the interactive authentication script:
npx dotenv -e .env -- npx tsx .claude/skills/x-integration/scripts/setup.ts
This opens Chrome for X login and saves credentials to data/x-auth.json.
2

Rebuild container

./container/build.sh
Verify output shows:
COPY .claude/skills/x-integration/agent.ts
3

Restart service

npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw

What Changes

Files Added

  • .claude/skills/x-integration/agent.ts - X automation tools
  • .claude/skills/x-integration/scripts/setup.ts - Authentication setup
  • data/x-auth.json - Saved authentication (gitignored)

Files Modified

  • container/Dockerfile - Copies X integration skill
  • container/agent-runner/src/index.ts - Registers X tools

Usage

Post a Tweet

@Andy post to X: Just set up NanoClaw Pro with X integration!

Like a Tweet

@Andy like this tweet: https://x.com/username/status/123456789

Reply to a Tweet

@Andy reply to https://x.com/username/status/123 with: Great point!

Quote Tweet

@Andy quote this tweet with my thoughts: https://x.com/username/status/123

Configuration

Environment Variables

  • CHROME_PATH - Path to Chrome binary (optional, auto-detected on macOS)
  • X_AUTH_FILE - Path to auth file (default: data/x-auth.json)

Authentication

Authentication is saved to data/x-auth.json and includes:
  • Session cookies
  • CSRF tokens
  • User metadata
Keep data/x-auth.json secure. Add it to .gitignore (already included).

Troubleshooting

X sessions expire after ~30 days. Re-run setup:
npx dotenv -e .env -- npx tsx .claude/skills/x-integration/scripts/setup.ts
Set CHROME_PATH in .env:
# macOS
CHROME_PATH=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome

# Linux
CHROME_PATH=/usr/bin/google-chrome
X may rate-limit automated actions. The skill includes:
  • Automatic retry with exponential backoff
  • Realistic delays between actions
  • User-agent rotation

WhatsApp Channel

Setup WhatsApp for X integration

Container Isolation

How browser automation is sandboxed

Build docs developers (and LLMs) love