AG Remote Documentation

Welcome to the definitive guide for setting up and managing your AG Remote desktop host and iOS companion app. Let's make your AI autonomy completely portable.

Architecture Overview

AG Remote bridges the gap between your mobile device and the Antigravity IDE running on your Mac. It consists of three primary components:

1. iOS App

Native Swift app offering a chat UI, secure API polling, and background audio to keep the connection alive.

2. Desktop Node

An Express Server that translates network requests into AppleScript keystrokes and CDP injections.

3. CF Tunnel

Zero-config proxy ensuring end-to-end HTTPS encryption without opening router ports.

Quick Start Guide

Follow these steps to deploy the Desktop End-point on your primary programming Mac.

# 1. Clone the master repository
$ git clone https://github.com/dongtrinh/efe-ai-staff.git ~/efe-nodes

# 2. Setup the global configuration
$ echo "REMOTE_PIN=181985" > ../.env.local
$ cp AGENTS.md ~/AGENTS.md

# 3. Boot via PM2 Process Manager
$ pm2 start server.js --name "ag-host"

Ghost Override & Auto-Approve

The most powerful feature of AG Remote. When your AI agent attempts to run a destructive file operation (e.g., npm install or rm -rf), the IDE natively blocks it with a confirmation dialog.

How it works: The Node server continuously polls the system state. If a blocking UI is detected, a hybrid approach of AppleScript (pressing Enter) and a Swift Computer Vision script locates the "Allow" coordinate to automatically click it—allowing your workflows to continue while you sleep.

DOM X-Ray Vision

Feeling blind? Type exactly /capture inside the iOS Mobile chat. The Desktop node will trigger screencapture -x and push an authentic, real-time snapshot of your entire Mac screen directly back to your iMessage-style stream.

Emergency Restarts

If the IDE completely freezes, tap the Skull Icon in the App Settings. This fires a lethal pkill -f "Antigravity", re-opens the IDE with CDP ports unlocked, and injects Cmd+E to resuscitate the Agent Manager from scratch.