Python client library for the Antigravity Automation API — automate clicks, send commands, stream live AI outputs.
Project description
antigravity-automation
The official Python SDK for the Antigravity Automation extension
🌐 Website · 📖 API Docs · ⭐ GitHub
Automate clicks, send commands, and stream live AI chat outputs from Python — all via the local REST API and WebSocket provided by the Antigravity Automation VS Code extension.
Install
pip install antigravity-automation
Quick Start
from antigravity_automation import AntigravityClient
client = AntigravityClient()
# Send a command to the AI chat
result = client.send_command("Refactor the auth module")
print(result) # SendCommandResponse(status='queued', position=1, ...)
# Toggle auto-click automation
client.toggle_auto_run()
# Get usage stats
stats = client.get_stats()
print(f"Auto-Run clicks: {stats.autoRunClicks}")
WebSocket Stream
from antigravity_automation import AntigravityStream
stream = AntigravityStream()
stream.on_message(lambda msg: print(f"[{msg['title']}] {msg['content'][:80]}..."))
stream.on_connected(lambda: print("Connected!"))
stream.run() # Blocking — runs asyncio event loop
API Reference
| Method | Endpoint | Description |
|---|---|---|
send_command(text) |
POST /send_command |
Send a prompt to the active AI chat |
start_new_chat() |
POST /start-new-chat |
Start a new chat session |
switch_chat(title) |
POST /switch_chat |
Switch to a conversation by title |
toggle_auto_run() |
POST /toggle_auto_run |
Toggle auto-click Run button |
toggle_auto_allow() |
POST /toggle_auto_allow |
Toggle auto-approve permissions |
get_command() |
GET /get_command |
Poll for queued commands & state |
get_stats() |
GET /stats |
Get cumulative usage statistics |
update(title, content) |
POST /update |
Push chat content |
track_action(action) |
POST /track_action |
Track a usage action |
Configuration
client = AntigravityClient(
base_url="http://localhost:5000", # default
timeout=10, # seconds, default
)
stream = AntigravityStream(
url="ws://localhost:9812", # default
reconnect=True, # auto-reconnect, default
reconnect_delay=3.0, # seconds, default
)
Local Development
pip install -e ".[dev]" # Install in dev mode
python tests/test_import.py # Run offline import tests
python tests/test_live.py # Run live tests (bridge must be running)
python -m build # Build for PyPI
twine upload dist/* # Publish to PyPI
Requirements
- Python ≥ 3.8
- Antigravity Automation extension installed and running in VS Code
License
MIT — Built by JoeCodeCreations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file antigravity_automation-0.42.0.tar.gz.
File metadata
- Download URL: antigravity_automation-0.42.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
275ca17eb02d198c1b9105ff1af6483b5ebd56a66e43d4957fabf08e74e37337
|
|
| MD5 |
02de8259c9c0005e19689b60397eb1fd
|
|
| BLAKE2b-256 |
acff3b8840e57ca6bf5169e787f1ac0a182473d2d001d2848b5b4df032e16892
|
File details
Details for the file antigravity_automation-0.42.0-py3-none-any.whl.
File metadata
- Download URL: antigravity_automation-0.42.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8b21f59b3b2e7fdb4050283a65e7f8408919f4d9551fe8423a360ba5a9cffbc
|
|
| MD5 |
02d4861778028078e0bfc77ce89558f1
|
|
| BLAKE2b-256 |
53056a8f4e2e25f9af0f9aeffe8ee9106884a5e987681454daf441ef1aaa7850
|