Metadata-Version: 2.4
Name: agy-scripts
Version: 0.1.0
Summary: Cross-platform CLI utilities for managing Google Antigravity instances, MCP configs/profiles, and session search
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# agy_scripts

Cross-platform CLI utilities and shell scripts for managing Google Antigravity (`antigravity-ide`, `antigravity`, and `agy`).

## Installation

Install the Python CLI tools (`agy-control` and `agy-session-search`) in editable mode so they are available directly on your `PATH`:

```bash
uv tool install -e .
# or with pip:
pip install -e .
```

## Tools

### 1. `agy-control`
Unified cross-platform (Linux, macOS, Windows) CLI to list/restart Antigravity instances, edit MCP servers/tools, switch MCP profiles, maintain a master MCP reserve, and create date-stamped backups.

#### Subcommands
- `list` - List running Antigravity hub/IDE/app instances and show the active MCP profile
- `restart <PID|WORKSPACE|all>` - Restart matching hub instance(s) to pick up `mcp_config.json` changes
- `launch [WORKSPACE] [--ide|--app|--cli] [--new] [--profile NAME]` - Launch Antigravity IDE (default), Standalone App, or `agy` CLI (optionally forcing a new window/instance and activating a profile)
- `mcp list|tools [SERVER]|show <SERVER>` - Inspect MCP servers and tools (`--profile NAME` targets a saved profile)
- `mcp enable|disable|remove <SERVER> [--profile NAME] [--restart [TARGET]]` - Manage servers with automatic date-stamped backup and master reserve sync
- `mcp enable-tool|disable-tool <SERVER> <TOOL...> [--profile NAME] [--restart [TARGET]]` - Toggle individual tools
- `profile list|save <NAME>|use <NAME>` - Manage named MCP profiles in `~/.gemini/config/mcp_profiles/`
- `reserve sync|list` / `recover <SERVER>` - Sync known servers to `~/.gemini/config/mcp_master.json` and restore removed servers
- `backup` - Create a date-stamped backup in `~/.gemini/config/mcp_backups/`

#### Examples
```bash
# List running instances and active MCP profile
agy-control list

# List MCP servers and tools
agy-control mcp list
agy-control mcp tools mcp_remdev_serv_fedora

# Disable a tool and restart matching workspace instance
agy-control mcp disable-tool mcp_remdev_serv_fedora run_command --restart emdash

# Save and launch with a profile
agy-control profile save coding
agy-control launch ~/github2/emdash --ide --new --profile coding
```

---

### 2. `agy-session-search`
Search, inspect, export, and resume Google Antigravity sessions (both `.db` and legacy encrypted `.pb`) using `~/.gemini/antigravity/conversation_summaries.db` and `brain/<UUID>/` artifacts.

#### Subcommands
- `list [--workspace PATH] [--since DAYS] [--format db|pb] [-n LIMIT]`
- `search <query> [--role user|agent] [--workspace PATH] [-n LIMIT]`
- `show <UUID>` / `export <UUID> [-o FILE]`
- `resume <UUID>` - Resume session via `agy -r <UUID>`
- `--info <UUID>` (or `info <UUID>`) - Show metadata, kebab-case slug, and best FTS5 search term

#### Examples
```bash
agy-session-search list -n 10
agy-session-search search "ChatDSL" --role user
agy-session-search --info 1e7c708f-b55e-46cb-a043-6798c7507d79
agy-session-search export 1e7c708f-b55e-46cb-a043-6798c7507d79 -o session.md
```

---

### 3. `update_antigravity.sh`
Automated Linux (`x86_64`) installer and updater for Antigravity IDE (`~/Apps/antigravity-ide`), Standalone App (`~/Apps/antigravity`), and `agy` CLI (`~/.local/bin/agy`).

```bash
./update_antigravity.sh                 # Check and update all components
./update_antigravity.sh --check         # Check versions and pre-download only
./update_antigravity.sh --install --cli # Install/update only agy CLI
```

## Development & Tests

```bash
PYTHONPATH=src python3 -m unittest discover -s tests -v
```

## License

MIT - see [LICENSE](LICENSE).
