diff --git a/README.md b/README.md index 094d695..2c4d832 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,18 @@ agent-reach install --env=auto ``` +
+以 Skill 形式安装(Claude Code / OpenClaw / 任何支持 Skills 的 Agent) + +```bash +npx skills add Panniantong/Agent-Reach@agent-reach +``` + +安装后,Agent 会在 Skill 列表中看到 `agent-reach`,自动知道如何使用所有搜索和阅读能力。 + +> 如果通过 `agent-reach install` 安装,Skill 会自动注册,无需额外操作。 +
+ --- ## 装好就能用 diff --git a/agent-reach/SKILL.md b/agent-reach/SKILL.md new file mode 100644 index 0000000..555d6bf --- /dev/null +++ b/agent-reach/SKILL.md @@ -0,0 +1,69 @@ +--- +name: agent-reach +description: > + Give your AI agent eyes to see the entire internet. Read and search across + Twitter/X, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu, RSS, and any web page + — all from a single CLI. Use when: (1) reading content from URLs (tweets, Reddit posts, + articles, videos), (2) searching across platforms (web, Twitter, Reddit, GitHub, YouTube, + Bilibili, XiaoHongShu), (3) checking channel health or updating Agent Reach. + Triggers: "search Twitter/Reddit/YouTube", "read this URL", "find posts about", + "搜索", "读取", "查一下", "看看这个链接". +--- + +# Agent Reach + +Read and search the internet across 9+ platforms via unified CLI. + +## Commands + +### Read any URL +```bash +agent-reach read +agent-reach read --json # structured output +``` +Handles: tweets, Reddit posts, articles, YouTube (transcripts), GitHub repos, etc. + +### Search + +```bash +agent-reach search "query" # web search (Exa) +agent-reach search-twitter "query" # Twitter/X +agent-reach search-reddit "query" # Reddit (--sub ) +agent-reach search-github "query" # GitHub (--lang ) +agent-reach search-youtube "query" # YouTube +agent-reach search-bilibili "query" # Bilibili (B站) +agent-reach search-xhs "query" # XiaoHongShu (小红书) +``` + +All search commands support `-n ` for number of results. + +### Management + +```bash +agent-reach doctor # channel status overview +agent-reach watch # quick health + update check (for scheduled tasks) +agent-reach check-update # check for new versions +``` + +### Configure channels + +```bash +agent-reach configure twitter-cookies "auth_token=xxx; ct0=yyy" +agent-reach configure proxy http://user:pass@ip:port +agent-reach configure --from-browser chrome # auto-extract cookies +``` + +## Channel Status Tiers + +- **Tier 0 (zero config):** Web, YouTube, RSS, Twitter (read-only via Jina) +- **Tier 1 (free setup):** Exa web search (mcporter required) +- **Tier 2 (user config):** Twitter search (cookie), Reddit full (proxy), GitHub (token), Bilibili (proxy), XiaoHongShu (MCP) + +Run `agent-reach doctor` to see which channels are active. + +## Tips + +- Always try `agent-reach read ` first for any URL — it auto-detects the platform +- For Twitter cookies, recommend the user install [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) Chrome extension +- Reddit and Bilibili block server IPs — suggest a residential proxy (~$1/month) if on a server +- If a channel breaks, run `agent-reach doctor` to diagnose diff --git a/agent_reach/cli.py b/agent_reach/cli.py index def241b..68e1bd7 100644 --- a/agent_reach/cli.py +++ b/agent_reach/cli.py @@ -234,6 +234,10 @@ def _cmd_install(args): print() print(format_report(results)) print() + + # ── Install agent skill ── + _install_skill() + print(f"✅ Installation complete! {ok}/{total} channels active.") if ok < total: @@ -241,6 +245,47 @@ def _cmd_install(args): print("🤖 Some channels are not active yet. If you're an AI Agent, try to fix them yourself — then run `agent-reach doctor` again.") +def _install_skill(): + """Install Agent Reach as an agent skill (OpenClaw / Claude Code).""" + import os + import importlib.resources + + # Determine skill install path + skill_dirs = [ + os.path.expanduser("~/.openclaw/skills"), # OpenClaw + os.path.expanduser("~/.claude/skills"), # Claude Code (if exists) + os.path.expanduser("~/.agents/skills"), # Generic agents + ] + + installed = False + for skill_dir in skill_dirs: + if os.path.isdir(skill_dir): + target = os.path.join(skill_dir, "agent-reach") + try: + os.makedirs(target, exist_ok=True) + # Read SKILL.md from package data + skill_md = importlib.resources.files("agent_reach").joinpath("skill", "SKILL.md").read_text() + with open(os.path.join(target, "SKILL.md"), "w") as f: + f.write(skill_md) + platform_name = "OpenClaw" if "openclaw" in skill_dir else "Claude Code" if "claude" in skill_dir else "Agent" + print(f"🧩 Skill installed for {platform_name}: {target}") + installed = True + except Exception: + pass + + if not installed: + # No known skill directory found — create for OpenClaw by default + target = os.path.expanduser("~/.openclaw/skills/agent-reach") + try: + os.makedirs(target, exist_ok=True) + skill_md = importlib.resources.files("agent_reach").joinpath("skill", "SKILL.md").read_text() + with open(os.path.join(target, "SKILL.md"), "w") as f: + f.write(skill_md) + print(f"🧩 Skill installed: {target}") + except Exception: + print(" ⬜ Could not install agent skill (optional)") + + def _install_system_deps(): """Install system-level dependencies: gh CLI, Node.js (for mcporter).""" import shutil diff --git a/agent_reach/skill/SKILL.md b/agent_reach/skill/SKILL.md new file mode 100644 index 0000000..555d6bf --- /dev/null +++ b/agent_reach/skill/SKILL.md @@ -0,0 +1,69 @@ +--- +name: agent-reach +description: > + Give your AI agent eyes to see the entire internet. Read and search across + Twitter/X, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu, RSS, and any web page + — all from a single CLI. Use when: (1) reading content from URLs (tweets, Reddit posts, + articles, videos), (2) searching across platforms (web, Twitter, Reddit, GitHub, YouTube, + Bilibili, XiaoHongShu), (3) checking channel health or updating Agent Reach. + Triggers: "search Twitter/Reddit/YouTube", "read this URL", "find posts about", + "搜索", "读取", "查一下", "看看这个链接". +--- + +# Agent Reach + +Read and search the internet across 9+ platforms via unified CLI. + +## Commands + +### Read any URL +```bash +agent-reach read +agent-reach read --json # structured output +``` +Handles: tweets, Reddit posts, articles, YouTube (transcripts), GitHub repos, etc. + +### Search + +```bash +agent-reach search "query" # web search (Exa) +agent-reach search-twitter "query" # Twitter/X +agent-reach search-reddit "query" # Reddit (--sub ) +agent-reach search-github "query" # GitHub (--lang ) +agent-reach search-youtube "query" # YouTube +agent-reach search-bilibili "query" # Bilibili (B站) +agent-reach search-xhs "query" # XiaoHongShu (小红书) +``` + +All search commands support `-n ` for number of results. + +### Management + +```bash +agent-reach doctor # channel status overview +agent-reach watch # quick health + update check (for scheduled tasks) +agent-reach check-update # check for new versions +``` + +### Configure channels + +```bash +agent-reach configure twitter-cookies "auth_token=xxx; ct0=yyy" +agent-reach configure proxy http://user:pass@ip:port +agent-reach configure --from-browser chrome # auto-extract cookies +``` + +## Channel Status Tiers + +- **Tier 0 (zero config):** Web, YouTube, RSS, Twitter (read-only via Jina) +- **Tier 1 (free setup):** Exa web search (mcporter required) +- **Tier 2 (user config):** Twitter search (cookie), Reddit full (proxy), GitHub (token), Bilibili (proxy), XiaoHongShu (MCP) + +Run `agent-reach doctor` to see which channels are active. + +## Tips + +- Always try `agent-reach read ` first for any URL — it auto-detects the platform +- For Twitter cookies, recommend the user install [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) Chrome extension +- Reddit and Bilibili block server IPs — suggest a residential proxy (~$1/month) if on a server +- If a channel breaks, run `agent-reach doctor` to diagnose diff --git a/docs/README_en.md b/docs/README_en.md index 5a73af4..ea609d7 100644 --- a/docs/README_en.md +++ b/docs/README_en.md @@ -88,6 +88,18 @@ agent-reach install --env=auto ``` +
+Install as a Skill (Claude Code / OpenClaw / any agent with Skills support) + +```bash +npx skills add Panniantong/Agent-Reach@agent-reach +``` + +Once installed, your Agent will see `agent-reach` in its skill list and automatically know how to use all search and read capabilities. + +> If you install via `agent-reach install`, the skill is registered automatically — no extra steps needed. +
+ --- ## Works Out of the Box diff --git a/pyproject.toml b/pyproject.toml index 4f87f4c..791da01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,3 +51,4 @@ packages = ["agent_reach"] [tool.hatch.build.targets.wheel.force-include] "agent_reach/guides" = "agent_reach/guides" +"agent_reach/skill" = "agent_reach/skill"