Skip to content

Commit 65ff8d6

Browse files
Panniantongclaude
andcommitted
docs: rewrite update.md for v1.4.0 upstream migrations
update.md now handles the full update lifecycle autonomously: - Installs new CLI tools (twitter-cli, rdt-cli, xhs-cli, bili-cli) - Removes deprecated bird CLI - Updates SKILL.md + references/ with fallback - Reports changes to user install.md: update tool references (bird→twitter-cli, Exa→rdt-cli). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0f9cfe6 commit 65ff8d6

File tree

2 files changed

+89
-27
lines changed

2 files changed

+89
-27
lines changed

docs/install.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Copy this to your AI Agent:
2020
2121
### Goal
2222
23-
Install Agent Reach and all upstream tools so your user's agent has full internet access. After installation, you'll use the upstream tools directly (bird CLI, yt-dlp, mcporter, gh CLI, etc.) — Agent Reach is just the installer and health checker.
23+
Install Agent Reach and all upstream tools so your user's agent has full internet access. After installation, you'll use the upstream tools directly (twitter-cli, rdt-cli, xhs-cli, yt-dlp, mcporter, gh CLI, etc.) — Agent Reach is just the installer and health checker.
2424
2525
### ⚠️ Boundaries
2626
@@ -140,8 +140,7 @@ agent-reach configure twitter-cookies "PASTED_STRING"
140140

141141
> **代理说明(中国大陆等需要翻墙的网络环境):**
142142
>
143-
> bird CLI 使用 Node.js,在需要代理的网络环境下可通过环境变量配置代理。
144-
> Agent Reach 安装时会自动安装 `undici``npm install -g undici`)以提供代理支持。
143+
> twitter-cli 和 rdt-cli 使用 Python,在需要代理的网络环境下可通过环境变量配置代理。
145144
>
146145
> **你(Agent)需要做的:**
147146
> 1. 确认用户配了代理:`agent-reach configure proxy http://user:pass@ip:port`
@@ -385,10 +384,10 @@ After installation, use upstream tools directly. See SKILL.md for the full comma
385384

386385
| Platform | Upstream Tool | Example |
387386
|----------|--------------|---------|
388-
| Twitter/X | `bird` | `bird search "query" -n 10` |
387+
| Twitter/X | `twitter` | `twitter search "query" -n 10` |
389388
| YouTube | `yt-dlp` | `yt-dlp --dump-json URL` |
390-
| Bilibili | `yt-dlp` | `yt-dlp --dump-json URL` |
391-
| Reddit | `mcporter` (Exa) | `mcporter call 'exa.web_search_exa(query: "...", includeDomains: ["reddit.com"])'` |
389+
| Bilibili | `yt-dlp` + `bili` | `bili hot` / `bili search "query" --type video` |
390+
| Reddit | `rdt` | `rdt search "query"` / `rdt read POST_ID` |
392391
| GitHub | `gh` | `gh search repos "query"` |
393392
| Web | `curl` + Jina | `curl -s "https://r.jina.ai/URL"` |
394393
| Exa Search | `mcporter` | `mcporter call 'exa.web_search_exa(...)'` |

docs/update.md

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,52 +24,115 @@ Update Agent Reach: https://raw.githubusercontent.com/Panniantong/agent-reach/ma
2424

2525
### Goal
2626

27-
Update Agent Reach to the latest version, then verify everything still works.
27+
Update Agent Reach to the latest version, install any new upstream tools, migrate from deprecated tools, and verify everything works. The user should not need to do anything manually.
2828

2929
### Step 1: Check current version
3030

3131
```bash
3232
agent-reach check-update
3333
```
3434

35-
If it says "已是最新版本", you're done — tell the user.
35+
If it says "已是最新版本", skip to Step 5 (verify). Otherwise continue.
3636

37-
### Step 2: Update
37+
### Step 2: Update Agent Reach package
3838

3939
```bash
4040
pip install --upgrade https://github.com/Panniantong/agent-reach/archive/main.zip
4141
```
4242

43-
### Step 3: Verify
43+
### Step 3: Install / migrate upstream tools
44+
45+
Run these commands to ensure all upstream CLI tools are installed. Skip any that are already installed.
4446

4547
```bash
46-
agent-reach version
47-
agent-reach doctor
48+
# === Required tools (core functionality) ===
49+
50+
# Twitter/X — twitter-cli (replaces deprecated bird CLI)
51+
which twitter >/dev/null 2>&1 || pipx install twitter-cli 2>/dev/null || uv tool install twitter-cli 2>/dev/null
52+
53+
# Reddit — rdt-cli (replaces Exa-based approach)
54+
which rdt >/dev/null 2>&1 || pipx install rdt-cli 2>/dev/null || uv tool install rdt-cli 2>/dev/null
55+
56+
# XiaoHongShu — xhs-cli (replaces Docker MCP)
57+
which xhs >/dev/null 2>&1 || pipx install xiaohongshu-cli 2>/dev/null || uv tool install xiaohongshu-cli 2>/dev/null
58+
59+
# === Optional enhancements ===
60+
61+
# Bilibili — bili-cli (adds hot/rank/search on top of yt-dlp)
62+
which bili >/dev/null 2>&1 || pipx install bilibili-cli 2>/dev/null || uv tool install bilibili-cli 2>/dev/null
63+
64+
# mcporter + Exa (for WeChat, web search)
65+
which mcporter >/dev/null 2>&1 || npm install -g mcporter 2>/dev/null
66+
67+
# yt-dlp (YouTube + Bilibili video)
68+
which yt-dlp >/dev/null 2>&1 || pip install yt-dlp 2>/dev/null
69+
70+
# gh CLI (GitHub)
71+
which gh >/dev/null 2>&1 || echo "GitHub CLI not installed — see https://cli.github.com"
4872
```
4973

50-
Report the new version and channel status to the user. If any channel changed status (was ✅ now ❌), investigate and fix.
74+
### Step 4: Clean up deprecated tools
5175

52-
### Step 4: Update SKILL.md (if installed)
76+
```bash
77+
# Remove bird CLI (repo deleted, replaced by twitter-cli)
78+
which bird >/dev/null 2>&1 && npm uninstall -g @steipete/bird 2>/dev/null && echo "✅ Removed deprecated bird CLI"
5379

54-
If the user has the Agent Reach skill installed, update it too:
80+
# Note: browser_cookie3 is still supported as fallback, no need to remove
81+
# Note: miku_ai is no longer needed (WeChat now uses Exa), but no harm keeping it
82+
```
83+
84+
### Step 5: Verify
5585

5686
```bash
57-
agent-reach install --skill-only
87+
agent-reach version
88+
agent-reach doctor
5889
```
5990

60-
If the `--skill-only` flag is not available, manually copy the latest SKILL.md:
91+
Check the doctor output:
92+
- All channels should show ✅ or ⚠️ (with clear instructions)
93+
- If any channel that was working before now shows ❌, investigate:
94+
- Twitter: needs `twitter-cli` + browser cookies (run `xhs login` pattern)
95+
- Reddit: needs `rdt-cli` (should be installed in Step 3)
96+
- XiaoHongShu: needs `xhs-cli` + login (run `xhs login`)
97+
- WeChat: should work via Exa (zero config)
98+
99+
### Step 6: Update SKILL.md (if installed)
61100

62101
```bash
63-
python3 -c "
64-
import importlib.resources, shutil, os
65-
skill = importlib.resources.files('agent_reach').joinpath('skill', 'SKILL.md').read_text()
66-
for d in [os.path.expanduser('~/.openclaw/skills/agent-reach'),
67-
os.path.expanduser('~/.claude/skills/agent-reach')]:
68-
if os.path.isdir(d):
69-
with open(os.path.join(d, 'SKILL.md'), 'w') as f:
70-
f.write(skill)
71-
print(f'✅ Updated: {d}')
102+
agent-reach install --skill-only 2>/dev/null || python3 -c "
103+
import importlib.resources, os
104+
try:
105+
skill_pkg = importlib.resources.files('agent_reach').joinpath('skill')
106+
except Exception:
107+
from pathlib import Path
108+
skill_pkg = Path(os.path.dirname(os.path.abspath(__file__))).parent / 'agent_reach' / 'skill'
109+
110+
skill_md = skill_pkg.joinpath('SKILL.md').read_text(encoding='utf-8')
111+
refs_pkg = skill_pkg.joinpath('references')
112+
113+
for base in [os.path.expanduser('~/.openclaw/skills/agent-reach'),
114+
os.path.expanduser('~/.claude/skills/agent-reach'),
115+
os.path.expanduser('~/.agents/skills/agent-reach')]:
116+
if os.path.isdir(base):
117+
with open(os.path.join(base, 'SKILL.md'), 'w', encoding='utf-8') as f:
118+
f.write(skill_md)
119+
refs_dir = os.path.join(base, 'references')
120+
os.makedirs(refs_dir, exist_ok=True)
121+
for ref in refs_pkg.iterdir():
122+
name = ref.name if hasattr(ref, 'name') else str(ref).split('/')[-1]
123+
if name.endswith('.md'):
124+
with open(os.path.join(refs_dir, name), 'w', encoding='utf-8') as f:
125+
f.write(ref.read_text(encoding='utf-8'))
126+
print(f'✅ Updated skill: {base}')
72127
"
73128
```
74129

75-
Done. Tell the user what version they're now on and how many channels are available.
130+
### Step 7: Report to user
131+
132+
Tell the user:
133+
1. What version they're now on (`agent-reach version`)
134+
2. How many channels are available (count ✅ in doctor output)
135+
3. Any channels that need their action (e.g., `xhs login` for XiaoHongShu, browser cookies for Twitter)
136+
4. What changed in this update (major: Twitter/Reddit/XiaoHongShu upstream tools migrated for better stability)
137+
138+
Done.

0 commit comments

Comments
 (0)