Community写作与编辑github.com

steipete/xurl

xurl X API CLI:安装、认证、应用选择、快捷命令与原始端点。

xurl 是什么?

xurl 是 X API 的官方命令行工具,为开发者提供了一种高效、安全地通过终端与 X 平台交互的方式。该工具基于 GitHub 上的 xdevplatform/xurl 项目,支持通过 Homebrew、npm、Shell 脚本和 Go 等多种方式安装。用户可以执行发帖、回复、搜索、关注、私信等常用操作,也能通过原始端点模式直接调用任意 X API。 在使用时,安全是核心注意事项:工具强烈要求不要在 LLM 上下文中暴露认证配置文件或密钥,也不要在用户代理会话中出现内联秘密。认证流程通过 `xurl auth` 命令管理,支持 OAuth 1.0a 和 OAuth 2.0,并且可以配置多个应用和多个账户。原始端点模式支持 GET、POST JSON、自定义头、流式响应以及认证类型选择,使得 xurl 成为 AI 代理和自动化脚本中与 X 集成的理想选择。

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

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

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

文档

xurl 是做什么的?

X API 的官方 CLI。

主上游仓库:https://github.com/xdevplatform/xurl

安装

Homebrew:

brew install --cask xdevplatform/tap/xurl

npm:

npm install -g @xdevplatform/xurl

Shell 脚本:

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

Go:

go install github.com/xdevplatform/xurl@latest

安全

  • 切勿读取、打印、总结、上传或粘贴 ~/.xurl 到 LLM 上下文中。
  • 切勿要求用户将客户端密钥、Bearer 令牌或 OAuth 令牌粘贴到聊天中。
  • 在代理运行时切勿使用 --verbose;这可能导致认证头暴露。
  • 不要在代理会话中使用内联秘密标志运行认证命令。
  • 用户必须在代理会话之外,在其机器上手动注册应用凭据。

认证

检查当前状态:

xurl auth status

如果已注册应用,完成 OAuth 2.0:

xurl auth oauth2

多应用:

xurl auth apps list
xurl auth default my-app
xurl auth default my-app alice
xurl --app dev-app /2/users/me

注意事项:

  • xurl 将应用配置和令牌存储在 ~/.xurl 中。
  • X 开发者门户中的 OAuth 2.0 回调 URI 应设置为 http://localhost:8080/callback。
  • 此处有意省略了内联秘密的应用注册示例。请务必在代理会话之外进行注册。

常用快捷命令

xurl post "Hello world!"
xurl reply 1234567890 "Nice post"
xurl quote 1234567890 "My take"
xurl delete 1234567890

xurl read 1234567890
xurl search "from:elonmusk" -n 10
xurl whoami
xurl user @XDevelopers
xurl timeline -n 20
xurl mentions -n 10

xurl like 1234567890
xurl unlike 1234567890
xurl repost 1234567890
xurl unrepost 1234567890

xurl bookmark 1234567890
xurl unbookmark 1234567890
xurl bookmarks -n 10
xurl likes -n 10

xurl follow @handle
xurl unfollow @handle
xurl following -n 20
xurl followers -n 20

xurl dm @handle "message"
xurl dms -n 10

xurl media upload path/to/file.mp4
xurl media status MEDIA_ID

POST_ID 也可以是完整的 X 状态 URL。

原始端点模式

GET:

xurl /2/users/me

POST JSON:

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

自定义头:

xurl -H "Content-Type: application/json" /2/tweets

选择认证类型:

xurl --auth oauth2 /2/users/me
xurl --auth oauth1 /2/tweets
xurl --auth app /2/users/me

选择 OAuth2 账户:

xurl --username alice /2/users/me

流式响应:

xurl /2/tweets/search/stream
xurl -s /2/users/me

快速检查

安装:

xurl version

认证:

xurl auth status

认证后的实时请求:

xurl whoami

Individual skills in this repo

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

steipete/agent-transcript

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

steipete/beeper

Beeper cache: contact hints, room lookup, WhatsApp/iMessage traces, FTS.

steipete/browser-use

Existing Chrome automation: Chrome plugin first, mcporter fallback.

steipete/clawsweeper-status

ClawSweeper status: URLs, workflow health, active workers, ops snapshot.

steipete/clickclack

ClickClack ops: chat app, Hetzner deploy, DNS/docs/app, Docker rollout.

steipete/cloudflare-registrar

Cloudflare Registrar: domain availability, prices, registration via mcporter.

steipete/codex-debugging

Codex debugging: codex-rs core/tui/exec/cli/app-server/config.

steipete/create-cli

CLI UX/spec: args, flags, help, output, errors, config, dry-run.

steipete/discord-clawd

Discord-backed OpenClaw agent/session relay; not archive search.

steipete/domain-dns-ops

DNS/domain ops: registrars, zones, redirects, DNS/HTTP verify, manager truth.

steipete/frontend-design

Frontend UI: pages, apps, components, polished non-generic design.

steipete/github-author-context

GitHub contributor context: identity, activity, trust, company/team signal.

steipete/github-cache-hygiene

GitHub quota/cache hygiene: gh, ghx, xcache, gitcrawl, mirrors, limits.

steipete/github-deep-review

GitHub deep review: bugs, PRs, best fix, stale-or-real, read code first.

steipete/github-project-triage

GitHub issue/PR triage: queues, CI, blockers, risk, proof, next actions.

steipete/hopper-debugger

Hopper debugging: macOS/iOS binaries, ObjC/Swift symbols, dyld, LLDB.

steipete/instruments-profiling

Instruments/xctrace profiling: macOS/iOS traces, binaries, args, exports.

steipete/mac-maintenance

Mac upkeep: brew update/upgrade, pull clean repos, empty Trash.

steipete/maintainer-orchestrator

Open-source maintainer orchestration: Codex app workers, work recovery, dependencies, vision, releases.

steipete/markdown-converter

Markdown conversion: PDF, Office, HTML, data, OCR, audio, ZIP, YouTube.

相关技能