Antigravity Automation Skill
This skill allows AI agents to control the Antigravity desktop app (and any Electron app with CDP enabled) programmatically via OpenCLI.
Requirements
The target Electron application MUST be launched with the remote-debugging-port flag: ```bash /Applications/Antigravity.app/Contents/MacOS/Electron --remote-debugging-port=9224 ```
The agent must configure the endpoint environment variable locally before invoking standard commands: ```bash export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9224" ```
If the endpoint exposes multiple inspectable targets, also set: ```bash export OPENCLI_CDP_TARGET="antigravity" ```
High-Level Capabilities
- Send Messages (
opencli antigravity send <message>): Type and send a message directly into the chat UI. - Read History (
opencli antigravity read): Scrape the raw chat transcript from the main UI container. - Extract Code (
opencli antigravity extract-code): Automatically isolate and extract source code text blocks from the AI's recent answers. - Switch Models (
opencli antigravity model <name>): Instantly toggle the active LLM (e.g., `gemini`, `claude`). - Clear Context (
opencli antigravity new): Start a fresh conversation.
Examples for Automated Workflows
Generating and Saving Code
```bash export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9224" opencli antigravity send "Write a python script to fetch HN top stories"
wait ~10-15 seconds for output to render
opencli antigravity extract-code > hn_fetcher.py ```
Reading Real-time Logs
Agents can run long-running streaming watch instances: ```bash export OPENCLI_CDP_ENDPOINT="http://127.0.0.1:9224" opencli antigravity watch ```