跳到正文
Skillpedia
社交媒体260k · #618

xurl

它能做什么

这项技能把你的 AI 连接到 X(原 Twitter),使其能够发帖、搜索帖子、发送私信并管理账户。适合在 X 上运营社交媒体账户、并希望由 AI 协助的人。

适用场景

  • ✓你想让 AI 在 X 上发帖、回复或引用某条帖子的时候。
  • ✓你想在 X 上搜索某个话题的帖子并获取详情的时候。
  • ✓你想发送私信、上传媒体或查看 X 上的提及的时候。

技能链接

https://github.com/NousResearch/hermes-agent/blob/main/skills/social-media/xurl/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/NousResearch/hermes-agent/blob/main/skills/social-media/xurl/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在 X 上搜索过去一天关于我们产品发布的帖子,并为其中最受欢迎的一条起草回复。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能运行官方的 xurl 命令行工具,它向 X API 发送请求并返回 JSON。你的 X 登录凭据保存在你自己填写的文件中,AI 从不读取该文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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 for raw posts (actual post JSON with IDs you can engage with) 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. In Docker, this must be the ~ seen by Hermes tool subprocesses; see the Docker note below.
  • 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.

Docker HOME pitfall: In the official Hermes Docker layout, /opt/data is HERMES_HOME, but Hermes tool subprocesses use /opt/data/home as HOME. That means ~/.xurl resolves to /opt/data/home/.xurl for Hermes-run `xur

常见问题

AI 能看到我的 X 密码或令牌吗?

不能。技能说明 AI 绝不能读取或打印凭据文件,该文件必须由你自己填写。

它能在我不批准的情况下发帖吗?

技能涵盖发帖和删帖,但并未说明 AI 可以在未经你检查的情况下发帖,因此请先检查它写的内容。

它会取代旧的 xitter 技能吗?

会。技能说明 xurl 取代了较早的 xitter 技能。

详情

作者的原始描述

X/Twitter via xurl CLI: raw post search, posting, DM, media.

repo: NousResearch/hermes-agent

热度

GitHub 星标
260k
排名
#618
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能