feat: 添加 Agent 自修复提示——让用户的 Agent 自己解决安装问题

核心改动:
1. install.md 加入 Agent 指令:'You are a capable AI Agent. If a tool
   fails, try another method. Don't give up after one attempt.'
2. install.md 加入常见问题自修复表(9 种场景 + 对应解法)
3. CLI 错误输出改为 Agent-friendly 语气,给出替代方案而非只说失败
4. install 结束时如果有未激活渠道,提示 Agent 自行修复
This commit is contained in:
Panniantong
2026-02-24 15:32:25 +01:00
parent d52520a17e
commit db3f292228
2 changed files with 31 additions and 5 deletions
+20
View File
@@ -12,6 +12,8 @@ Copy this to your AI Agent:
## For AI Agents
**Important: You are an AI Agent with problem-solving abilities. If any step below fails, don't just report the error — diagnose and fix it yourself. You have shell access, you can search for solutions, try alternative install methods, and debug issues. Only ask the user when you genuinely need their input (API keys, cookies, passwords).**
### Step 1: Install
```bash
@@ -29,6 +31,24 @@ This single command does everything automatically:
**Read the output carefully.** It tells you exactly what happened and what's next.
### Troubleshooting (self-fix before asking the user)
If `agent-reach install` shows warnings or failures, try fixing them yourself:
| Problem | What you can do |
|---------|----------------|
| `pip install` fails with `--break-system-packages` | Add the flag: `pip install --break-system-packages ...` or create a venv first |
| `npm install -g mcporter` timeout | Retry with longer timeout, or try: `npx mcporter@latest list` (uses npx without global install) |
| `gh` CLI install fails | Try: `conda install gh`, `snap install gh`, or download binary from https://github.com/cli/cli/releases |
| `node`/`npm` not found after install | Check `export PATH` or try: `apt install nodejs npm` / `brew install node` |
| `mcporter config add exa` fails | Run manually: `mcporter config add exa https://mcp.exa.ai/mcp` |
| `yt-dlp` not found | `pip install yt-dlp` or `pip3 install yt-dlp` |
| `birdx` not found | `pip install birdx` — optional, Twitter reading still works without it |
| Permission denied | Run with `sudo` or fix directory permissions |
| Any Python package conflict | Create a venv: `python3 -m venv ~/agent-reach-env && source ~/agent-reach-env/bin/activate` then reinstall |
**General principle: You're a capable AI Agent. If a tool fails to install via one method, try another. Check error messages, search for solutions, and iterate. Don't give up after one attempt.**
### Step 2: Only if needed — configure what's missing
Based on the install output, you may need to configure one or two things.