Community编程与开发github.com

xurl

xurl CLI 用于认证的X帖子、回复、读取/搜索、私信、媒体上传、关注者、认证状态或原始 v2 API 调用。

xurl 是什么?

xurl 是一个命令行工具,专为通过 X API (前身为 Twitter) 进行自动化交互而设计。它提供了丰富的快捷命令,用于执行常见操作,如发布帖子、回复、搜索、管理私信以及处理媒体上传。该工具支持多种认证方式(OAuth 1.0a 和 OAuth 2.0),并允许用户通过 `~/.xurl` 配置文件管理多个应用令牌。xurl 特别强调安全性,建议将密钥通过提示符传递给认证命令,而非直接内联,以避免泄露到 shell 历史记录中。 对于开发者或 AI Agent 用户而言,xurl 的主要价值在于其双重能力:一方面通过简洁的快捷命令(如 `xurl post`、`xurl like`、`xurl dm`)快速完成标准操作,另一方面提供原始模式 (`xurl /2/...`),可灵活调用任意 X API v2 端点,覆盖快捷命令未包含的复杂场景。输出统一为 JSON 格式,方便脚本和 Agent 解析处理。错误处理清晰,包括非零退出码和针对 401/403 (认证/权限问题) 及 429 (速率限制) 的具体指导。该工具适用于 macOS、Linux、Windows (通过 WSL) 等主流开发环境,并能无缝集成到自动化工作流或 AI Agent 的推理循环中。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/xurl

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

xurl 是做什么的?

使用 xurl 进行 X API 相关操作。快捷命令返回 JSON;原始模式可用于任意 v2 端点。

认证

  • ~/.xurl 存储令牌;请使用 xurl auth status 检查认证状态,而非直接读取该文件。
  • 通过提示符将密钥传递给认证命令,不要内联传递,以使其远离 shell 历史记录。
  • --verbose 会在工具输出中打印认证头。

常用快捷命令

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

POST_ID 可以是完整的 https://x.com/<user>/status/<id> URL。

媒体

xurl media upload image.jpg
xurl media upload clip.mp4
xurl media status MEDIA_ID
xurl post "caption" --media-id MEDIA_ID

视频可能需要处理;请轮询 media status。

认证/应用管理

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

原始 API

xurl /2/users/me
xurl -X POST /2/tweets -d '{"text":"Hello world!"}'
xurl '/2/tweets/search/recent?query=openclaw&max_results=10'

当快捷命令无法覆盖某个端点时,使用原始模式。对于复杂的 JSON 负载,请将其保存在临时文件中。

输出与错误

  • 成功时输出 JSON stdout。
  • API/认证/网络错误时返回非零退出码。
  • 401/403:认证、作用域或应用不匹配;请检查 xurl auth status。
  • 429:速率限制,请退避。
  • 媒体上传失败:请检查文件类型/大小和媒体处理状态。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills when explicitly requested; install, verify, update, uninstall, publish, or sync skills.

相关技能