Work with the X API using xurl
Use the xurl command-line tool to post, reply, search, send DMs, upload media and call raw X API v2 endpoints from the terminal.
Requirements
- The xurl binary must be available, installed either via brew (xdevplatform/tap/xurl) or npm (@xdevplatform/xurl).
How to use
Check authentication with xurl auth status. A POST_ID argument can be a full https://x.com/<user>/status/<id> URL.
The POST_ID used in shortcut commands can be a full https://x.com/<user>/status/<id> URL.
Use xurl for X API work. Shortcut commands return JSON; raw mode works for any v2 endpoint.
Never read, print, summarize, upload, or inspect ~/.xurl.
Never ask the user to paste tokens or secrets into chat.
Do not run auth commands with inline secrets.
Do not use --verbose in agent sessions; it can expose auth headers.
Check auth with xurl auth status.
Common shortcuts cover posting, reading, searching, timelines, likes, reposts, bookmarks, follows, blocks, mutes and DMs.
xurl post "Hello world!"
xurl reply POST_ID "Nice."
xurl quote POST_ID "My take"
xurl delete POST_ID
xurl read POST_ID
xurl search "query" -n 20
xurl whoami
xurl user @handle
xurl timeline -n 20
xurl mentions -n 10
xurl like POST_ID
xurl unlike POST_ID
xurl repost POST_ID
xurl unrepost POST_ID
xurl bookmark POST_ID
xurl unbookmark POST_ID
xurl followers -n 20
xurl following -n 20
xurl follow @handle
xurl unfollow @handle
xurl block @handle
xurl unblock @handle
xurl mute @handle
xurl unmute @handle
xurl dm @handle "message"
xurl dms -n 10
Media upload commands.
xurl media upload image.jpg
xurl media upload clip.mp4
xurl media status MEDIA_ID
xurl post "caption" --media-id MEDIA_ID
Videos may need processing; poll media status.
Auth and app management commands.
xurl auth status
xurl auth apps list
xurl auth default
xurl auth default APP_NAME USERNAME
xurl auth apps remove APP_NAME
xurl --app APP_NAME /2/users/me
xurl --auth oauth2 /2/users/me
Raw API mode for endpoints shortcuts do not cover.
xurl /2/users/me
xurl -X POST /2/tweets -d '{"text":"Hello world!"}'
xurl '/2/tweets/search/recent?query=openclaw&max_results=10'
Use raw mode when shortcuts do not cover the endpoint. Keep payloads in temp files for complex JSON.
A 401/403 error means an auth, scope, or app mismatch; check xurl auth status.
A 429 means you are rate limited; back off.
For media upload failures, check the file type/size and media processing status.
Source: openclaw/openclaw and its contributors. License: MIT.
Copyright (c) 2026 OpenClaw Foundation
Translation and editorial adaptation by ClawCases.
>Resources
>Related Use Cases
Agent Merge-Conflict Arbiter
Resolve a git merge conflict between two agents' branches as an impartial third party: a neutral arbiter that takes both diffs and their stated intents and produces a merged result without overwriting either side.
Automate X (Twitter) Data and Actions from Hermes
Hermes Tweet installs as a Hermes Agent plugin that registers the hermes-tweet toolset with exploration, read, and action tools for X endpoints, plus a skill and slash commands like /xstatus and /xtrends for account status and trends.
Terminal Spotify Playback and Search
Control Spotify playback and search from the terminal using spogo (preferred) or spotify_player.