How to Use the Agent-Reach CLI: Installation, Configuration, and Command Reference

Run agent-reach <subcommand> from your terminal to install platform tools, configure API keys and cookies, validate channel health, and register skills for AI agent runtimes.

The Agent-Reach CLI is the command-line interface for the Panniantong/Agent-Reach repository, providing deterministic installation and management of internet-facing platform tools that AI agents rely on. This lightweight interface orchestrates system dependencies, channel adapters, and runtime skills through a unified argparse-based dispatcher implemented in agent_reach/cli.py.

CLI Entry Point and Invocation

The CLI supports two equivalent invocation methods documented in the source:

  • python -m agent_reach.cli
  • The installed agent-reach shim (recommended after package installation)

Internally, the entry point constructs an argparse.ArgumentParser (lines 61-97 in agent_reach/cli.py) that defines available subcommands. After parsing arguments, an if/elif dispatch block (lines 126-166) routes execution to the appropriate handler function.

Core Commands Reference

Install Platform Dependencies

The install command runs a deterministic one-shot installer handled by _cmd_install (lines 71-124). It detects environment types (local vs. server), installs system dependencies, and optionally configures specific channel tools.


# Automatic environment detection

agent-reach install --env=auto

# Install specific channels only

agent-reach install --channels=twitter,reddit

Configure Secrets and Proxies

The configure command stores configuration values or auto-extracts browser cookies via _cmd_configure (lines 197-258). This modifies the YAML configuration managed by the Config class in agent_reach/config.py.


# Set API tokens

agent-reach configure github-token ghp_XXXXXXXXXXXXXXXXXXXX

# Configure network proxy (exports HTTP(S)_PROXY)

agent-reach configure proxy http://user:pass@proxy.example.com:8080

# Import cookies from Chrome automatically

agent-reach configure --from-browser chrome

Validate System Health

The doctor command checks availability of all configured channels through _cmd_doctor (lines 146-149). This handler delegates to agent_reach.doctor.check_all(Config()) and format_report() to aggregate channel status.

agent-reach doctor        # Human-readable report

agent-reach doctor --json # Machine-readable JSON output

Manage Agent Skills

The skill command installs or uninstalls Agent-Reach integration files for supported runtimes (OpenClaw, Claude Code, generic .agents directories) via _cmd_skill (lines 280-286).

agent-reach skill --install   # Install to .agents directory

agent-reach skill --uninstall # Remove integration files

Utility Commands

Additional specialized commands include:

  • format – Cleans raw API output (currently XiaoHongShu) via _cmd_format (lines 288-304)
  • transcribe – Whisper-based audio/video transcription with Groq-to-OpenAI fallback via _cmd_transcribe (lines 306-326)
  • watch – Health-check with version reminders for scheduled cron jobs via _cmd_watch (lines 332-334)
  • version – Prints package version from agent_reach.__init__ (handled in the top-level dispatcher at lines 141-145)

Complete Workflow Examples

Follow this sequence to set up Agent-Reach for AI agent consumption:

  1. Install core dependencies:
agent-reach install --env=auto
  1. Configure authentication:
agent-reach configure github-token $GITHUB_TOKEN
agent-reach configure --from-browser chrome
  1. Verify channel readiness:
agent-reach doctor
  1. Install runtime skill:
agent-reach skill --install

Processing XiaoHongShu data:

cat raw_data.json | agent-reach format xhs

Transcribing audio content:

agent-reach transcribe https://example.com/podcast.mp3 -o transcript.txt

Source Code Architecture

The CLI implementation follows a minimal, modular design with clear separation of concerns:

File Function
agent_reach/cli.py Argument parsing (lines 61-97), command dispatch (lines 126-166), handler implementations
agent_reach/doctor.py Health check aggregation (check_all, format_report)
agent_reach/config.py YAML configuration management (Config class)
agent_reach/channels/ Platform-specific adapters (Twitter, Reddit, YouTube)
agent_reach/skill/ Skill markdown files installed by the skill command

The parser construction uses standard argparse as shown in this excerpt from cli.py:

parser = argparse.ArgumentParser(
    prog="agent-reach",
    description="Give your AI Agent eyes to see the entire internet",
)
sub = parser.add_subparsers(dest="command", help="Available commands")
sub.add_parser("install", help="One-shot installer with flags")
sub.add_parser("doctor", help="Check platform availability")

# ... additional subparsers

args = parser.parse_args()

Summary

  • The Agent-Reach CLI provides deterministic installation and configuration for AI agent platform tools through the agent-reach command.
  • Core commands include install for system setup, configure for secrets management, doctor for health validation, and skill for runtime integration.
  • All commands are dispatched from agent_reach/cli.py through an argparse parser that delegates to specific handler functions like _cmd_install and _cmd_doctor.
  • The architecture separates concerns into dedicated modules: doctor.py for health checks, config.py for settings, and channels/ for platform adapters.

Frequently Asked Questions

How do I run the Agent-Reach CLI after installation?

You can invoke the CLI using either python -m agent_reach.cli or the agent-reach command if the package is installed in your PATH. Both methods execute the argument parser defined in agent_reach/cli.py lines 61-97 and route to the appropriate handler based on the subcommand provided.

What is the difference between agent-reach install and agent-reach skill?

The install command (_cmd_install, lines 71-124) sets up system dependencies and channel tools required for platform access, while the skill command (_cmd_skill, lines 280-286) installs markdown integration files into AI agent runtimes like Claude Code or OpenClaw. The skill installation enables those agents to discover and utilize Agent-Reach capabilities through their native tool-calling mechanisms.

How does the doctor command check platform availability?

The doctor command calls _cmd_doctor (lines 146-149), which imports check_all and format_report from agent_reach.doctor. This aggregates status checks across all configured channels using the Config class and outputs either human-readable text or JSON when using the --json flag, allowing both manual verification and automated monitoring.

Can I extract browser cookies automatically using the CLI?

Yes, the configure command supports automatic cookie extraction via the --from-browser flag implemented in _cmd_configure (lines 197-258). Run agent-reach configure --from-browser chrome to extract authentication cookies from Chrome for all supported platforms without manual copy-pasting, storing them securely in the Agent-Reach configuration file.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →