Skip to content

jaygz316/ag2r

 
 

Repository files navigation

Buy Me A Coffee

AG2R — Antigravity 2.0 Remote

Antigravity Compatibility Not working? See Branching Strategy

A lightweight mobile remote interface for monitoring and interacting with Antigravity AI coding sessions from your phone — on Wi-Fi, hotspot, or anywhere in the world.

Live Chat & Plan Approval
Live Chat & Plan Approval
Code Review
Code Review
Commenting
Commenting
Command Approvals
Command Approvals
Interactive Questions
Interactive Questions
Target Selection
Target Selection
Push Notifications
Push Notifications
Project Explorer
Project Explorer

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • Antigravity launched with CDP enabled: open -a Antigravity --args --remote-debugging-port=9000

Quick Start

git clone git@github.com:the-future-company/ag2r.git
cd ag2r
npm install
cp .env.example .env
node server.js

That's it — AG2R is running on https://localhost:3000. On first run, a self-signed SSL cert is generated in certs/.

By default auth is off — no login needed. This is fine for local use. If you're exposing AG2R to the internet (see below), you must set a password first.


🌐 How to Connect

Option 1: Local Network (Same Wi-Fi)

No extra setup — just start the server and open it on your phone.

  1. node server.js
  2. Open https://<your-computer-ip>:3000 on your phone
  3. Accept the self-signed certificate warning

No password needed for local-only use. Your phone must be on the same Wi-Fi as the computer.


Option 2: Remote Access (Any Network)

Use a Cloudflare tunnel or preferred tunneling setup to access AG2R from anywhere — no port forwarding needed.

Warning

Set a strong password before exposing AG2R to the internet. Edit .env:

AUTH_ENABLED=true
APP_PASSWORD=your-strong-password-here

Step 1 — Start the tunnel (gets you a public URL):

brew install cloudflared
cloudflared tunnel --url https://localhost:3000 --no-tls-verify

Cloudflared prints a URL like https://random-words.trycloudflare.com.

Step 2 — Add the URL to .env so push notifications work:

TUNNEL_ENABLED=true
TUNNEL_URL=https://random-words.trycloudflare.com   # ← paste your URL here

Step 3 — Start AG2R:

node server.js

Open the tunnel URL on your phone. The URL changes each time you restart the tunnel.

Option 3: Stable URL with your own domain

If you have a domain on Cloudflare, you can set up a permanent tunnel so the URL never changes:

cloudflared tunnel login
cloudflared tunnel create ag2r
cloudflared tunnel route dns ag2r ag2r.yourdomain.com

Create ~/.cloudflared/config.yml:

tunnel: <TUNNEL_ID>
credentials-file: ~/.cloudflared/<TUNNEL_ID>.json

ingress:
  - hostname: ag2r.yourdomain.com
    service: https://localhost:3000
    originRequest:
      noTLSVerify: true
  - service: http_status:404

Set TUNNEL_URL=https://ag2r.yourdomain.com in .env, then run node server.js and cloudflared tunnel run ag2r in separate terminals.

📱 Features

Real-time Chat Monitoring

See Antigravity's responses and active tasks/plans as they stream in real time. Code blocks, markdown, and all formatting render on your phone exactly as they appear on desktop.

Real-time chat monitoring


Permission Handling (Commands & Tools)

Approve, deny, or skip permission requests remotely. Approve command execution, file reads/writes, and custom actions right from your phone.

Permission dialog on mobile


Interactive Choice Questions

Respond to clarifying questions asked by the agent. Choose from predefined options or write custom responses to resolve design ambiguity on the go.

Interactive choice questions


Code Review

Review file changes directly on your phone. See clean syntax-highlighted unified diffs, browse modified files, and navigate between Overview and Review tabs.

Code diff view


Commenting & Queuing

Select text on any document, leave comments with context, and queue them for batch sending. Comments capture the selected text as a quote and your annotation.

Add Comment dialog


Sidebar Navigation & Overview

Switch between conversations, explore project directories, and view active files changed, artifacts, and background tasks.

Sidebar project explorer


Worktree & Target Selection

Quickly select the active repository, create new worktrees, and target specific git branches directly from the session creator.

Target worktree and branch selector


Push Notifications

Get notified on your phone when the session needs permission approval — even with the app in the background. Tap the notification to jump straight to the pending request.

Push notification on Android


Desktop & Tablet Support

AG2R Review Changes — Desktop

AG2R Chat — Desktop

AG2R Permission Dialog — Desktop

Compatible with tablets or desktops as well

Note

iOS: Push notifications require the PWA to be installed to your home screen (iOS 16.4+). Open AG2R in Safari, tap Share → "Add to Home Screen."

Android: If Chrome doesn't prompt for notifications, go to Chrome Settings → Site settings → Notifications and set "How to show requests" to "Expand all requests". Then reload the page and tap anywhere to trigger the prompt.


More Features

  • Send messages — type and send messages to the AI from your phone
  • Voice input — dictate messages using your phone's microphone
  • Stop generation — cancel a running generation with the stop button
  • Auto-reconnect — seamless reconnection when connection drops
  • Cookie-based auth — enter passcode once, stays logged in for 30 days

🔄 Keep It Running (Optional)

A watchdog script can keep AG2R running and auto-update from the branch you're on. It detects the current branch, pulls new commits, and restarts the server when code changes.

# Run once to start (or add to cron for auto-recovery)
./scripts/watchdog.sh

Cron setup (checks every 5 minutes):

crontab -e
# Add this line:
*/5 * * * * cd ~/ag2r && ./scripts/watchdog.sh >> /tmp/ag2r-watchdog.log 2>&1

The watchdog reads configuration from .env — no need to pass env vars in the crontab. It auto-detects branch changes: if you switch branches (git checkout next), the next watchdog cycle restarts the server with the correct code. Your .env is gitignored and persists across branch switches.

The tunnel-watchdog.sh script can similarly keep a Cloudflare tunnel alive, and ag-watchdog.sh keeps Antigravity itself running with Chrome DevTools Protocol enabled.


🌿 Branching Strategy

Branch Purpose Stability
main Current stable version — works with the AG version shown in the badge above ✅ Stable
prev-stable Previous stable version — frozen snapshot of main before the latest merge ✅ Stable
next Bleeding edge — being tested against an upcoming AG version ⚠️ May break

How it works

When a new Antigravity version ships, the developer's workflow is:

  1. Work on next to adapt AG2R to the new AG version
  2. Once next is working, snapshot mainprev-stable and merge nextmain
  3. Continue fixing bugs on next and merging to main until stable
  4. When things settle, main and next converge to the same state

Which branch should I use?

Start with main. It works with the AG version shown in the badge at the top.

If main is broken (typically right after a new AG release), use prev-stable — it's a frozen snapshot that works with the previous AG version. Install that AG version and use prev-stable until main is updated.

# Fall back to the previous stable version
git checkout prev-stable
git pull origin prev-stable

If you want the absolute latest (and don't mind occasional breakage):

git checkout next
git pull origin next

Warning

The next branch may be unstable. Use main for a reliable experience, or prev-stable as a fallback.


🖼️ Gallery of Additional Views

Here is a collection of additional screenshots showcasing more subtle UI states, interactive dialogs, and legacy screen references.

💬 Commenting Flow Details

Text Selection Trigger
Text Selection Trigger
Add Comment Dialog (Keyboard Open)
Add Comment Dialog (Keyboard Open)
Comment Queued Pill Indicator
Comment Queued Pill Indicator
Queued Comments List Dialog
Queued Comments List Dialog

🤖 Chat & Step Explorer States

Task & Walkthrough Cards
Task & Walkthrough Cards
Expanded Files Changed Dropdown
Expanded Files Changed Dropdown
Detailed Step Logs & Scenario Tables
Detailed Step Logs & Scenario Tables
Full-Screen Plan View
Full-Screen Plan View

🔍 Review, Diff & Model Selectors

Review Files Explorer
Review Files Explorer
Collapsed Code Diff Sections
Collapsed Code Diff Sections
New Conversation State
New Conversation State
Model Selector Dropdown
Model Selector Dropdown
Interactive choice with custom answer
Interactive choice with custom answer

🏛️ Legacy Screen References

Legacy Live Chat
Legacy Live Chat
Legacy Code Review
Legacy Code Review
Legacy Queued Comments
Legacy Queued Comments
Legacy Comment Dialog
Legacy Comment Dialog
Legacy Review File List
Legacy Review File List
Legacy Conversation Sidebar
Legacy Conversation Sidebar
Legacy Overview Panel
Legacy Overview Panel
Legacy Overview with Permission
Legacy Overview with Permission
Legacy Permission Banner
Legacy Permission Banner
Legacy Push Notification
Legacy Push Notification
Legacy Subagents
Legacy Subagents

📊 Telemetry

AG2R collects anonymous usage metrics (feature counts, crash reports — no personal data) to help improve the project. Set AG2R_TELEMETRY=false in your .env to disable.

License

MIT — see LICENSE for details.

About

AG2R — Antigravity 2.0 Remote. A lightweight, Android-friendly, heavily vibe-coded remote client for monitoring and interacting with Antigravity 2.0.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 78.2%
  • CSS 15.9%
  • HTML 3.8%
  • Shell 2.1%