jpskill.com
💬 コミュニケーション コミュニティ 🟡 少し慣れが必要 👤 幅広いユーザー

💬 Xurl

xurl

X(旧Twitter)で投稿したり、検索したり

⏱ メール返信10件 30分 → 3分

📺 まず動画で見る(YouTube)

▶ 【最新版】Claude(クロード)完全解説!20以上の便利機能をこの動画1本で全て解説 ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

X/Twitter via xurl CLI: post, search, DM, media, v2 API.

🇯🇵 日本人クリエイター向け解説

一言でいうと

X(旧Twitter)で投稿したり、検索したり

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o xurl.zip https://jpskill.com/download/1243.zip && unzip -o xurl.zip && rm xurl.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/1243.zip -OutFile "$d\xurl.zip"; Expand-Archive "$d\xurl.zip" -DestinationPath $d -Force; ri "$d\xurl.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して xurl.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → xurl フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Xurl の使い方を教えて
  • Xurl で何ができるか具体例で見せて
  • Xurl を初めて使う人向けにステップを案内して

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] xurl

xurl — 公式 CLI を介した X (Twitter) API

xurl は、X API 用の X 開発者プラットフォームの公式 CLI です。一般的なアクションのショートカットコマンドと、任意の v2 エンドポイントへの生の curl スタイルのアクセスをサポートしています。すべてのコマンドは JSON を標準出力に返します。

このスキルは以下の用途に使用します。

  • 投稿、返信、引用、投稿の削除
  • 投稿の検索、タイムライン/メンションの閲覧
  • いいね、リポスト、ブックマーク
  • フォロー、フォロー解除、ブロック、ミュート
  • ダイレクトメッセージ
  • メディアのアップロード (画像と動画)
  • 任意の X API v2 エンドポイントへの生アクセス
  • 複数アプリ/複数アカウントのワークフロー

このスキルは、以前の xitter スキル (サードパーティの Python CLI をラップしていました) を置き換えるものです。xurl は X 開発者プラットフォームチームによってメンテナンスされており、自動更新付きの OAuth 2.0 PKCE をサポートし、大幅に広い API サーフェスをカバーしています。


シークレットの安全性 (必須)

エージェント/LLM セッション内で操作する際の重要なルールです。

  • ~/.xurl を LLM コンテキストに決して読み込み、出力、解析、要約、アップロード、送信しないでください。
  • ユーザーに資格情報/トークンをチャットに貼り付けるよう決して求めないでください。
  • ユーザーは自分のマシンで手動で ~/.xurl にシークレットを入力する必要があります。
  • エージェントセッションでインラインシークレットを含む認証コマンドを決して推奨したり実行したりしないでください。
  • エージェントセッションで --verbose / -v決して使用しないでください。認証ヘッダー/トークンが公開される可能性があります。
  • 資格情報が存在することを確認するには、xurl auth status のみを使用してください。

エージェントコマンドで禁止されているフラグ (インラインシークレットを受け入れます): --bearer-token, --consumer-key, --consumer-secret, --access-token, --token-secret, --client-id, --client-secret

アプリの資格情報の登録と資格情報のローテーションは、エージェントセッション外でユーザーが手動で行う必要があります。資格情報が登録された後、ユーザーは xurl auth oauth2 で認証します。これもエージェントセッション外で行います。トークンは YAML 形式で ~/.xurl に永続化されます。各アプリは分離されたトークンを持ちます。OAuth 2.0 トークンは自動更新されます。


インストール

いずれか1つの方法を選択してください。Linux では、シェルスクリプトまたは go install が最も簡単です。

# シェルスクリプト (~/.local/bin にインストール、sudo 不要、Linux + macOS で動作)
curl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | bash

# Homebrew (macOS)
brew install --cask xdevplatform/tap/xurl

# npm
npm install -g @xdevplatform/xurl

# Go
go install github.com/xdevplatform/xurl@latest

確認:

xurl --help
xurl auth status

xurl がインストールされているにもかかわらず auth status がアプリやトークンを表示しない場合、ユーザーは手動で認証を完了する必要があります。次のセクションを参照してください。


1回限りのユーザー設定 (ユーザーがエージェント外で実行)

これらの手順は、シークレットの貼り付けを伴うため、エージェントではなくユーザーが直接実行する必要があります。ユーザーをこのブロックに誘導し、エージェントが実行しないでください。

  1. https://developer.x.com/en/portal/dashboard でアプリを作成または開きます。

  2. リダイレクト URI を http://localhost:8080/callback に設定します。

  3. アプリの Client ID と Client Secret をコピーします。

  4. アプリをローカルに登録します (ユーザーが実行):

    xurl auth apps add my-app --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET
  5. 認証します (トークンをアプリにバインドするために --app を指定します):

    xurl auth oauth2 --app my-app

    (これにより、OAuth 2.0 PKCE フローのためにブラウザが開きます。)

    OAuth 後の /2/users/me ルックアップで X が UsernameNotFound エラーまたは 403 を返す場合、ハンドルを明示的に渡します (xurl v1.1.0+):

    xurl auth oauth2 --app my-app YOUR_USERNAME

    これにより、トークンがハンドルにバインドされ、壊れた /2/users/me 呼び出しがスキップされます。

  6. すべてのコマンドがそれを使用するように、アプリをデフォルトに設定します:

    xurl auth default my-app
  7. 確認:

    xurl auth status
    xurl whoami

この後、エージェントは追加の設定なしで以下の任意のコマンドを使用できます。OAuth 2.0 トークンは自動更新されます。

よくある落とし穴: xurl auth oauth2 から --app my-app を省略すると、OAuth トークンは組み込みの default アプリプロファイルに保存されます。これには client-id も client-secret もありません。OAuth フローが成功したように見えても、コマンドは認証エラーで失敗します。これに遭遇した場合は、xurl auth oauth2 --app my-appxurl auth default my-app を再実行してください。


クイックリファレンス

アクション コマンド
投稿 xurl post "Hello world!"
返信 xurl reply POST_ID "Nice post!"
引用 xurl quote POST_ID "My take"
投稿を削除 xurl delete POST_ID
投稿を読む xurl read POST_ID
投稿を検索 xurl search "QUERY" -n 10
自分の情報 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 bookmarks -n 10 / xurl likes -n 10
フォロー / フォロー解除 xurl follow @handle / xurl unfollow @handle
フォロー中 / フォロワー xurl following -n 20 / xurl followers -n 20
ブロック / ブロック解除 xurl block @handle / xurl unblock @handle
ミュート / ミュート解除 xurl mute @handle / xurl unmute @handle
DM を送信 xurl dm @handle "message"
DM を一覧表示 xurl dms -n 10
メディアをアップロード xurl media upload path/to/file.mp4
メディアのステータス xurl media status MEDIA_ID
アプリを一覧表示 xurl auth apps list
アプリを削除 xurl auth apps remove NAME
デフォルトアプリを設定 xurl auth default APP_NAME [USERNAME]
リクエストごとのアプリ xurl --app NAME /2/users/me
認証ステータス xurl auth status

注記:

  • POST_ID は完全な URL も受け入れます (例: https://x.com/user/status/1234567890) — xurl が ID を抽出します。
  • ユーザー名は先頭の @ があってもなくても機能します。

コマンドの詳細

投稿

xurl post "Hello world!"
xurl post "Check this out" --media-id MEDIA_ID
xurl post "Thread pics" --media-id 111 --media-id 222

xurl reply 1234567890 "Great point!"
xurl reply https://x.com/user/status/1234567890 "Agreed!"
xurl reply 123

(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

xurl — X (Twitter) API via the Official CLI

xurl is the X developer platform's official CLI for the X API. It supports shortcut commands for common actions AND raw curl-style access to any v2 endpoint. All commands return JSON to stdout.

Use this skill for:

  • posting, replying, quoting, deleting posts
  • searching posts and reading timelines/mentions
  • liking, reposting, bookmarking
  • following, unfollowing, blocking, muting
  • direct messages
  • media uploads (images and video)
  • raw access to any X API v2 endpoint
  • multi-app / multi-account workflows

This skill replaces the older xitter skill (which wrapped a third-party Python CLI). xurl is maintained by the X developer platform team, supports OAuth 2.0 PKCE with auto-refresh, and covers a substantially larger API surface.


Secret Safety (MANDATORY)

Critical rules when operating inside an agent/LLM session:

  • Never read, print, parse, summarize, upload, or send ~/.xurl to LLM context.
  • Never ask the user to paste credentials/tokens into chat.
  • The user must fill ~/.xurl with secrets manually on their own machine.
  • Never recommend or execute auth commands with inline secrets in agent sessions.
  • Never use --verbose / -v in agent sessions — it can expose auth headers/tokens.
  • To verify credentials exist, only use: xurl auth status.

Forbidden flags in agent commands (they accept inline secrets): --bearer-token, --consumer-key, --consumer-secret, --access-token, --token-secret, --client-id, --client-secret

App credential registration and credential rotation must be done by the user manually, outside the agent session. After credentials are registered, the user authenticates with xurl auth oauth2 — also outside the agent session. Tokens persist to ~/.xurl in YAML. Each app has isolated tokens. OAuth 2.0 tokens auto-refresh.


Installation

Pick ONE method. On Linux, the shell script or go install are the easiest.

# Shell script (installs to ~/.local/bin, no sudo, works on Linux + macOS)
curl -fsSL https://raw.githubusercontent.com/xdevplatform/xurl/main/install.sh | bash

# Homebrew (macOS)
brew install --cask xdevplatform/tap/xurl

# npm
npm install -g @xdevplatform/xurl

# Go
go install github.com/xdevplatform/xurl@latest

Verify:

xurl --help
xurl auth status

If xurl is installed but auth status shows no apps or tokens, the user needs to complete auth manually — see the next section.


One-Time User Setup (user runs these outside the agent)

These steps must be performed by the user directly, NOT by the agent, because they involve pasting secrets. Direct the user to this block; do not execute it for them.

  1. Create or open an app at https://developer.x.com/en/portal/dashboard

  2. Set the redirect URI to http://localhost:8080/callback

  3. Copy the app's Client ID and Client Secret

  4. Register the app locally (user runs this):

    xurl auth apps add my-app --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET
  5. Authenticate (specify --app to bind the token to your app):

    xurl auth oauth2 --app my-app

    (This opens a browser for the OAuth 2.0 PKCE flow.)

    If X returns a UsernameNotFound error or 403 on the post-OAuth /2/users/me lookup, pass your handle explicitly (xurl v1.1.0+):

    xurl auth oauth2 --app my-app YOUR_USERNAME

    This binds the token to your handle and skips the broken /2/users/me call.

  6. Set the app as default so all commands use it:

    xurl auth default my-app
  7. Verify:

    xurl auth status
    xurl whoami

After this, the agent can use any command below without further setup. OAuth 2.0 tokens auto-refresh.

Common pitfall: If you omit --app my-app from xurl auth oauth2, the OAuth token is saved to the built-in default app profile — which has no client-id or client-secret. Commands will fail with auth errors even though the OAuth flow appeared to succeed. If you hit this, re-run xurl auth oauth2 --app my-app and xurl auth default my-app.


Quick Reference

Action Command
Post xurl post "Hello world!"
Reply xurl reply POST_ID "Nice post!"
Quote xurl quote POST_ID "My take"
Delete a post xurl delete POST_ID
Read a post xurl read POST_ID
Search posts xurl search "QUERY" -n 10
Who am I xurl whoami
Look up a user xurl user @handle
Home timeline xurl timeline -n 20
Mentions xurl mentions -n 10
Like / Unlike xurl like POST_ID / xurl unlike POST_ID
Repost / Undo xurl repost POST_ID / xurl unrepost POST_ID
Bookmark / Remove xurl bookmark POST_ID / xurl unbookmark POST_ID
List bookmarks / likes xurl bookmarks -n 10 / xurl likes -n 10
Follow / Unfollow xurl follow @handle / xurl unfollow @handle
Following / Followers xurl following -n 20 / xurl followers -n 20
Block / Unblock xurl block @handle / xurl unblock @handle
Mute / Unmute xurl mute @handle / xurl unmute @handle
Send DM xurl dm @handle "message"
List DMs xurl dms -n 10
Upload media xurl media upload path/to/file.mp4
Media status xurl media status MEDIA_ID
List apps xurl auth apps list
Remove app xurl auth apps remove NAME
Set default app xurl auth default APP_NAME [USERNAME]
Per-request app xurl --app NAME /2/users/me
Auth status xurl auth status

Notes:

  • POST_ID accepts full URLs too (e.g. https://x.com/user/status/1234567890) — xurl extracts the ID.
  • Usernames work with or without a leading @.

Command Details

Posting

xurl post "Hello world!"
xurl post "Check this out" --media-id MEDIA_ID
xurl post "Thread pics" --media-id 111 --media-id 222

xurl reply 1234567890 "Great point!"
xurl reply https://x.com/user/status/1234567890 "Agreed!"
xurl reply 1234567890 "Look at this" --media-id MEDIA_ID

xurl quote 1234567890 "Adding my thoughts"
xurl delete 1234567890

Reading & Search

xurl read 1234567890
xurl read https://x.com/user/status/1234567890

xurl search "golang"
xurl search "from:elonmusk" -n 20
xurl search "#buildinpublic lang:en" -n 15

Users, Timeline, Mentions

xurl whoami
xurl user elonmusk
xurl user @XDevelopers

xurl timeline -n 25
xurl mentions -n 20

Engagement

xurl like 1234567890
xurl unlike 1234567890

xurl repost 1234567890
xurl unrepost 1234567890

xurl bookmark 1234567890
xurl unbookmark 1234567890

xurl bookmarks -n 20
xurl likes -n 20

Social Graph

xurl follow @XDevelopers
xurl unfollow @XDevelopers

xurl following -n 50
xurl followers -n 50

# Another user's graph
xurl following --of elonmusk -n 20
xurl followers --of elonmusk -n 20

xurl block @spammer
xurl unblock @spammer
xurl mute @annoying
xurl unmute @annoying

Direct Messages

xurl dm @someuser "Hey, saw your post!"
xurl dms -n 25

Media Upload

# Auto-detect type
xurl media upload photo.jpg
xurl media upload video.mp4

# Explicit type/category
xurl media upload --media-type image/jpeg --category tweet_image photo.jpg

# Videos need server-side processing — check status (or poll)
xurl media status MEDIA_ID
xurl media status --wait MEDIA_ID

# Full workflow
xurl media upload meme.png                  # returns media id
xurl post "lol" --media-id MEDIA_ID

Raw API Access

The shortcuts cover common operations. For anything else, use raw curl-style mode against any X API v2 endpoint:

# GET
xurl /2/users/me

# POST with JSON body
xurl -X POST /2/tweets -d '{"text":"Hello world!"}'

# DELETE / PUT / PATCH
xurl -X DELETE /2/tweets/1234567890

# Custom headers
xurl -H "Content-Type: application/json" /2/some/endpoint

# Force streaming
xurl -s /2/tweets/search/stream

# Full URLs also work
xurl https://api.x.com/2/users/me

Global Flags

Flag Short Description
--app Use a specific registered app (overrides default)
--auth Force auth type: oauth1, oauth2, or app
--username -u Which OAuth2 account to use (if multiple exist)
--verbose -v Forbidden in agent sessions — leaks auth headers
--trace -t Add X-B3-Flags: 1 trace header

Streaming

Streaming endpoints are auto-detected. Known ones include:

  • /2/tweets/search/stream
  • /2/tweets/sample/stream
  • /2/tweets/sample10/stream

Force streaming on any endpoint with -s.


Output Format

All commands return JSON to stdout. Structure mirrors X API v2:

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

Errors are also JSON:

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

Common Workflows

Post with an image

xurl media upload photo.jpg
xurl post "Check out this photo!" --media-id MEDIA_ID

Reply to a conversation

xurl read https://x.com/user/status/1234567890
xurl reply 1234567890 "Here are my thoughts..."

Search and engage

xurl search "topic of interest" -n 10
xurl like POST_ID_FROM_RESULTS
xurl reply POST_ID_FROM_RESULTS "Great point!"

Check your activity

xurl whoami
xurl mentions -n 20
xurl timeline -n 20

Multiple apps (credentials pre-configured manually)

xurl auth default prod alice               # prod app, alice user
xurl --app staging /2/users/me             # one-off against staging

Error Handling

  • Non-zero exit code on any error.
  • API errors are still printed as JSON to stdout, so you can parse them.
  • Auth errors → have the user re-run xurl auth oauth2 outside the agent session.
  • Commands that need the caller's user ID (like, repost, bookmark, follow, etc.) will auto-fetch it via /2/users/me. An auth failure there surfaces as an auth error.

Agent Workflow

  1. Verify prerequisites: xurl --help and xurl auth status.
  2. Check default app has credentials. Parse the auth status output. The default app is marked with . If the default app shows oauth2: (none) but another app has a valid oauth2 user, tell the user to run xurl auth default <that-app> to fix it. This is the most common setup mistake — the user added an app with a custom name but never set it as default, so xurl keeps trying the empty default profile.
  3. If auth is missing entirely, stop and direct the user to the "One-Time User Setup" section — do NOT attempt to register apps or pass secrets yourself.
  4. Start with a cheap read (xurl whoami, xurl user @handle, xurl search ... -n 3) to confirm reachability.
  5. Confirm the target post/user and the user's intent before any write action (post, reply, like, repost, DM, follow, block, delete).
  6. Use JSON output directly — every response is already structured.
  7. Never paste ~/.xurl contents back into the conversation.

Troubleshooting

Symptom Cause Fix
Auth errors after successful OAuth flow Token saved to default app (no client-id/secret) instead of your named app xurl auth oauth2 --app my-app then xurl auth default my-app
unauthorized_client during OAuth App type set to "Native App" in X dashboard Change to "Web app, automated app or bot" in User Authentication Settings
UsernameNotFound or 403 on /2/users/me right after OAuth X not returning username reliably from /2/users/me Re-run xurl auth oauth2 --app my-app YOUR_USERNAME (xurl v1.1.0+) to pass the handle explicitly
401 on every request Token expired or wrong default app Check xurl auth status — verify points to an app with oauth2 tokens
client-forbidden / client-not-enrolled X platform enrollment issue Dashboard → Apps → Manage → Move to "Pay-per-use" package → Production environment
CreditsDepleted $0 balance on X API Buy credits (min $5) in Developer Console → Billing
media processing failed on image upload Default category is amplify_video Add --category tweet_image --media-type image/png
Two "Client Secret" values in X dashboard UI bug — first is actually Client ID Confirm on the "Keys and tokens" page; ID ends in MTpjaQ

Notes

  • Rate limits: X enforces per-endpoint rate limits. A 429 means wait and retry. Write endpoints (post, reply, like, repost) have tighter limits than reads.
  • Scopes: OAuth 2.0 tokens use broad scopes. A 403 on a specific action usually means the token is missing a scope — have the user re-run xurl auth oauth2.
  • Token refresh: OAuth 2.0 tokens auto-refresh. Nothing to do.
  • Multiple apps: Each app has isolated credentials/tokens. Switch with xurl auth default or --app.
  • Multiple accounts per app: Select with -u / --username, or set a default with xurl auth default APP USER.
  • Token storage: ~/.xurl is YAML. Never read or send this file to LLM context.
  • Cost: X API access is typically paid for meaningful usage. Many failures are plan/permission problems, not code problems.

Attribution