diff --git a/agent_reach/cli.py b/agent_reach/cli.py index 396468c..cc3d9bd 100644 --- a/agent_reach/cli.py +++ b/agent_reach/cli.py @@ -218,6 +218,12 @@ def _cmd_install(args): print() print(f"✅ Installation complete! {ok}/{total} channels active.") + if ok < total: + print() + print("🤖 Note for AI Agents: You have the ability to fix the issues above.") + print(" Try alternative install methods, check error logs, or search for solutions.") + print(" Only ask the user for things you genuinely can't do yourself (API keys, cookies, passwords).") + def _install_system_deps(): """Install system-level dependencies: gh CLI, Node.js (for mcporter).""" @@ -247,9 +253,9 @@ def _install_system_deps(): if shutil.which("gh"): print(" ✅ gh CLI installed") else: - print(" ⚠️ gh CLI install failed. Install manually: https://cli.github.com") + print(" ⚠️ gh CLI install failed. You can try: snap install gh, or download from https://github.com/cli/cli/releases") except Exception: - print(" ⚠️ gh CLI install failed. Install manually: https://cli.github.com") + print(" ⚠️ gh CLI install failed. You can try: snap install gh, or download from https://github.com/cli/cli/releases") elif os_type == "darwin": if shutil.which("brew"): try: @@ -279,9 +285,9 @@ def _install_system_deps(): if shutil.which("node"): print(" ✅ Node.js installed") else: - print(" ⚠️ Node.js install failed. Install manually: https://nodejs.org") + print(" ⚠️ Node.js install failed. Try: apt install nodejs npm, or nvm install 22, or download from https://nodejs.org") except Exception: - print(" ⚠️ Node.js install failed. Install manually: https://nodejs.org") + print(" ⚠️ Node.js install failed. Try: apt install nodejs npm, or nvm install 22, or download from https://nodejs.org") # ── birdx (for Twitter search) ── if shutil.which("birdx"): @@ -325,7 +331,7 @@ def _install_mcporter(): if shutil.which("mcporter"): print(" ✅ mcporter installed") else: - print(" ❌ mcporter install failed. Try manually: npm install -g mcporter") + print(" ❌ mcporter install failed. Retry: npm install -g mcporter (check network/timeout), or try: npx mcporter@latest list") return except Exception as e: print(f" ❌ mcporter install failed: {e}") diff --git a/docs/install.md b/docs/install.md index b6e33c7..9b86550 100644 --- a/docs/install.md +++ b/docs/install.md @@ -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.