# What is Needed for Facebook and Instagram Access with Agent Reach: Complete Setup Guide

> Learn what you need for Facebook and Instagram access with Agent Reach. Discover the simple setup requiring only OpenCLI and an active Chrome session, no API keys needed.

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

---

**To access Facebook and Instagram with Agent Reach, you only need OpenCLI installed and an active Chrome session where you are already logged into the respective platforms—no API keys or additional credentials are required.**

Agent Reach enables seamless integration with Facebook and Instagram through an OpenCLI-based architecture that leverages your existing browser sessions. According to the Panniantong/Agent-Reach source code, both platforms are implemented as thin wrapper channels that route commands to a Node-based daemon and Chrome extension. This approach eliminates the need for manual API configuration or cookie management.

## Prerequisites for Facebook and Instagram Access

### OpenCLI Backend Installation

The OpenCLI backend must be installed on your system. When you run `agent-reach install --env=auto`, the tool automatically installs the OpenCLI package (`npm install -g @jackwener/opencli`) if it is not already present. This daemon acts as the bridge between Agent Reach and your Chrome browser.

### Chrome Browser Authentication

Unlike traditional API integrations, Agent Reach requires no tokens or OAuth flows. You must simply be logged into **facebook.com** or **instagram.com** in your Chrome browser. The OpenCLI extension taps into your existing authenticated session, reusing cookies and session data from your browser profile.

## Architecture and Implementation

### Channel Classes in facebook.py and instagram.py

The specific channel implementations reside in [`agent_reach/channels/facebook.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/facebook.py) and [`agent_reach/channels/instagram.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/instagram.py). These files declare the platform names, supported domains (`facebook.com`, `fb.com`, `fb.watch`, `instagram.com`, `instagr.am`), and inherit from the base helper class.

### OpenCLISiteChannel Base Helper

Both channels inherit from `OpenCLISiteChannel`, defined in [`agent_reach/channels/_opencli_site.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/channels/_opencli_site.py). This base class implements the generic logic for OpenCLI site channels, including `can_handle`, `check`, and usage-hint methods. It provides the shared functionality for URL handling and health-check operations.

### OpenCLI Backend Daemon

The core connection logic lives in [`agent_reach/backends/opencli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/backends/opencli.py). This backend probes the OpenCLI installation, verifies the daemon is running, and checks that the Chrome extension is installed or sleeping. The `opencli_status()` function returns a readiness state that the channel's `check()` method consumes.

## Health Verification and Troubleshooting

Before using the channels, verify your setup using the built-in diagnostic tools. The [`agent_reach/doctor.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/doctor.py) module runs health checks for all channels, including Facebook and Instagram.

Run the diagnostic:

```bash
agent-reach doctor

```

This command invokes the `check()` method on each channel, which internally calls `opencli_status()` from the backend. The status check verifies three components:

- The OpenCLI CLI exists in your system PATH
- The Node daemon is actively running
- The Chrome extension is installed (or sleeping)

If the extension is missing, the diagnostic output includes a Chrome Web Store link for installation.

## Usage Examples

Once the OpenCLI status reports "ready", you can execute commands directly or through Agent Reach scripts.

CLI commands for Facebook:

```bash
opencli facebook search "OpenAI" -f yaml
opencli facebook profile "zuck" -f yaml
opencli facebook feed -f yaml
opencli facebook groups -f yaml

```

CLI commands for Instagram:

```bash
opencli instagram user "natgeo" -f yaml
opencli instagram profile "natgeo" -f yaml
opencli instagram explore -f yaml

```

Python integration:

```python
import subprocess
import json

def fb_search(query):
    out = subprocess.check_output(
        ["opencli", "facebook", "search", query, "-f", "json"]
    )
    return json.loads(out)

print(fb_search("AI research"))

```

## Summary

- **OpenCLI installation** is the only technical prerequisite, handled automatically by `agent-reach install --env=auto`.
- **Chrome browser login** provides authentication—no API keys, tokens, or manual cookie extraction required.
- **Channel wrappers** in [`facebook.py`](https://github.com/Panniantong/Agent-Reach/blob/main/facebook.py) and [`instagram.py`](https://github.com/Panniantong/Agent-Reach/blob/main/instagram.py) inherit from `OpenCLISiteChannel` to provide platform-specific routing.
- **Health verification** via `agent-reach doctor` ensures the OpenCLI daemon and Chrome extension are functional before runtime.
- **Direct CLI access** allows immediate interaction with Facebook and Instagram endpoints once the browser session is authenticated.

## Frequently Asked Questions

### Do I need Facebook or Instagram API keys to use Agent Reach?

No. Agent Reach does not require API keys, access tokens, or OAuth credentials. The OpenCLI backend reuses your existing Chrome browser session, authenticating through the cookies and session data from your logged-in profile.

### What happens if the OpenCLI Chrome extension is not installed?

The health check in [`agent_reach/backends/opencli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/backends/opencli.py) detects missing extensions during the `check()` phase. The `agent-reach doctor` command will display a Chrome Web Store link and instructions to install the extension before proceeding.

### Can I use Agent Reach with Facebook and Instagram if I am logged into multiple Chrome profiles?

The OpenCLI extension taps into the active Chrome instance. As long as you are logged into facebook.com or instagram.com in the Chrome profile that OpenCLI attaches to, the channel will function. The specific profile handling depends on your OpenCLI configuration.

### Is the OpenCLI daemon required to run continuously?

Yes, the Node-based daemon must be running to route commands between Agent Reach and the browser. The `opencli_status()` function in [`agent_reach/backends/opencli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/backends/opencli.py) verifies daemon availability, and `agent-reach doctor` will report if the service has stopped.