feat: migrate Twitter backend from bird CLI to xreach CLI
bird CLI (@steipete/bird) is deprecated and no longer maintained. xreach CLI (xreach-cli on npm) is our maintained fork with: - Fixed SearchTimeline (POST + updated query ID) - Built-in proxy rotation support - Additional features (DMs, notifications, lists) Changes across 11 files: - channels/twitter.py: detect xreach instead of bird/birdx - cli.py: install/doctor/uninstall all reference xreach-cli - SKILL.md: updated command examples (bird read → xreach tweet) - guides/setup-twitter.md: rewritten for xreach - docs/troubleshooting.md: updated proxy guidance - README.md + README_en.md: all references updated - config.py: twitter_bird → twitter_xreach - core.py, mcp_server.py: comment updates npm package: https://www.npmjs.com/package/xreach-cli Source: https://github.com/Panniantong/xfetch
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Twitter/X — check if bird CLI is available."""
|
||||
"""Twitter/X — check if xreach CLI is available."""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -9,7 +9,7 @@ from .base import Channel
|
||||
class TwitterChannel(Channel):
|
||||
name = "twitter"
|
||||
description = "Twitter/X 推文"
|
||||
backends = ["bird CLI"]
|
||||
backends = ["xreach CLI"]
|
||||
tier = 1
|
||||
|
||||
def can_handle(self, url: str) -> bool:
|
||||
@@ -18,21 +18,21 @@ class TwitterChannel(Channel):
|
||||
return "x.com" in d or "twitter.com" in d
|
||||
|
||||
def check(self, config=None):
|
||||
bird = shutil.which("bird") or shutil.which("birdx")
|
||||
if not bird:
|
||||
xreach = shutil.which("xreach")
|
||||
if not xreach:
|
||||
return "warn", (
|
||||
"bird CLI 未安装。搜索可通过 Exa 替代。安装:\n"
|
||||
" npm install -g @steipete/bird"
|
||||
"xreach CLI 未安装。搜索可通过 Exa 替代。安装:\n"
|
||||
" npm install -g xreach-cli"
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[bird, "whoami"], capture_output=True, text=True, timeout=10
|
||||
[xreach, "auth", "check"], capture_output=True, text=True, timeout=10
|
||||
)
|
||||
if r.returncode == 0:
|
||||
return "ok", "完整可用(读取、搜索推文)"
|
||||
return "warn", (
|
||||
"bird CLI 已安装但未配置 Cookie。运行:\n"
|
||||
"xreach CLI 已安装但未配置 Cookie。运行:\n"
|
||||
" agent-reach configure twitter-cookies \"auth_token=xxx; ct0=yyy\""
|
||||
)
|
||||
except Exception:
|
||||
return "warn", "bird CLI 已安装但连接失败"
|
||||
return "warn", "xreach CLI 已安装但连接失败"
|
||||
|
||||
Reference in New Issue
Block a user