# Agent Reach Doctor Command Platform Availability Check: Complete Technical Guide

> Verify Agent Reach doctor command platform availability. This guide details the health check for YouTube, Twitter, GitHub, and Reddit, ensuring upstream tooling is configured and functional.

- Repository: [Pnant/Agent-Reach](https://github.com/Panniantong/Agent-Reach)
- Tags: how-to-guide
- Published: 2026-07-02

---

**The `agent-reach doctor` command performs a lightweight health check across all supported platforms (YouTube, Twitter, GitHub, Reddit, etc.) to verify that upstream tooling is installed, configured, and functional, outputting either a Rich-styled report or JSON for programmatic use.**

The `doctor` sub-command in the **Panniantong/Agent-Reach** repository provides instant visibility into which internet platforms are ready for your AI agents. This diagnostic tool inspects every supported channel without invoking heavy operations, ensuring your environment is properly configured before deployment.

## How the Doctor Command Works

The platform availability check follows a streamlined pipeline that gathers status from each channel's `check()` implementation and formats the results. In [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py), the `_cmd_doctor` function (line 1476) serves as the entry point, parsing optional flags like `--json` before invoking the core health-check engine.

The process flows through four distinct stages: the CLI creates a **Config** instance, calls `check_all(config)`, iterates over all registered channels, and finally renders either a human-readable Rich report or raw JSON output. Critically, this verification performs **lightweight probes only**—using methods like `shutil.which` and minimal command invocations—without executing full API operations or heavy upstream tool calls.

## Core Architecture Components

### CLI Entry Point ([`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py))

The `_cmd_doctor` handler at line 1476 manages argument parsing and orchestration. It instantiates the configuration object and delegates to the doctor engine, handling the `--json` flag to determine output formatting.

### Doctor Engine ([`agent_reach/doctor.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/doctor.py))

The `check_all` function (line 12) serves as the central orchestrator, looping over every registered channel and collecting status results. For each channel, it calls `ch.check(config)`, capturing return values of `(status, message)` and any exceptions (converted to `"error"` status with diagnostics).

The `format_report` function (line 47) constructs the Rich-markup output, organizing channels into tiered sections (tier 0 for zero-config platforms, tiers 1/2 for optional ones) and appending status icons. It also verifies Unix permissions on `~/.agent-reach/config.yaml`, warning if the file is too permissive.

### Channel Registry ([`agent_reach/channels/__init__.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/__init__.py))

The `get_all_channels()` function at line 53 returns the `ALL_CHANNELS` collection defined at line 26, providing the complete list of platform objects to inspect. This registry includes all concrete implementations like `YouTubeChannel`, `TwitterChannel`, `GitHubChannel`, and `RedditChannel`.

### BaseChannel Implementation ([`agent_reach/channels/base.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/base.py))

The `Channel.check` method at line 61 provides the default implementation for channels without external binary requirements, setting `active_backend` and returning a generic "ok" status. Concrete channels override this method when specific backends (like `twitter-cli` or API clients) require verification.

### Configuration Layer ([`agent_reach/config.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/config.py))

The **Config** class reads user settings from `~/.agent-reach/config.yaml`, supplying overrides such as `twitter_backend` to each channel's check method. This configuration object propagates through the entire check pipeline, enabling platform-specific customization.

## Running Platform Availability Checks

Execute the diagnostic from your terminal to verify platform readiness:

```bash

# Human-readable Rich report

agent-reach doctor

# Machine-readable JSON for scripts

agent-reach doctor --json

```

The output categorizes platforms using visual indicators:

- **✅** — Available and fully configured
- **[!]** — Installed but requires additional configuration or login
- **[X]** — Not installed or not detected

The report organizes channels by configuration complexity: tier 0 channels work immediately with zero configuration, while tier 1 and 2 channels require optional setup or external binaries. The summary line indicates readiness (e.g., "12/14 channels available") and suggests unlockable optional channels.

## Programmatic Integration

Import the doctor engine directly for custom automation or dashboard integration:

```python
from agent_reach.config import Config
from agent_reach.doctor import check_all

cfg = Config()
status = check_all(cfg)

# Filter for non-ready channels only

for name, info in status.items():
    if info["status"] != "ok":
        print(f"{name}: {info['status']} – {info['message']}")

```

The `status` dictionary mirrors the JSON output from `agent-reach doctor --json`, containing keys for `status`, `message`, and `active_backend` for each channel. This enables automated remediation scripts or monitoring systems to consume platform health data directly.

## Summary

- The `agent-reach doctor` command inspects all supported platforms via lightweight probes without heavy API invocation.
- Core implementation spans [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) (entry point), [`agent_reach/doctor.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/doctor.py) (`check_all` and `format_report`), and [`agent_reach/channels/__init__.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/__init__.py) (registry).
- Each channel implements a `check()` method that verifies binary availability and configuration, returning `(status, message)` tuples.
- Output formats include Rich-styled terminal reports and raw JSON via the `--json` flag.
- Configuration is read from `~/.agent-reach/config.yaml` and passed to each channel's check method.

## Frequently Asked Questions

### What platforms does the Agent Reach doctor command check?

The command checks all platforms registered in `ALL_CHANNELS` within [`agent_reach/channels/__init__.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/__init__.py), including YouTube, Twitter, GitHub, Reddit, and other supported internet channels. Each concrete channel class (such as `YouTubeChannel` or `TwitterChannel`) implements platform-specific verification logic.

### How does the doctor command verify availability without heavy operations?

The `check()` method in each channel performs lightweight probes using `shutil.which` to locate binaries and executes minimal validation commands. It verifies that `active_backend` is set and functional without invoking full API workflows or resource-intensive operations, ensuring rapid diagnostic feedback.

### Can I use the doctor command output in automation scripts?

Yes. Use the `--json` flag to output machine-readable JSON, or import `check_all` from `agent_reach.doctor` programmatically. The returned dictionary structure supports automated parsing, enabling integration with CI/CD pipelines or custom monitoring dashboards that track platform readiness.

### Where does the doctor command read configuration from?

The command reads from `~/.agent-reach/config.yaml` via the **Config** class in [`agent_reach/config.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/config.py). This configuration supplies per-channel overrides (such as `twitter_backend`) and is passed to each `check()` method during the diagnostic loop. The doctor also warns if this configuration file has overly permissive Unix permissions.