xurl

作者: firecrawl

一個用於向 X(Twitter)API 發送已驗證請求的命令列工具。當你需要發推文、回覆、引用、搜尋、閱讀貼文、管理……時,可使用此技能。

npx skills add https://github.com/firecrawl/openclaw --skill xurl

xurl — Agent Skill Reference

xurl is a CLI tool for the X API. It supports both shortcut commands (human/agent‑friendly one‑liners) and raw curl‑style access to any v2 endpoint. All commands return JSON to stdout.


Installation

Homebrew (macOS)

brew install --cask xdevplatform/tap/xurl

npm

npm install -g @xdevplatform/xurl

Shell script

curl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | bash

Installs to ~/.local/bin. If it's not in your PATH, the script will tell you what to add.

Go

go install github.com/xdevplatform/xurl@latest

Prerequisites

This skill requires the xurl CLI utility: https://github.com/xdevplatform/xurl.

Before using any command you must be authenticated. Run xurl auth status to check.

Secret Safety (Mandatory)

  • Never read, print, parse, summarize, upload, or send ~/.xurl (or copies of it) to the LLM context.
  • Never ask the user to paste credentials/tokens into chat.
  • The user must fill ~/.xurl with required secrets manually on their own machine.
  • 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 --verbose / -v in agent/LLM sessions; it can expose sensitive headers/tokens in output.
  • 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:

xurl auth oauth2

For multiple pre-configured apps, switch between them:

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 override

Other 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 ~/.xurl 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 Authorization header.


Quick Reference

ActionCommand
Postxurl post "Hello world!"
Replyxurl reply POST_ID "Nice post!"
Quotexurl quote POST_ID "My take"
Delete a postxurl delete POST_ID
Read a postxurl read POST_ID
Search postsxurl search "QUERY" -n 10
Who am Ixurl whoami
Look up a userxurl user @handle
Home timelinexurl timeline -n 20
Mentionsxurl mentions -n 10
Likexurl like POST_ID
Unlikexurl unlike POST_ID
Repostxurl repost POST_ID
Undo repostxurl unrepost POST_ID
Bookmarkxurl bookmark POST_ID
Remove bookmarkxurl unbookmark POST_ID
List bookmarksxurl bookmarks -n 10
List likesxurl likes -n 10
Followxurl follow @handle
Unfollowxurl unfollow @handle
List followingxurl following -n 20
List followersxurl followers -n 20
Blockxurl block @handle
Unblockxurl unblock @handle
Mutexurl mute @handle
Unmutexurl unmute @handle
Send DMxurl dm @handle "message"
List DMsxurl dms -n 10
Upload mediaxurl media upload path/to/file.mp4
Media statusxurl media status MEDIA_ID
App Management
Register appManual, outside agent (do not pass secrets via agent)
List appsxurl auth apps list
Update app credsManual, outside agent (do not pass secrets via agent)
Remove appxurl auth apps remove NAME
Set default (interactive)xurl auth default
Set default (command)xurl auth default APP_NAME [USERNAME]
Use app per-requestxurl --app NAME /2/users/me
Auth statusxurl auth status

Post IDs vs URLs: Anywhere POST_ID appears above you can also paste a full post URL (e.g. https://x.com/user/status/1234567890) — xurl extracts the ID automatically.

Usernames: Leading @ is optional. @elonmusk and elonmusk both work.


Command Details

Posting

# 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 1234567890

Reading

# 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 15

User Info

# Your own profile
xurl whoami

# Look up any user
xurl user elonmusk
xurl user @XDevelopers

Timelines & Mentions

# Home timeline (reverse chronological)
xurl timeline
xurl timeline -n 25

# Your mentions
xurl mentions
xurl mentions -n 20

Engagement

# 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 20

Social Graph

# 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 @annoying

Direct Messages

# Send a DM
xurl dm @someuser "Hey, saw your post!"

# List recent DM events
xurl dms
xurl dms -n 25

Media Upload

# 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_ID

Global Flags

These flags work on every command:

FlagShortDescription
--appUse a specific registered app for this request (overrides default)
--authForce auth type: oauth1, oauth2, or app
--username-uWhich OAuth2 account to use (if you have multiple)
--verbose-vForbidden in agent/LLM sessions (can leak auth headers/tokens)
--trace-tAdd X-B3-Flags: 1 trace header

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:

# 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/me

Streaming

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 -s:

xurl -s /2/some/endpoint

Output 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:

{
  "data": {
    "id": "1234567890",
    "text": "Hello world!"
  }
}

Errors are also returned as JSON:

{
  "errors": [
    {
      "message": "Not authorized",
      "code": 403
    }
  ]
}

Common Workflows

Post with an image

# 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_ID

Reply to a conversation

# 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

# 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

# See who you are
xurl whoami
# Check your mentions
xurl mentions -n 20
# Check your timeline
xurl timeline -n 20

Set up multiple apps

# 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 staging

Error 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 xurl auth oauth2 or checking your tokens.
  • If a command requires your user ID (like, repost, bookmark, follow, etc.), xurl will automatically fetch it via /2/users/me. If that fails, you'll see an auth error.

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 xurl auth oauth2 to get a fresh token.
  • 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 xurl auth default or --app.
  • Multiple accounts: You can authenticate multiple OAuth 2.0 accounts per app and switch between them with --username / -u or set a default with xurl auth default APP USER.
  • Default user: When no -u flag is given, xurl uses the default user for the active app (set via xurl auth default). If no default user is set, it uses the first available token.
  • Token storage: ~/.xurl is YAML. Each app stores its own credentials and tokens. Never read or send this file to LLM context.

來自 firecrawl 的更多技能

oracle
firecrawl
使用 oracle CLI 的最佳實踐(提示與檔案捆綁、引擎、會話及檔案附加模式)。
official
firecrawl-monitor
firecrawl
偵測網站內容何時變更,並透過 Webhook 或電子郵件接收通知 — 無需 Cron 任務、爬蟲或比對腳本。當使用者想追蹤頁面變更、監控競爭對手定價、在新職缺或部落格文章出現時收到提醒、監控文件/更新紀錄/狀態頁面,或說出「監控」、「觀察」、「追蹤」、「當...時提醒我」、「當 X 變更時通知我」、「如果...請通知我」、「當...時寄信給我」或「當...時傳送 Webhook」時,請使用此技能。內建的 AI 判斷器會過濾格式、時間戳記及...
officialweb-scrapingresearch
firecrawl-deep-research
firecrawl
使用 Firecrawl 執行多來源深度研究。當使用者要求研究某個主題、比較不同觀點、產出具來源的簡報、調查技術或市場問題,或綜合多個來源的網路證據時使用。
officialresearchweb-scraping
firecrawl-research-papers
firecrawl
使用 Firecrawl 查找並綜合研究論文、白皮書、PDF、技術報告及學術來源。適用於用戶需要文獻回顧、論文摘要、研究現狀分析,或從 PDF 及學術/行業出版物中獲取有來源的綜合資訊時。
officialresearchweb-scraping
firecrawl-market-research
firecrawl
使用 Firecrawl 提取市場、財務、收益、行業及公司指標。適用於用戶查詢市場研究、行業趨勢、上市公司數據、財務比較、收益研究或結構化市場報告時使用。
officialresearchweb-scraping
firecrawl-website-design-clone
firecrawl
使用 Firecrawl 抓取證據,將任何網站的設計系統提取為可供代理程式使用的 DESIGN.md。當使用者需要從網站取得顏色、字型、間距、元件、版面配置模式或品牌/UI 指引,以便 AI 代理程式能建立新網站、複製外觀或根據該設計建構頁面時使用。
officialdesignweb-scraping
firecrawl-knowledge-base
firecrawl
使用 Firecrawl 從網頁內容建立知識庫。適用於本地參考文件、RAG 就緒區塊、微調資料集、文件鏡像、主題語料庫,或從網路來源整理而成的 LLM 就緒 Markdown。
officialweb-scrapingresearch
firecrawl-lead-research
firecrawl
使用 Firecrawl 生成會前潛在客戶情報簡報。適用於用戶在銷售通話、合作會議、投資人對話或客戶訪談前,需要進行公司研究、人物研究、最新新聞、談話要點、痛點分析或外展準備時。
officialresearchweb-scraping