OpenClaw X/Twitter skill — full-featured CLI for X API v2
Project description
openclaw-x
Full-featured CLI and OpenClaw skill for X/Twitter API v2.
Features
- Tweet operations: post, get, delete, reply, quote, search, metrics
- Media upload: JPG, PNG, WEBP, GIF, MP4 via chunked upload (no tweepy)
- Threads: create, continue, name, and track threaded conversations
- User operations: lookup, timeline, followers, following
- Engagement: like, retweet, bookmark
- Self operations: mentions, bookmarks
- History: local tracking of all posted tweets and threads
- Multiple output formats: JSON, human-readable (rich), TSV, Markdown
- OpenClaw integration: ready-to-use skill definition and agent templates
Installation
# With uv (recommended)
uv tool install openclaw-x
# With pip
pip install openclaw-x
Configuration
Set your X API credentials. Get them at developer.x.com.
mkdir -p ~/.config/openclaw-x
cat > ~/.config/openclaw-x/.env << 'EOF'
X_API_KEY=your_api_key
X_API_SECRET=your_api_secret
X_ACCESS_TOKEN=your_access_token
X_ACCESS_TOKEN_SECRET=your_access_token_secret
X_BEARER_TOKEN=your_bearer_token
EOF
Or set environment variables directly / use a .env file in your working directory.
Usage
# Post a tweet
openclaw-x tweet post "Hello from openclaw-x!"
# Post with media
openclaw-x tweet post "Check this out" --media /path/to/image.jpg
# Search tweets (JSON output)
openclaw-x -j tweet search "AI agents" --max 20
# Post a thread
openclaw-x thread post "First tweet" "Second tweet" "Third tweet" --name my-thread
# Continue the thread later
openclaw-x thread continue my-thread "Another tweet in the thread"
# Get a user profile
openclaw-x user get @username
# Like a tweet
openclaw-x like https://x.com/user/status/1234567890
# View your mentions
openclaw-x me mentions
# See tweet history
openclaw-x history
CLI Reference
openclaw-x [-j|--json] [-p|--plain] [-md|--markdown] [-v|--verbose]
├── tweet post TEXT [--media PATH] [--poll OPTIONS]
├── tweet get ID_OR_URL
├── tweet delete ID_OR_URL
├── tweet reply ID_OR_URL TEXT [--media PATH]
├── tweet quote ID_OR_URL TEXT [--media PATH]
├── tweet search QUERY [--max N]
├── tweet metrics ID_OR_URL
├── thread post TEXT... [--name NAME] [--file PATH]
├── thread continue NAME TEXT [--media PATH]
├── thread list
├── thread history NAME
├── user get USERNAME
├── user timeline USERNAME [--max N]
├── user followers USERNAME [--max N]
├── user following USERNAME [--max N]
├── me mentions [--max N]
├── me bookmarks [--max N]
├── me bookmark ID_OR_URL
├── me unbookmark ID_OR_URL
├── like ID_OR_URL
├── retweet ID_OR_URL
├── history [--count N]
└── version
Output Formats
| Flag | Format | Use Case |
|---|---|---|
| (default) | Rich panels/tables | Interactive terminal use |
-j |
JSON | Agent consumption, scripting |
-p |
TSV | Piping to other tools |
-md |
Markdown | Documentation, reports |
OpenClaw Integration
Install as an OpenClaw skill:
# The skill definition is in skill/SKILL.md
openclaw skills add openclaw-x /path/to/openclaw-x-skill/skill
Development
git clone https://github.com/AmuMoon/openclaw-x-skill.git
cd openclaw-x-skill
uv sync --group dev
uv run pytest tests/ -v
uv run ruff check src/ tests/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openclaw_x-0.1.0.tar.gz.
File metadata
- Download URL: openclaw_x-0.1.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
018371861dbdb98cdaad2e4588fc9b31eac18041df700851b127ac333a0facb9
|
|
| MD5 |
022decc61194f73e2d8cea32421f7561
|
|
| BLAKE2b-256 |
ecb3fdf8744ab8e7a1ad88b560f035c37af4ac5d1bbd0a990e9ed83e50ec0d41
|
Provenance
The following attestation bundles were made for openclaw_x-0.1.0.tar.gz:
Publisher:
release.yml on AmuMoon/openclaw-x-skill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openclaw_x-0.1.0.tar.gz -
Subject digest:
018371861dbdb98cdaad2e4588fc9b31eac18041df700851b127ac333a0facb9 - Sigstore transparency entry: 1006424588
- Sigstore integration time:
-
Permalink:
AmuMoon/openclaw-x-skill@e455419880c39026ada6fe40031081c48db8be5f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AmuMoon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e455419880c39026ada6fe40031081c48db8be5f -
Trigger Event:
push
-
Statement type:
File details
Details for the file openclaw_x-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openclaw_x-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
695200d132700f73e632ed4c84d153a6d81fe5d534b9d86af64a39e092bcf47f
|
|
| MD5 |
bd74d86f90949cb52a6540f4e316f8f3
|
|
| BLAKE2b-256 |
e798fccd50c798af8cce1240e4165ca14ddc48d129d6b217561a2d8a052bea9f
|
Provenance
The following attestation bundles were made for openclaw_x-0.1.0-py3-none-any.whl:
Publisher:
release.yml on AmuMoon/openclaw-x-skill
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openclaw_x-0.1.0-py3-none-any.whl -
Subject digest:
695200d132700f73e632ed4c84d153a6d81fe5d534b9d86af64a39e092bcf47f - Sigstore transparency entry: 1006424589
- Sigstore integration time:
-
Permalink:
AmuMoon/openclaw-x-skill@e455419880c39026ada6fe40031081c48db8be5f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AmuMoon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e455419880c39026ada6fe40031081c48db8be5f -
Trigger Event:
push
-
Statement type: