Install
npx skillscat add secureskills-io/twitter-skill Install via the SkillsCat registry.
SKILL.md
twitter-skill ๐ฆ
Twitter/X CLI for OpenClaw agents with automatic cookie management.
Install
git clone https://github.com/SecureSkills-io/twitter-skill.git
cd twitter-skill && npm linkAuthentication
Option 1: Save cookies directly
twitter auth <auth_token> <ct0> [twid] [guest_id]Option 2: Save full cookie array (from browser export)
twitter auth --cookies-json '[{"name":"auth_token","value":"...",...}]'Option 3: Environment variables
export TWITTER_AUTH_TOKEN="your_auth_token"
export TWITTER_CT0="your_ct0"
export TWITTER_TWID="your_twid"Cookies are stored in ~/.config/twitter-skill/cookies.json with 600 permissions.
Commands
Post a Tweet
twitter post "Hello world!"
twitter tweet "Hello world!" # aliasPost a Thread
# Inline (split by ---)
twitter thread "First tweet---Second tweet---Third tweet"
# From file
twitter thread my-thread.txtFile format (my-thread.txt):
First tweet
---
Second tweet
---
Third tweetReply to a Tweet
twitter reply https://x.com/user/status/123456 "Great post!"Like a Tweet
twitter like https://x.com/user/status/123456Extract Fresh Cookies
After browser activity, extract updated cookies:
twitter extractThis updates ~/.config/twitter-skill/cookies.json with fresh session data.
Check Authentication
twitter whoamiHow It Works
- Cookie Injection: The skill injects stored cookies into a Playwright browser session
- Browser Automation: Performs actions (post, reply, like) via browser automation
- Cookie Extraction: After actions, extracts fresh cookies and saves them
- Session Persistence: Fresh cookies ensure the session stays valid
Security
- Cookies stored with 600 permissions (owner read/write only)
- No external API dependencies
- Uses existing browser session (CDP on port 18800)
- Respects X's rate limits with built-in delays
Requirements
- Node.js 18+
- Playwright browser running on CDP port 18800
- Valid X/Twitter session cookies
Trust Score
8.0/10 โ Medium risk
- Network: Basic โ X API calls
- Filesystem: Config only โ ~/.config/twitter-skill/
- Credentials: User-provided โ Cookie-based auth
- System: None โ Browser automation only
TL;DR: Save cookies once, post/extract/update automatically. ๐ฆ