Overview
twitter-cli ships with aSKILL.md file that teaches AI agents how to use the CLI for common Twitter/X workflows. This enables agents to read timelines, search tweets, fetch user data, and post content autonomously.
What is a Skill?
A skill is a structured markdown file that provides:- Command reference and examples
- Authentication setup instructions
- Common patterns and workflows
- Error handling guidance
- Safety notes for rate limiting and anti-detection
Installation
Claude Code / Antigravity
Clone the entire repository into your project’s.agents/skills directory:
SKILL.md file:
.agents/skills/*/SKILL.md.
OpenClaw / ClawHub
Install via ClawHub package manager:twitter-cli commands directly based on the skill instructions.
Other AI Agents
For custom AI agents or frameworks:-
Download the skill file:
- Include it in your agent’s context or prompt directory
- Configure your agent to reference the skill when the user mentions Twitter/X tasks
Skill Contents
TheSKILL.md file includes:
Metadata
Command Reference
Complete examples for:- Feed (For You / Following timelines)
- Bookmarks
- Search (Top / Latest / Photos / Videos)
- Tweet detail
- List timeline
- User profiles and posts
- Write operations (post, like, retweet, bookmark)
Authentication Guidance
- Browser cookie extraction (recommended)
- Environment variable setup
- Error handling for expired cookies
JSON / Scripting Patterns
Ranking Filter
Documentation on the optional--filter flag and scoring formula.
Common Patterns for AI Agents
Error Handling
No Twitter cookies found- login to x.com in a supported browserCookie expired or invalid (HTTP 401/403)- re-login and retryTwitter API error 404- queryId rotation, retry the command
Safety Notes
- Write operations have built-in delays (1.5-4s)
- TLS fingerprint and User-Agent are automatically matched
- Never share raw cookie values in chat logs
- Prefer browser cookie extraction over manual entry
- If auth fails, ask user to re-login to x.com
Agent Workflows
Example 1: Research Workflow
User prompt:“Research what AI researchers are saying about Claude Code”Agent execution:
Example 2: User Analysis
User prompt:“Analyze @elonmusk’s recent tweets and find the most engaging ones”Agent execution:
Example 3: Content Monitoring
User prompt:“Monitor mentions of our product and save high-engagement tweets”Agent execution:
Example 4: Automated Posting
User prompt:“Post a thread about today’s product updates”Agent execution:
Prerequisites
The skill assumes twitter-cli is already installed. Agents should verify installation:Security Considerations
- Cookie Safety: The skill instructs agents to never ask users to share raw cookie values in chat logs
- Browser Extraction: Agents should prefer automatic browser cookie extraction over manual entry
- Proxy Awareness: Agents should respect
TWITTER_PROXYenvironment variable if set - Rate Limiting: Agents should use
--maxflags conservatively to avoid rate limits - Write Delays: The skill notes that write operations automatically include 1.5-4s delays
Updating the Skill
To update to the latest skill version:Skill Development
If you want to customize the skill for your team:- Fork the repository
- Edit
SKILL.mdto add team-specific workflows - Point your agents to your custom skill location
