$ show Panniantong/Agent-Reach
Agent Reach is a Python CLI tool that serves as a capability layer for AI agents, giving them one-click access to ~15 internet platforms (Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu, LinkedIn, etc.) without requiring manual setup. It does not wrap these platforms itself; instead, it selects, installs, health-checks, and routes to the most reliable upstream CLI tools (e.g., twitter-cli, yt-dlp, gh CLI, OpenCLI, mcporter) for each platform. The architecture is built around a multi-backend channel pattern: each platform has an ordered list of backends (primary + fallbacks), and the `doctor` command probes each candidate in order to determine the active backend. This design handles upstream tool instability gracefully by allowing fallback routing without code changes. The codebase demonstrates strong engineering practices: a clean Channel ABC with `check()` and `can_handle()` contracts, a robust probe system that distinguishes missing/broken/timeout/error by actual execution, security-hardened file operations (atomic private writes, symlink rejection, bounded reads), and SSRF protection in URL normalization. The CLI provides commands for installation (safe-by-default, read-only mode), diagnostics, configuration, and skill registration for agent environments (Claude Code, OpenClaw, Cursor, OpenCode). An optional MCP server exposes read-only status. Agent Reach is purely an application — there are no notebooks, data pipelines, or ML components. Its value lies in reducing the friction of giving agents internet access, with a focus on zero-config defaults for public platforms and cookie-based auth for login-required ones. The project is actively maintained, with documented responses to upstream API changes (e.g., Bilibili blocking yt-dlp, Twitter API pay-per-use).
The LLM identified 3 files worth highlighting for reuse:
Defines the Channel ABC with abstract `check()` and `can_handle()` methods, plus concrete `ordered_backends()` that respects user overrides. After `check()` runs, `active_backend` is set. This pattern allows adding new platforms by subclassing and implementing two methods, with fallback routing handled automatically. Reusable for any project needing a pluggable, health-checked backend selection system.
Implements `probe_command()` which actually executes a command and returns a structured result distinguishing missing (not found), broken (non-zero exit), timeout (exceeded limit), and error (unexpected exception). Used by YouTube, GitHub, Bilibili, and Boss channels to verify upstream tools. Reusable for any project that needs to health-check CLI dependencies with precise failure modes.
Provides `atomic_write_private_text()` (writes to temp file, renames, sets 0o600 permissions, rejects symlinks at target/parent/ancestor levels), `read_small_text_no_follow()` (bounded read, symlink refusal), and `make_private_dir()` (0o700). All operations are hardened against TOCTOU and symlink attacks. Reusable as a standalone security utility for any Python application that writes sensitive data to disk.