xurl
Original:🇺🇸 English
Translated
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
28installs
Sourcesteipete/clawdis
Added on
NPX Install
npx skill4agent add steipete/clawdis xurlTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →xurl — Agent Skill Reference
xurlInstallation
Homebrew (macOS)
bash
brew install --cask xdevplatform/tap/xurlnpm
bash
npm install -g @xdevplatform/xurlShell script
bash
curl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | bashInstalls to . If it's not in your PATH, the script will tell you what to add.
~/.local/binGo
bash
go install github.com/xdevplatform/xurl@latestPrerequisites
This skill requires the CLI utility: https://github.com/xdevplatform/xurl.
xurlBefore using any command you must be authenticated. Run to check.
xurl auth statusSecret Safety (Mandatory)
- Never read, print, parse, summarize, upload, or send (or copies of it) to the LLM context.
~/.xurl - Never ask the user to paste credentials/tokens into chat.
- The user must fill with required secrets manually on their own machine.
~/.xurl - Do not recommend or execute auth commands with inline secrets in agent/LLM sessions.
- Warn that using CLI secret options in agent sessions can leak credentials (prompt/context, logs, shell history).
- Never use /
--verbosein agent/LLM sessions; it can expose sensitive headers/tokens in output.-v - Sensitive flags that must never be used in agent commands: ,
--bearer-token,--consumer-key,--consumer-secret,--access-token,--token-secret,--client-id.--client-secret - To verify whether at least one app with credentials is already registered, run: .
xurl auth status
Register an app (recommended)
App credential registration must be done manually by the user outside the agent/LLM session.
After credentials are registered, authenticate with:
bash
xurl auth oauth2For multiple pre-configured apps, switch between them:
bash
xurl auth default prod-app # set default app
xurl auth default prod-app alice # set default app + user
xurl --app dev-app /2/users/me # one-off overrideOther auth methods
Examples with inline secret flags are intentionally omitted. If OAuth1 or app-only auth is needed, the user must run those commands manually outside agent/LLM context.
Tokens are persisted to in YAML format. Each app has its own isolated tokens. Do not read this file through the agent/LLM. Once authenticated, every command below will auto‑attach the right header.
~/.xurlAuthorizationQuick Reference
| Action | Command |
|---|---|
| Post | |
| Reply | |
| Quote | |
| Delete a post | |
| Read a post | |
| Search posts | |
| Who am I | |
| Look up a user | |
| Home timeline | |
| Mentions | |
| Like | |
| Unlike | |
| Repost | |
| Undo repost | |
| Bookmark | |
| Remove bookmark | |
| List bookmarks | |
| List likes | |
| Follow | |
| Unfollow | |
| List following | |
| List followers | |
| Block | |
| Unblock | |
| Mute | |
| Unmute | |
| Send DM | |
| List DMs | |
| Upload media | |
| Media status | |
| App Management | |
| Register app | Manual, outside agent (do not pass secrets via agent) |
| List apps | |
| Update app creds | Manual, outside agent (do not pass secrets via agent) |
| Remove app | |
| Set default (interactive) | |
| Set default (command) | |
| Use app per-request | |
| Auth status | |
Post IDs vs URLs: Anywhereappears above you can also paste a full post URL (e.g.POST_ID) — xurl extracts the ID automatically.https://x.com/user/status/1234567890
Usernames: Leadingis optional.@and@elonmuskboth work.elonmusk
Command Details
Posting
bash
# Simple post
xurl post "Hello world!"
# Post with media (upload first, then attach)
xurl media upload photo.jpg # → note the media_id from response
xurl post "Check this out" --media-id MEDIA_ID
# Multiple media
xurl post "Thread pics" --media-id 111 --media-id 222
# Reply to a post (by ID or URL)
xurl reply 1234567890 "Great point!"
xurl reply https://x.com/user/status/1234567890 "Agreed!"
# Reply with media
xurl reply 1234567890 "Look at this" --media-id MEDIA_ID
# Quote a post
xurl quote 1234567890 "Adding my thoughts"
# Delete your own post
xurl delete 1234567890Reading
bash
# Read a single post (returns author, text, metrics, entities)
xurl read 1234567890
xurl read https://x.com/user/status/1234567890
# Search recent posts (default 10 results)
xurl search "golang"
xurl search "from:elonmusk" -n 20
xurl search "#buildinpublic lang:en" -n 15User Info
bash
# Your own profile
xurl whoami
# Look up any user
xurl user elonmusk
xurl user @XDevelopersTimelines & Mentions
bash
# Home timeline (reverse chronological)
xurl timeline
xurl timeline -n 25
# Your mentions
xurl mentions
xurl mentions -n 20Engagement
bash
# Like / unlike
xurl like 1234567890
xurl unlike 1234567890
# Repost / undo
xurl repost 1234567890
xurl unrepost 1234567890
# Bookmark / remove
xurl bookmark 1234567890
xurl unbookmark 1234567890
# List your bookmarks / likes
xurl bookmarks -n 20
xurl likes -n 20Social Graph
bash
# Follow / unfollow
xurl follow @XDevelopers
xurl unfollow @XDevelopers
# List who you follow / your followers
xurl following -n 50
xurl followers -n 50
# List another user's following/followers
xurl following --of elonmusk -n 20
xurl followers --of elonmusk -n 20
# Block / unblock
xurl block @spammer
xurl unblock @spammer
# Mute / unmute
xurl mute @annoying
xurl unmute @annoyingDirect Messages
bash
# Send a DM
xurl dm @someuser "Hey, saw your post!"
# List recent DM events
xurl dms
xurl dms -n 25Media Upload
bash
# Upload a file (auto‑detects type for images/videos)
xurl media upload photo.jpg
xurl media upload video.mp4
# Specify type and category explicitly
xurl media upload --media-type image/jpeg --category tweet_image photo.jpg
# Check processing status (videos need server‑side processing)
xurl media status MEDIA_ID
xurl media status --wait MEDIA_ID # poll until done
# Full workflow: upload then post
xurl media upload meme.png # response includes media id
xurl post "lol" --media-id MEDIA_IDGlobal Flags
These flags work on every command:
| Flag | Short | Description |
|---|---|---|
| Use a specific registered app for this request (overrides default) | |
| Force auth type: | |
| | Which OAuth2 account to use (if you have multiple) |
| | Forbidden in agent/LLM sessions (can leak auth headers/tokens) |
| | Add |
Raw API Access
The shortcut commands cover the most common operations. For anything else, use xurl's raw curl‑style mode — it works with any X API v2 endpoint:
bash
# GET request (default)
xurl /2/users/me
# POST with JSON body
xurl -X POST /2/tweets -d '{"text":"Hello world!"}'
# PUT, PATCH, DELETE
xurl -X DELETE /2/tweets/1234567890
# Custom headers
xurl -H "Content-Type: application/json" /2/some/endpoint
# Force streaming mode
xurl -s /2/tweets/search/stream
# Full URLs also work
xurl https://api.x.com/2/users/meStreaming
Streaming endpoints are auto‑detected. Known streaming endpoints include:
/2/tweets/search/stream/2/tweets/sample/stream/2/tweets/sample10/stream
You can force streaming on any endpoint with :
-sbash
xurl -s /2/some/endpointOutput Format
All commands return JSON to stdout, pretty‑printed with syntax highlighting. The output structure matches the X API v2 response format. A typical response looks like:
json
{
"data": {
"id": "1234567890",
"text": "Hello world!"
}
}Errors are also returned as JSON:
json
{
"errors": [
{
"message": "Not authorized",
"code": 403
}
]
}Common Workflows
Post with an image
bash
# 1. Upload the image
xurl media upload photo.jpg
# 2. Copy the media_id from the response, then post
xurl post "Check out this photo!" --media-id MEDIA_IDReply to a conversation
bash
# 1. Read the post to understand context
xurl read https://x.com/user/status/1234567890
# 2. Reply
xurl reply 1234567890 "Here are my thoughts..."Search and engage
bash
# 1. Search for relevant posts
xurl search "topic of interest" -n 10
# 2. Like an interesting one
xurl like POST_ID_FROM_RESULTS
# 3. Reply to it
xurl reply POST_ID_FROM_RESULTS "Great point!"Check your activity
bash
# See who you are
xurl whoami
# Check your mentions
xurl mentions -n 20
# Check your timeline
xurl timeline -n 20Set up multiple apps
bash
# App credentials must already be configured manually outside agent/LLM context.
# Authenticate users on each pre-configured app
xurl auth default prod
xurl auth oauth2 # authenticates on prod app
xurl auth default staging
xurl auth oauth2 # authenticates on staging app
# Switch between them
xurl auth default prod alice # prod app, alice user
xurl --app staging /2/users/me # one-off request against stagingError Handling
- Non‑zero exit code on any error.
- API errors are printed as JSON to stdout (so you can still parse them).
- Auth errors suggest re‑running or checking your tokens.
xurl auth oauth2 - If a command requires your user ID (like, repost, bookmark, follow, etc.), xurl will automatically fetch it via . If that fails, you'll see an auth error.
/2/users/me
Notes
- Rate limits: The X API enforces rate limits per endpoint. If you get a 429 error, wait and retry. Write endpoints (post, reply, like, repost) have stricter limits than read endpoints.
- Scopes: OAuth 2.0 tokens are requested with broad scopes. If you get a 403 on a specific action, your token may lack the required scope — re‑run to get a fresh token.
xurl auth oauth2 - Token refresh: OAuth 2.0 tokens auto‑refresh when expired. No manual intervention needed.
- Multiple apps: Each app has its own isolated credentials and tokens. Configure credentials manually outside agent/LLM context, then switch with or
xurl auth default.--app - Multiple accounts: You can authenticate multiple OAuth 2.0 accounts per app and switch between them with /
--usernameor set a default with-u.xurl auth default APP USER - Default user: When no flag is given, xurl uses the default user for the active app (set via
-u). If no default user is set, it uses the first available token.xurl auth default - Token storage: is YAML. Each app stores its own credentials and tokens. Never read or send this file to LLM context.
~/.xurl