# Xitter

Post, read, and search X (Twitter) content using x-cli or the X API v2

- Repository: https://github.com/taracodlabs/aiden (868 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-19
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add taracodlabs/aiden --skill xitter -g -a claude-code -y`
Codex: `npx skills add taracodlabs/aiden --skill xitter -g -a codex -y`
Cursor: `npx skills add taracodlabs/aiden --skill xitter -g -a cursor -y`
Gemini CLI: `npx skills add taracodlabs/aiden --skill xitter -g -a gemini-cli -y`

## Description

Post, read, and search X (Twitter) content using x-cli or the X API v2

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# X (Twitter) Automation

Read, post, and search X content using the `x-cli` command-line tool or the X API v2 directly. Requires X API credentials.

## When to Use

- User wants to post a tweet or thread on X
- User wants to search for recent tweets on a topic
- User wants to read their home timeline or mentions
- User wants to fetch tweets from a specific account
- User wants to schedule or automate social media posts

## How to Use

### 1. Set up X API credentials

Register at https://developer.twitter.com → Create Project → Create App. Get:
- `API_KEY`, `API_SECRET`
- `ACCESS_TOKEN`, `ACCESS_TOKEN_SECRET`
- `BEARER_TOKEN` (for read-only app-only auth)

```powershell
$env:X_BEARER_TOKEN      = "your_bearer_token"
$env:X_API_KEY           = "your_api_key"
$env:X_API_SECRET        = "your_api_secret"
$env:X_ACCESS_TOKEN      = "your_access_token"
$env:X_ACCESS_SECRET     = "your_access_secret"
```

### 2. Search recent tweets (Bearer Token, no user auth needed)

```python
import requests, os

def search_tweets(query, max_results=10):
  headers = {"Authorization": f"Bearer {os.environ['X_BEARER_TOKEN']}"}
  params  = {
    "query":        f"{query} -is:retweet lang:en",
    "max_results":  max_results,
    "tweet.fields": "created_at,author_id,public_metrics"
  }
  resp = requests.get("https://api.twitter.com/2/tweets/search/recent", headers=headers, params=params)
  resp.raise_for_status()
  for tweet in resp.json().get("data", []):
    print(f"• {tweet['text'][:120]}")
    print(f"  {tweet['created_at']}  likes={tweet['public_metrics']['like_count']}\n")

search_tweets("Aiden AI agent 2026", max_results=5)
```

### 3. Post a tweet (OAuth 1.0a)

```python
import requests, os, time, hashlib, hmac, base64, urllib.parse, uuid

def post_tweet(text):
  url    = "https://api.twitter.com/2/tweets"
  params = {"text": text}

The rest: https://github.com/taracodlabs/aiden/blob/HEAD/skills/xitter/SKILL.md
