Metadata-Version: 2.4
Name: antigravity-automation
Version: 0.42.0
Summary: Python client library for the Antigravity Automation API — automate clicks, send commands, stream live AI outputs.
Author: JoeCodeCreations
License: MIT
Project-URL: Homepage, https://antigravityautomation.com
Project-URL: Repository, https://github.com/joecodecreations/antigravity_automation
Project-URL: Documentation, https://antigravityautomation.com/api/
Project-URL: Issues, https://github.com/joecodecreations/antigravity_automation/issues
Keywords: antigravity,vscode,ide-automation,ai,remote-control,api-client,websocket
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: websockets>=10.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

  Antigravity Automation

antigravity-automation

  The official Python SDK for the Antigravity Automation (https://antigravityautomation.com) extension

  🌐 Website (https://antigravityautomation.com)  · 
  📖 API Docs (https://antigravityautomation.com/api/)  · 
  ⭐ GitHub (https://github.com/joecodecreations/antigravity_automation)

---

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](https://antigravityautomation.com) VS Code extension.

## Install

```bash
pip install antigravity-automation
```

## Quick Start

```python
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

```python
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

```python
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

```bash
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](https://github.com/joecodecreations)
