服务器(无 UI 界面)用户无法直接扫码登录小红书,补充说明最方便的方式: 在自己电脑登录后用 Cookie-Editor 导出 Cookie 发给 Agent 配置。 - install.md: 小红书登录方式分本地/服务器两种场景说明 - README.md: Cookie 提示补充服务器用户指引
116 lines
5 KiB
Markdown
116 lines
5 KiB
Markdown
# Agent Reach — Installation Guide
|
||
|
||
## For Humans
|
||
|
||
Copy this to your AI Agent:
|
||
|
||
```
|
||
帮我安装 Agent Reach:https://raw.githubusercontent.com/Panniantong/agent-reach/main/docs/install.md
|
||
```
|
||
|
||
---
|
||
|
||
## For AI Agents
|
||
|
||
### Goal
|
||
|
||
Install Agent Reach and make sure **all channels are working**. Your user expects you to have full internet access capabilities when this is done — reading tweets, searching Reddit, watching YouTube, browsing GitHub, and more.
|
||
|
||
### Step 1: Install
|
||
|
||
```bash
|
||
pip install https://github.com/Panniantong/agent-reach/archive/main.zip
|
||
agent-reach install --env=auto
|
||
```
|
||
|
||
This auto-installs system dependencies (gh CLI, Node.js, mcporter, bird), configures Exa search, detects environment, and tests all channels.
|
||
|
||
**Read the output carefully**, then run:
|
||
|
||
```bash
|
||
agent-reach doctor
|
||
```
|
||
|
||
### Step 2: Fix what's broken
|
||
|
||
`agent-reach doctor` shows you which channels are active and which aren't.
|
||
|
||
**Your goal is to get as many channels to ✅ as possible.** If something failed during install or shows as ❌/⚠️ in doctor, fix it yourself. You're a capable AI Agent — diagnose the problem, try alternative approaches, and iterate until it works.
|
||
|
||
Only ask the user when you genuinely need their input (see below).
|
||
|
||
### Step 3: Configure things that need user input
|
||
|
||
Some channels need credentials only the user can provide. Based on the doctor output, ask for what's missing:
|
||
|
||
**Twitter search & posting (server users):**
|
||
> "To unlock Twitter search, I need your Twitter cookies. Install the Cookie-Editor Chrome extension, go to x.com/twitter.com, click the extension → Export → Header String, and paste it to me."
|
||
> Extension: https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm
|
||
|
||
```bash
|
||
agent-reach configure twitter-cookies "PASTED_STRING"
|
||
```
|
||
|
||
**Reddit & Bilibili full access (server users):**
|
||
> "Reddit and Bilibili block server IPs. To unlock full access, I need a residential proxy. You can get one at https://webshare.io ($1/month). Send me the proxy address."
|
||
|
||
```bash
|
||
agent-reach configure proxy http://user:pass@ip:port
|
||
```
|
||
|
||
**XiaoHongShu / 小红书 (需要 Docker):**
|
||
> "小红书需要一个 MCP 服务。需要你的机器上有 Docker。安装好 Docker 后我来搞定剩下的。"
|
||
|
||
```bash
|
||
docker run -d --name xiaohongshu-mcp -p 18060:18060 xpzouying/xiaohongshu-mcp
|
||
mcporter config add xiaohongshu http://localhost:18060/mcp
|
||
```
|
||
|
||
> 如果在服务器上,建议加代理避免 IP 风控:
|
||
> `docker run -d --name xiaohongshu-mcp -p 18060:18060 -e XHS_PROXY=http://user:pass@ip:port xpzouying/xiaohongshu-mcp`
|
||
>
|
||
> **登录方式:**
|
||
> - **本地电脑(有浏览器):** 打开 http://localhost:18060 扫码登录即可。
|
||
> - **服务器(无 UI 界面):** 服务器上通常没有浏览器,无法直接扫码。最方便的方式是在自己的电脑上用浏览器登录小红书,然后用 [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) 插件导出 Cookie(Header String 格式),发给 Agent 即可完成配置。详见 [Cookie 导出指南](cookie-export.md)。
|
||
|
||
### Step 4: Final check
|
||
|
||
Run `agent-reach doctor` one final time and report the results to your user.
|
||
|
||
### Step 5: Set up daily monitoring (OpenClaw only)
|
||
|
||
If you are running inside **OpenClaw**, ask your user:
|
||
|
||
> "Agent Reach 安装好了。要不要我设一个每天自动检查的任务?它会帮你盯着这些渠道是否正常、有没有新版本。有问题才会通知你,没问题不打扰。"
|
||
|
||
If the user agrees, create a **cron job** (daily, `sessionTarget: "isolated"`, `delivery: "announce"`) with this task:
|
||
|
||
```
|
||
运行 agent-reach watch 命令。
|
||
如果输出包含"全部正常",不需要通知用户,静默结束。
|
||
如果输出包含问题(❌ ⚠️)或新版本(🆕),把完整报告发给用户,并建议修复方案。
|
||
如果有新版本可用,问用户是否要升级(升级命令:pip install --upgrade https://github.com/Panniantong/agent-reach/archive/main.zip)。
|
||
```
|
||
|
||
If the user wants a different agent to handle it, let them choose.
|
||
|
||
---
|
||
|
||
## Quick Reference
|
||
|
||
| Command | What it does |
|
||
|---------|-------------|
|
||
| `agent-reach install --env=auto` | Full auto-setup (installs deps + configures) |
|
||
| `agent-reach doctor` | Show channel status |
|
||
| `agent-reach watch` | Quick health + update check (for scheduled tasks) |
|
||
| `agent-reach check-update` | Check for new versions |
|
||
| `agent-reach configure twitter-cookies "..."` | Unlock Twitter search + posting |
|
||
| `agent-reach configure proxy URL` | Unlock Reddit + Bilibili on servers |
|
||
| `agent-reach read <url>` | Read any URL |
|
||
| `agent-reach search "query"` | Search the web |
|
||
| `agent-reach search-reddit "query"` | Search Reddit |
|
||
| `agent-reach search-twitter "query"` | Search Twitter |
|
||
| `agent-reach search-github "query"` | Search GitHub |
|
||
| `agent-reach search-youtube "query"` | Search YouTube |
|
||
| `agent-reach search-bilibili "query"` | Search Bilibili |
|
||
| `agent-reach search-xhs "query"` | Search XiaoHongShu |
|