Skip to content

timteh/antigravity-autopilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Antigravity Autopilot

VS Marketplace Installs License: MIT

Auto-accept agent steps in Antigravity IDE β€” no CDP required.

Uses OS-level accessibility (Windows UI Automation) to click Run, Accept, Continue, and other agent buttons invisibly β€” no mouse movement, no DOM injection, no Chrome DevTools Protocol.

Buy Me A Coffee


Why This Extension?

Every other auto-accept extension relies on Chrome DevTools Protocol (CDP). This breaks when:

  • ❌ Electron builds disable --remote-debugging-port (Antigravity does this)
  • ❌ Corporate policies block CDP ports
  • ❌ Shortcut patching fails silently
  • ❌ CDP WebSocket drops on auto-updates

Antigravity Autopilot doesn't use CDP at all. It uses Windows UI Automation APIs to find and click buttons through the accessibility tree β€” the same API that screen readers use. This means:

  • βœ… Works when CDP is blocked β€” no port configuration needed
  • βœ… No mouse hijacking β€” uses InvokePattern.Invoke() (invisible click)
  • βœ… No DOM injection β€” doesn't touch the webview content
  • βœ… No shortcut patching β€” no .lnk file modifications
  • βœ… Auto-scrolls chat β€” keeps up with agent output

Quick Start

1. Install the Extension

Ctrl+Shift+X β†’ Search "Antigravity Autopilot" β†’ Install

2. Enable Accessibility (One-Time)

On first launch, the extension will prompt you to set the ELECTRON_FORCE_RENDERER_ACCESSIBILITY environment variable. Click "Set Environment Variable" and restart Antigravity.

Or do it manually:

[System.Environment]::SetEnvironmentVariable('ELECTRON_FORCE_RENDERER_ACCESSIBILITY', '1', 'User')

Why? Electron-based IDEs don't expose webview UI elements by default. This env var forces the Chromium renderer to populate the accessibility tree, making agent buttons visible to UI Automation.

3. Use It

  • Status bar: Click Autopilot ON / Autopilot OFF to toggle
  • Keyboard shortcut: Ctrl+Shift+A (Cmd+Shift+A on macOS) β€” instant toggle
  • Command palette: Ctrl+Shift+P β†’ "Antigravity Autopilot: Start/Stop/Toggle"
  • Auto-start: Enabled by default β€” starts when Antigravity opens

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Antigravity IDE (Electron)       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Agent Panel (React Webview)     β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚  [Run Alt+d] [Reject]     β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         ↑ Accessibility Tree            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚ InvokePattern.Invoke()
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Autopilot Watcher (PowerShell)         β”‚
β”‚  - Polls every 800ms                    β”‚
β”‚  - Finds buttons by text pattern        β”‚
β”‚  - Clicks via InvokePattern (invisible) β”‚
β”‚  - Cooldown prevents re-clicking        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Polls the IDE window's accessibility tree every 800ms
  2. Focus-aware: Only clicks when the IDE is the foreground window β€” won't interrupt other apps
  3. Matches button names against configurable accept/reject regex patterns
  4. Clicks matching buttons via InvokePattern.Invoke() β€” no mouse, no focus steal
  5. Cooldown prevents re-clicking the same button within 10 seconds
  6. Auto-scrolls the chat to keep up with agent output (3s cooldown)

Settings

Setting Default Description
antigravityAutopilot.enabled true Master toggle
antigravityAutopilot.pollIntervalMs 800 Scan interval (ms)
antigravityAutopilot.cooldownSeconds 10 Per-button cooldown
antigravityAutopilot.scrollCooldownSeconds 3 Scroll button cooldown
antigravityAutopilot.autoScroll true Auto-click "Scroll to bottom"
antigravityAutopilot.acceptPatterns ["^Run", "^Accept", ...] Regex patterns to auto-click
antigravityAutopilot.rejectPatterns ["^Cancel", "^Reject", ...] Patterns to NEVER click

Default Accept Patterns

^Run, ^Accept, ^Accept All$, ^Allow$, ^Allow this conversation$,
^Continue$, ^Keep All$, ^Yes$, ^Retry$, ^Scroll to bottom$,
^Send all$, ^Always Allow$, ^Always run$

Default Reject Patterns (Safety Net)

^Reject, ^Cancel$, ^Deny, ^Delete, ^Remove, ^Discard, ^Close,
^Minimize$, ^Maximize$, ^Review Changes$

Supported IDEs

IDE Status
Antigravity βœ… Fully tested
Cursor βœ… Should work (same Electron base)
Windsurf βœ… Should work (same Electron base)
VS Code βœ… Should work

Platform Support

Platform Status
Windows βœ… Full support (UI Automation)
macOS πŸ”œ Planned (AXUIElement API)
Linux πŸ”œ Planned (AT-SPI)

Troubleshooting

Extension says "only 3 buttons found"

The accessibility env var isn't set or Antigravity wasn't restarted. Run:

$env:ELECTRON_FORCE_RENDERER_ACCESSIBILITY = "1"
& "C:\path\to\Antigravity.exe"

Watcher can't find the IDE window

Make sure only one instance of Antigravity is running.

Buttons not being clicked

Check the Output panel (Ctrl+Shift+U β†’ "Antigravity Autopilot") for logs. The button text may not match the default patterns β€” add custom patterns in settings.


Contributing

PRs welcome! The main areas for contribution:

  • macOS support β€” implement AXUIElement-based watcher in Swift/Python
  • Linux support β€” implement AT-SPI-based watcher
  • New button patterns β€” submit patterns for other IDE forks
  • Performance β€” optimize the polling/scanning loop

License

MIT β€” see LICENSE


Buy Me A Coffee
If this saved you from clicking 1000 buttons, consider buying me a coffee β˜•

About

πŸš€ Auto-accept agent steps in Antigravity IDE β€” no CDP required. Uses OS-level accessibility (Windows UI Automation) to click Run/Accept/Continue buttons invisibly. Works when every other auto-accept extension fails.

Topics

Resources

License

Stars

Watchers

Forks

Packages