X (Twitter) integration for Gandalf. Post tweets, like, reply, retweet, and quote. Use for setup, testing, or troubleshooting X functionality. Triggers on "setup x", "x integration", "twitter", "post tweet", "tweet".
X (Twitter) integration for Gandalf. Post tweets, like, reply, retweet, and quote. Use for setup, testing, or troubleshooting X functionality. Triggers on "setup x", "x integration", "twitter", "post tweet", "tweet".
X (Twitter) Integration
Browser automation for X interactions via WhatsApp.
Compatibility: Gandalf v1.0.0. Directory structure may change in future versions.
Features
Action
Tool
Description
Post
x_post
Publish new tweets
Like
x_like
Like any tweet
Reply
x_reply
Reply to tweets
Retweet
x_retweet
Retweet without comment
Quote
x_quote
Quote tweet with comment
Prerequisites
Before using this skill, ensure:
Gandalf is installed and running - WhatsApp connected, service active
Dependencies installed:
bun pm ls playwright dotenv-cli || bun add playwright dotenv-cli
CHROME_PATH configured in .env (if Chrome is not at default location):
This opens Chrome for manual X login. Session saved to data/x-browser-profile/.
Verify success:
cat data/x-auth.json # Should show {"authenticated": true, ...}
3. Restart Service
bun run build
launchctl kickstart -k gui/$(id -u)/com.gandalf
Verify success:
launchctl list | grep gandalf # Should show PID and exit code 0 or -
Usage via WhatsApp
No trigger prefix is required. Send plain messages like:
post a tweet: Hello world!
like this tweet https://x.com/user/status/123
reply to https://x.com/user/status/123 with: Great post!
retweet https://x.com/user/status/123
quote https://x.com/user/status/123 with comment: Interesting
Note: Only the main group can use X tools. Other groups will receive an error.
Testing
Scripts require environment variables from .env. Use dotenv-cli to load them:
Check Authentication Status
# Check if auth file exists and is validcat data/x-auth.json 2>/dev/null && echo"Auth configured" || echo"Auth not configured"# Check if browser profile existsls -la data/x-browser-profile/ 2>/dev/null | head -5