Available for macOS, Linux & Windows

Xshell Twitter/X from your terminal

No API keys required. Log in with your browser cookies and control Twitter/X from the command line.

Quick install
curl -fsSL https://xsh.devbyben.fr/install | bash
119
Commands
54
MCP Tools
~50ms*
Startup (est.)

* Approximate startup estimate; results vary by machine and environment.

xsh / terminal / live
scroll
119
CLI Commands
full command tree
54
MCP Tools
Model Context Protocol
8
Command Groups
from auth to analytics
5
Browsers
cookies read locally
0
API Keys
browser cookie auth
3
Output Formats
json, yaml, compact
16 MB
Binary
single static file
136
Go Tests
across 37 test files
Features

Everything You Need

A complete toolkit for Twitter/X automation with 119 commands covering all major features.

Lightning Fast

One static Go binary with no runtime dependencies. Commands run in-process, with no interpreter to start.

$ xsh feed

Advanced Search

Search tweets with filters for Top, Latest, Photos, and Videos.

$ xsh search

User Profiles

View profiles, tweets, media, likes, and relationship lists.

$ xsh user

Media Support

Upload up to 4 images per tweet. Download media with a single command.

$ xsh tweet post --image

Long-form Notes

Publish long-form Note Tweets from text or a file with explicit confirmation.

$ xsh tweet note --file essay.txt

Scheduled Tweets

Schedule tweets for future posting with Unix timestamps.

$ xsh schedule

Direct Messages

Send and manage DMs directly from your terminal.

$ xsh dm

List Management

Browse list metadata, memberships, members, and confirmed updates.

$ xsh lists

Batch Operations

Fetch multiple tweets or users in a single command. Perfect for data processing.

$ xsh tweets id1 id2 id3

Job Search

Search job listings on X/Twitter with location and remote filters.

$ xsh jobs

AI-Ready

54 MCP tools for AI agent integration. Full Model Context Protocol support.

$ xsh mcp

Output Formats

Compact, JSON and YAML on every command. Built for AI agents, pipes and CI.

$ xsh feed --json
MCP Server

AI Agent Integration

Full Model Context Protocol implementation with 54 tools for seamless AI agent connectivity.

// mcp_server

What is MCP?

Model Context Protocol is an open protocol that standardizes how AI agents connect to external tools. xsh implements a full MCP server with 54 built-in tools.

// quick_start
$ xsh mcp # start
$ configure agent # connect
54 tools ready
mcp / tool registry
54/54
[read] #1
$ xsh mcp get_feed
Retrieve timeline
[read] #2
$ xsh mcp search
Search tweets
[read] #3
$ xsh mcp get_tweet
Retrieve tweet, or its thread
[read] #4
$ xsh mcp get_tweets_batch
Batch fetch tweets
[read] #5
$ xsh mcp get_users_batch
Batch fetch users
[read] #6
$ xsh mcp get_user
Get user profile
[read] #7
$ xsh mcp get_user_tweets
User tweets
[read] #8
$ xsh mcp get_user_likes
User likes
[read] #9
$ xsh mcp get_user_media
User media
[read] #10
$ xsh mcp get_followers
Followers
[read] #11
$ xsh mcp get_following
Following
[read] #12
$ xsh mcp get_followers_you_know
Followers you may know
[read] #13
$ xsh mcp get_blue_verified_followers
Blue-verified followers
[read] #14
$ xsh mcp get_blocked_accounts
Blocked accounts
[read] #15
$ xsh mcp get_muted_accounts
Muted accounts
[read] #16
$ xsh mcp auth_status
Auth status
[read] #17
$ xsh mcp list_bookmarks
Access bookmarks
[read] #18
$ xsh mcp get_bookmark_folders
Bookmark folders
[read] #19
$ xsh mcp get_bookmark_folder_timeline
Folder tweets
[read] #20
$ xsh mcp get_lists
User lists
[read] #21
$ xsh mcp get_list_info
List metadata
[read] #22
$ xsh mcp get_list_memberships
List memberships
[read] #23
$ xsh mcp get_list_timeline
List tweets
[read] #24
$ xsh mcp get_list_members
List members
[read] #25
$ xsh mcp dm_inbox
Read DMs
[read] #26
$ xsh mcp get_trending
Trending topics
[read] #27
$ xsh mcp search_jobs
Search jobs
[read] #28
$ xsh mcp get_job
Job details
[write] #29
$ xsh mcp post_tweet
Publish tweets
[write] #30
$ xsh mcp delete_tweet
Remove tweets
[write] #31
$ xsh mcp like
Like tweets
[write] #32
$ xsh mcp unlike
Unlike tweets
[write] #33
$ xsh mcp retweet
Retweet
[write] #34
$ xsh mcp unretweet
Undo retweet
[write] #35
$ xsh mcp bookmark
Bookmark
[write] #36
$ xsh mcp unbookmark
Remove bookmark
[write] #37
$ xsh mcp follow
Follow users
[write] #38
$ xsh mcp unfollow
Unfollow users
[write] #39
$ xsh mcp block
Block users
[write] #40
$ xsh mcp unblock
Unblock users
[write] #41
$ xsh mcp mute
Mute users
[write] #42
$ xsh mcp unmute
Unmute users
[admin] #43
$ xsh mcp create_list
Create lists
[admin] #44
$ xsh mcp delete_list
Delete lists
[admin] #45
$ xsh mcp add_list_member
Add to list
[admin] #46
$ xsh mcp remove_list_member
Remove from list
[admin] #47
$ xsh mcp pin_list
Pin list
[admin] #48
$ xsh mcp unpin_list
Unpin list
[admin] #49
$ xsh mcp schedule_tweet
Schedule tweets
[admin] #50
$ xsh mcp list_scheduled_tweets
List scheduled
[admin] #51
$ xsh mcp cancel_scheduled_tweet
Cancel scheduled
[admin] #52
$ xsh mcp dm_send
Send DMs
[admin] #53
$ xsh mcp dm_delete
Delete DMs
[admin] #54
$ xsh mcp download_media
Download media
Technical

Built for Performance

Advanced security and resilience features that keep xsh running smoothly.

Security

TLS Fingerprinting

Chrome impersonation using uTLS to bypass bot detection and mimic real browser behavior.

Resilience

Dynamic Endpoints

Authenticated GraphQL discovery across recursive Vite/Rollup chunks, with per-operation validation and safe isolation of obsolete 404 routes.

Crypto

Transaction Security

HMAC-SHA256 transaction ID generation for secure write operations and replay protection.

LLM Context

AI Skill Integration

xsh provides a complete skill definition for AI agents. 54 MCP tools, structured JSON schemas, and semantic understanding.

SKILL.md
loaded
# Authentication
xsh auth login # Browser extraction
xsh auth import cookies.json
# Timeline Operations
xsh feed --json
xsh search "query" --type Latest
# Tweet Actions
xsh tweet post "text"
xsh tweet like <id>
xsh tweet retweet <id>
# MCP Server (54 tools)
get_feed, search, post_tweet
get_user, follow, like
+ 46 more tools...
# User Operations
xsh user <handle> --json
xsh follow <handle>
xsh unfollow <handle>
# Bookmarks
xsh bookmarks --count 50
# Lists
xsh lists --json
xsh lists create "My List"
# Jobs
xsh jobs search "engineer"
# Scheduled Tweets
xsh schedule "text" --at "2026-01-01"
# Direct Messages
xsh dm inbox --json
xsh dm send <handle> "message"
# Configuration
~/.config/xsh/config.toml
default_count = 20
timeout = 30
# JSON Schema
{{
id: "string",
text: "string",
engagement: {{
likes: 0,
retweets: 0
}}
}}
# Authentication
xsh auth login # Browser extraction
xsh auth import cookies.json
# Timeline Operations
xsh feed --json
xsh search "query" --type Latest
# Tweet Actions
xsh tweet post "text"
xsh tweet like <id>
xsh tweet retweet <id>
# MCP Server (54 tools)
get_feed, search, post_tweet
get_user, follow, like
+ 46 more tools...
# User Operations
xsh user <handle> --json
xsh follow <handle>
xsh unfollow <handle>
# Bookmarks
xsh bookmarks --count 50
# Lists
xsh lists --json
xsh lists create "My List"
# Jobs
xsh jobs search "engineer"
# JSON Schema
{{
id: "string",
text: "string",
engagement: {{
likes: 0,
retweets: 0
}}
}}
# Scheduled Tweets
xsh schedule "text" --at "2026-01-01"
# Direct Messages
xsh dm inbox --json
xsh dm send <handle> "message"
# Configuration
~/.config/xsh/config.toml
default_count = 20
timeout = 30

Structured Output

JSON, YAML, and Compact modes. Perfect for piping and programmatic use.

xsh feed --json | jq '.[].text'

Semantic Understanding

Rich data models: Tweets, Users, Lists, Jobs with full engagement metrics.

Tweet objects
User profiles
Engagement data
Media attachments
Download SKILL.md
Installation

Get Started

Multiple ways to install xsh. Choose the one that works best for your system.

go install
go install github.com/benoitpetit/xsh@latest
Requires Go 1.24+
install script (Linux/macOS)
curl -fsSL https://xsh.devbyben.fr/install | bash
Auto-detect platform and install binary
powershell (Windows)
iwr -useb https://xsh.devbyben.fr/install | iex
Run in PowerShell as Administrator
from source
git clone https://github.com/benoitpetit/xsh && cd xsh && go build -o xsh .
Any platform with Go
quick_start
1
$ xsh auth login

Authenticate with your browser cookies

2
$ xsh feed

View your timeline

3
$ xsh tweet post "Hello!"

Post your first tweet