agy-scripts 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ """agy_scripts: CLI utilities for Google Antigravity."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,145 @@
1
+ """CLI entrypoint for agy-control."""
2
+
3
+ import argparse
4
+ import os
5
+
6
+ from . import instances, mcp
7
+
8
+
9
+ def cmd_list(_args) -> None:
10
+ print(f"Active MCP Profile: {mcp.get_active_profile()}\n")
11
+ found = instances.find_instances()
12
+ if not found:
13
+ print("No running Antigravity instances found.")
14
+ return
15
+ print(f"{'PID':>7} {'TYPE':4} {'PORT':6} WORKSPACE")
16
+ print("-" * 70)
17
+ for inst in found:
18
+ print(f"{inst['pid']:>7} {inst['type']:4} {inst['port']:6} {inst['workspace']}")
19
+
20
+
21
+ def cmd_restart(args) -> None:
22
+ instances.restart_instances(args.target)
23
+
24
+
25
+ def cmd_launch(args) -> None:
26
+ if args.profile:
27
+ mcp.cmd_profile(argparse.Namespace(profile_cmd="use", name=args.profile))
28
+ new_inst = getattr(args, "new", False)
29
+ if args.cli:
30
+ cmd = ["agy"] + (["--add-dir", args.workspace] if args.workspace else [])
31
+ os.execvp("agy", cmd)
32
+ elif args.app:
33
+ instances.launch_gui("app", args.workspace, new_instance=new_inst)
34
+ print("Launched Antigravity Standalone App" + (f" for {args.workspace}" if args.workspace else "") + ".")
35
+ else:
36
+ instances.launch_gui("ide", args.workspace, new_instance=new_inst)
37
+ print("Launched Antigravity IDE" + (f" for {args.workspace}" if args.workspace else "") + ".")
38
+
39
+
40
+ def main() -> None:
41
+ parser = argparse.ArgumentParser(
42
+ prog="agy-control",
43
+ description="Unified cross-platform Antigravity instance manager, MCP config editor, and profiles.",
44
+ )
45
+ sub = parser.add_subparsers(dest="command")
46
+
47
+ sub.add_parser("list", help="List running Antigravity instances and active MCP profile")
48
+
49
+ p_res = sub.add_parser("restart", help="Restart instance(s) to pick up MCP config changes")
50
+ p_res.add_argument("target", help="PID, workspace substring, or 'all'")
51
+
52
+ sub.add_parser("backup", help="Create a date-stamped backup of mcp_config.json")
53
+
54
+ p_rsv = sub.add_parser("reserve", help="Manage master MCP server reserve")
55
+ rsv_sub = p_rsv.add_subparsers(dest="reserve_cmd")
56
+ rsv_sub.add_parser("sync", help="Sync current mcp_config.json servers into master reserve")
57
+ rsv_sub.add_parser("list", help="List all servers in master reserve")
58
+
59
+ p_rec = sub.add_parser("recover", help="Recover a removed MCP server from master reserve")
60
+ p_rec.add_argument("server", help="Server name to recover")
61
+
62
+ p_prof = sub.add_parser("profile", help="Manage MCP profiles")
63
+ prof_sub = p_prof.add_subparsers(dest="profile_cmd")
64
+ prof_sub.add_parser("list", help="List saved MCP profiles (marks active)")
65
+ p_psave = prof_sub.add_parser("save", help="Save current mcp_config.json as a profile")
66
+ p_psave.add_argument("name", help="Profile name")
67
+ p_puse = prof_sub.add_parser("use", help="Switch mcp_config.json to a saved profile")
68
+ p_puse.add_argument("name", help="Profile name")
69
+
70
+ p_launch = sub.add_parser("launch", help="Launch Antigravity IDE, Standalone App, or CLI with an optional MCP profile")
71
+ p_launch.add_argument("workspace", nargs="?", help="Workspace directory path")
72
+ p_launch.add_argument("--profile", help="MCP profile name to activate before launching")
73
+ target_grp = p_launch.add_mutually_exclusive_group()
74
+ target_grp.add_argument("--ide", action="store_true", help="Launch Antigravity IDE (default)")
75
+ target_grp.add_argument("--app", action="store_true", help="Launch Antigravity Standalone App")
76
+ target_grp.add_argument("--cli", action="store_true", help="Launch agy CLI")
77
+ p_launch.add_argument("--new", action="store_true", help="Force a new window/instance (--new-window)")
78
+
79
+ # `mcp` namespace
80
+ p_mcp = sub.add_parser("mcp", help="Inspect and edit MCP servers and tools")
81
+ mcp_sub = p_mcp.add_subparsers(dest="mcp_cmd")
82
+
83
+ def add_profile_arg(p):
84
+ p.add_argument("--profile", help="Edit a saved profile instead of active mcp_config.json")
85
+
86
+ def add_restart_arg(p):
87
+ p.add_argument("--restart", nargs="?", const="all", help="Restart instance(s) after edit (default: all)")
88
+
89
+ p_ml = mcp_sub.add_parser("list", help="List MCP servers")
90
+ add_profile_arg(p_ml)
91
+
92
+ p_mt = mcp_sub.add_parser("tools", help="List tools for an MCP server")
93
+ p_mt.add_argument("server", nargs="?", help="Server name (optional)")
94
+ add_profile_arg(p_mt)
95
+
96
+ p_ms = mcp_sub.add_parser("show", help="Show JSON config for a server")
97
+ p_ms.add_argument("server", help="Server name")
98
+ p_ms.add_argument("--raw", action="store_true", help="Show unredacted env values")
99
+ add_profile_arg(p_ms)
100
+
101
+ for act in ("enable", "disable", "remove"):
102
+ p_act = mcp_sub.add_parser(act, help=f"{act.capitalize()} an MCP server")
103
+ p_act.add_argument("server", help="Server name")
104
+ add_profile_arg(p_act)
105
+ add_restart_arg(p_act)
106
+
107
+ for act in ("enable-tool", "disable-tool"):
108
+ p_tact = mcp_sub.add_parser(act, help=f"{act.replace('-', ' ').capitalize()} on a server")
109
+ p_tact.add_argument("server", help="Server name")
110
+ p_tact.add_argument("tools", nargs="+", help="Tool name(s)")
111
+ add_profile_arg(p_tact)
112
+ add_restart_arg(p_tact)
113
+
114
+ args = parser.parse_args()
115
+ if args.command == "list":
116
+ cmd_list(args)
117
+ elif args.command == "restart":
118
+ cmd_restart(args)
119
+ elif args.command == "backup":
120
+ mcp.cmd_backup(args)
121
+ elif args.command == "reserve":
122
+ if not args.reserve_cmd:
123
+ p_rsv.print_help()
124
+ else:
125
+ mcp.cmd_reserve(args)
126
+ elif args.command == "recover":
127
+ mcp.cmd_recover(args)
128
+ elif args.command == "profile":
129
+ if not args.profile_cmd:
130
+ p_prof.print_help()
131
+ else:
132
+ mcp.cmd_profile(args)
133
+ elif args.command == "launch":
134
+ cmd_launch(args)
135
+ elif args.command == "mcp":
136
+ if not args.mcp_cmd:
137
+ p_mcp.print_help()
138
+ else:
139
+ mcp.cmd_mcp(args)
140
+ else:
141
+ parser.print_help()
142
+
143
+
144
+ if __name__ == "__main__":
145
+ main()
@@ -0,0 +1,156 @@
1
+ """Cross-platform Antigravity instance discovery, launch, and restart."""
2
+
3
+ import json
4
+ import os
5
+ import platform
6
+ import re
7
+ import shutil
8
+ import subprocess
9
+ import sys
10
+
11
+ SYSTEM = platform.system() # 'Linux', 'Darwin', 'Windows'
12
+
13
+ _NOISE_PATTERNS = (
14
+ "--type=",
15
+ "--utility-sub-type=",
16
+ "chrome_crashpad_handler",
17
+ "shellintegration-",
18
+ )
19
+
20
+
21
+ def get_processes() -> list[dict]:
22
+ """Return list of {pid, cmd} for running Antigravity/agy processes."""
23
+ procs = []
24
+ if SYSTEM in ("Linux", "Darwin"):
25
+ try:
26
+ out = subprocess.check_output(["ps", "-eo", "pid,args"], text=True, errors="replace")
27
+ for line in out.splitlines()[1:]:
28
+ line = line.strip()
29
+ if not line:
30
+ continue
31
+ parts = line.split(None, 1)
32
+ if len(parts) < 2 or not parts[0].isdigit():
33
+ continue
34
+ pid_str, cmd = parts
35
+ low = cmd.lower()
36
+ if "antigravity" in low or "agy --hub" in low:
37
+ procs.append({"pid": int(pid_str), "cmd": cmd})
38
+ except Exception as e:
39
+ print(f"Warning: failed to list processes: {e}", file=sys.stderr)
40
+ elif SYSTEM == "Windows":
41
+ try:
42
+ ps_cmd = (
43
+ "Get-CimInstance Win32_Process | "
44
+ "Where-Object { $_.CommandLine -match 'antigravity|agy.*--hub' } | "
45
+ "Select-Object ProcessId, CommandLine | ConvertTo-Json -Compress"
46
+ )
47
+ out = subprocess.check_output(
48
+ ["powershell", "-NoProfile", "-Command", ps_cmd],
49
+ text=True,
50
+ errors="replace",
51
+ )
52
+ if out.strip():
53
+ items = json.loads(out)
54
+ if isinstance(items, dict):
55
+ items = [items]
56
+ for item in items:
57
+ procs.append({"pid": int(item["ProcessId"]), "cmd": item.get("CommandLine") or ""})
58
+ except Exception as e:
59
+ print(f"Warning: failed to list Windows processes: {e}", file=sys.stderr)
60
+ return procs
61
+
62
+
63
+ def parse_instances(procs: list[dict]) -> list[dict]:
64
+ """Extract structured Antigravity hub/IDE/app instances, filtering helper noise."""
65
+ instances = []
66
+ for p in procs:
67
+ cmd = p["cmd"]
68
+ low = cmd.lower()
69
+ if any(noise in low for noise in _NOISE_PATTERNS):
70
+ continue
71
+
72
+ if "--hub" in cmd and "agy" in cmd:
73
+ port_m = re.search(r"--hub-port=(\d+)", cmd)
74
+ dir_m = re.search(r"--add-dir=(\S+)", cmd)
75
+ instances.append({
76
+ "pid": p["pid"],
77
+ "type": "hub",
78
+ "port": port_m.group(1) if port_m else "-",
79
+ "workspace": dir_m.group(1) if dir_m else "(none)",
80
+ "cmd": cmd,
81
+ })
82
+ elif any(tok in cmd for tok in ("antigravity-ide", "Antigravity.exe", "Antigravity.app")) or (
83
+ "/Apps/antigravity/antigravity" in cmd
84
+ ):
85
+ inst_type = "ide" if ("antigravity-ide" in cmd or "Antigravity IDE" in cmd) else "app"
86
+ instances.append({
87
+ "pid": p["pid"],
88
+ "type": inst_type,
89
+ "port": "-",
90
+ "workspace": "-",
91
+ "cmd": cmd,
92
+ })
93
+ return instances
94
+
95
+
96
+ def find_instances() -> list[dict]:
97
+ return parse_instances(get_processes())
98
+
99
+
100
+ def kill_pid(pid: int) -> None:
101
+ if SYSTEM == "Windows":
102
+ subprocess.run(["taskkill", "/PID", str(pid), "/F"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
103
+ else:
104
+ try:
105
+ os.kill(pid, 15)
106
+ except ProcessLookupError:
107
+ pass
108
+
109
+
110
+ def launch_gui(target: str = "ide", workspace: str | None = None, new_instance: bool = False) -> None:
111
+ """Launch Antigravity IDE ('ide') or Standalone App ('app') across platforms."""
112
+ bin_name = "antigravity-ide" if target == "ide" else "antigravity"
113
+ mac_app = "Antigravity IDE" if target == "ide" else "Antigravity"
114
+ ws_args = [workspace] if workspace and workspace not in ("-", "(none)") else []
115
+ new_args = ["--new-window"] if new_instance else []
116
+
117
+ if SYSTEM == "Windows":
118
+ exe = shutil.which(bin_name) or bin_name
119
+ cmd = [exe] + new_args + ws_args
120
+ subprocess.Popen(cmd, creationflags=0x00000008 | 0x00000200, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
121
+ elif SYSTEM == "Darwin":
122
+ cmd = ["open", "-na", mac_app]
123
+ extra = new_args + ws_args
124
+ if extra:
125
+ cmd += ["--args"] + extra
126
+ subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
127
+ else:
128
+ exe = shutil.which(bin_name) or os.path.expanduser(f"~/.local/bin/{bin_name}")
129
+ cmd = [exe, "--no-sandbox"] + new_args + ws_args
130
+ subprocess.Popen(cmd, start_new_session=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
131
+
132
+
133
+ def restart_instances(target: str) -> None:
134
+ instances = find_instances()
135
+ hubs = [i for i in instances if i["type"] == "hub"]
136
+ if not hubs:
137
+ print("No active workspace hubs found to restart.")
138
+ return
139
+
140
+ if target == "all":
141
+ targets = hubs
142
+ elif target.isdigit():
143
+ pid = int(target)
144
+ targets = [i for i in hubs if i["pid"] == pid]
145
+ else:
146
+ targets = [i for i in hubs if target in i["workspace"]]
147
+
148
+ if not targets:
149
+ print(f"No matching hub instance found for '{target}'.", file=sys.stderr)
150
+ sys.exit(1)
151
+
152
+ for inst in targets:
153
+ print(f"Restarting hub PID {inst['pid']} (workspace: {inst['workspace']})...")
154
+ kill_pid(inst["pid"])
155
+ launch_gui("ide", inst["workspace"])
156
+ print("Done. New instance(s) will pick up the current mcp_config.json.")
agy_scripts/mcp.py ADDED
@@ -0,0 +1,235 @@
1
+ """MCP server/tool configuration, profiles, master reserve, and backups."""
2
+
3
+ import glob
4
+ import json
5
+ import os
6
+ import shutil
7
+ import sys
8
+
9
+ from . import instances, paths
10
+
11
+
12
+ def sync_master_reserve() -> int:
13
+ paths.ensure_dirs()
14
+ current = paths.load_json(paths.mcp_config_path(), {"mcpServers": {}})
15
+ master = paths.load_json(paths.mcp_master_path(), {"mcpServers": {}})
16
+ master.setdefault("mcpServers", {})
17
+ added = 0
18
+ for name, cfg in current.get("mcpServers", {}).items():
19
+ if name not in master["mcpServers"]:
20
+ added += 1
21
+ master["mcpServers"][name] = cfg
22
+ paths.save_json(paths.mcp_master_path(), master)
23
+ return added
24
+
25
+
26
+ def set_active_profile(name: str | None) -> None:
27
+ paths.ensure_dirs()
28
+ apf = paths.active_profile_file()
29
+ if name:
30
+ with open(apf, "w", encoding="utf-8") as f:
31
+ f.write(name + "\n")
32
+ elif os.path.isfile(apf):
33
+ os.remove(apf)
34
+
35
+
36
+ def get_active_profile() -> str:
37
+ """Return active profile name, verifying against saved profiles."""
38
+ current = paths.load_json(paths.mcp_config_path(), {})
39
+ recorded = ""
40
+ apf = paths.active_profile_file()
41
+ if os.path.isfile(apf):
42
+ with open(apf, "r", encoding="utf-8") as f:
43
+ recorded = f.read().strip()
44
+
45
+ pdir = paths.profile_dir()
46
+ if recorded:
47
+ p_path = os.path.join(pdir, f"{recorded}.json")
48
+ if os.path.isfile(p_path):
49
+ if paths.load_json(p_path, {}) == current:
50
+ return recorded
51
+ return f"{recorded} (modified)"
52
+
53
+ if os.path.isdir(pdir):
54
+ for fname in sorted(os.listdir(pdir)):
55
+ if fname.endswith(".json") and paths.load_json(os.path.join(pdir, fname), {}) == current:
56
+ return fname[:-5]
57
+ return "custom"
58
+
59
+
60
+ def resolve_mcp_target(profile: str | None) -> str:
61
+ if profile:
62
+ p_path = os.path.join(paths.profile_dir(), f"{profile}.json")
63
+ if not os.path.isfile(p_path):
64
+ print(f"Error: Profile '{profile}' not found at {p_path}", file=sys.stderr)
65
+ sys.exit(1)
66
+ return p_path
67
+ return paths.mcp_config_path()
68
+
69
+
70
+ def discover_tools(server_name: str) -> list[str]:
71
+ server_dir = os.path.join(paths.mcp_schemas_dir(), server_name)
72
+ if not os.path.isdir(server_dir):
73
+ return []
74
+ return [os.path.splitext(os.path.basename(p))[0] for p in sorted(glob.glob(os.path.join(server_dir, "*.json")))]
75
+
76
+
77
+ def get_server(data: dict, name: str) -> dict:
78
+ servers = data.get("mcpServers", {})
79
+ if name not in servers:
80
+ print(f"Error: Server '{name}' not found.", file=sys.stderr)
81
+ sys.exit(1)
82
+ return servers[name]
83
+
84
+
85
+ def save_mcp_target(target_path: str, data: dict, profile: str | None) -> None:
86
+ if not profile:
87
+ sync_master_reserve()
88
+ bak = paths.backup_file(target_path, "mcp_config")
89
+ else:
90
+ bak = paths.backup_file(target_path, f"profile_{profile}")
91
+ paths.save_json(target_path, data)
92
+ if bak:
93
+ print(f" (backup: {bak})")
94
+
95
+
96
+ def cmd_backup(_args) -> None:
97
+ dst = paths.backup_file(paths.mcp_config_path(), "mcp_config")
98
+ if dst:
99
+ print(f"Backup created: {dst}")
100
+ else:
101
+ print(f"No {paths.mcp_config_path()} found to back up.")
102
+
103
+
104
+ def cmd_reserve(args) -> None:
105
+ paths.ensure_dirs()
106
+ if args.reserve_cmd == "sync":
107
+ added = sync_master_reserve()
108
+ print(f"Synced {paths.mcp_config_path()} -> {paths.mcp_master_path()} ({added} new server(s) added).")
109
+ elif args.reserve_cmd == "list":
110
+ master = paths.load_json(paths.mcp_master_path(), {"mcpServers": {}})
111
+ servers = master.get("mcpServers", {})
112
+ if not servers:
113
+ print("Master reserve is empty. Run 'agy-control reserve sync' first.")
114
+ return
115
+ for name, cfg in servers.items():
116
+ print(f" {name:32s} cmd={cfg.get('command', '')}")
117
+
118
+
119
+ def cmd_recover(args) -> None:
120
+ paths.ensure_dirs()
121
+ master = paths.load_json(paths.mcp_master_path(), {"mcpServers": {}})
122
+ if args.server not in master.get("mcpServers", {}):
123
+ print(f"Error: '{args.server}' not found in master reserve ({paths.mcp_master_path()}).", file=sys.stderr)
124
+ sys.exit(1)
125
+ cfg_path = paths.mcp_config_path()
126
+ bak = paths.backup_file(cfg_path, "mcp_config")
127
+ current = paths.load_json(cfg_path, {"mcpServers": {}})
128
+ current.setdefault("mcpServers", {})[args.server] = master["mcpServers"][args.server]
129
+ paths.save_json(cfg_path, current)
130
+ print(f"Recovered '{args.server}' into {cfg_path}" + (f" (backup: {bak})" if bak else ""))
131
+
132
+
133
+ def cmd_profile(args) -> None:
134
+ paths.ensure_dirs()
135
+ pdir = paths.profile_dir()
136
+ active = get_active_profile()
137
+
138
+ if args.profile_cmd == "list":
139
+ files = sorted(f for f in os.listdir(pdir) if f.endswith(".json"))
140
+ if not files:
141
+ print("No MCP profiles saved yet.")
142
+ return
143
+ print(f"Active MCP Profile: {active}\n")
144
+ for f in files:
145
+ name = f[:-5]
146
+ marker = "*" if active == name or active.startswith(f"{name} ") else " "
147
+ pdata = paths.load_json(os.path.join(pdir, f), {})
148
+ enabled = [k for k, v in pdata.get("mcpServers", {}).items() if not v.get("disabled")]
149
+ print(f" {marker} {name:20s} enabled={enabled}")
150
+ elif args.profile_cmd == "save":
151
+ sync_master_reserve()
152
+ current = paths.load_json(paths.mcp_config_path(), {"mcpServers": {}})
153
+ out_path = os.path.join(pdir, f"{args.name}.json")
154
+ paths.save_json(out_path, current)
155
+ set_active_profile(args.name)
156
+ print(f"Saved current MCP config as profile '{args.name}' -> {out_path}")
157
+ elif args.profile_cmd == "use":
158
+ p_path = os.path.join(pdir, f"{args.name}.json")
159
+ if not os.path.isfile(p_path):
160
+ print(f"Error: Profile '{args.name}' not found at {p_path}", file=sys.stderr)
161
+ sys.exit(1)
162
+ sync_master_reserve()
163
+ cfg_path = paths.mcp_config_path()
164
+ bak = paths.backup_file(cfg_path, "mcp_config")
165
+ shutil.copy2(p_path, cfg_path)
166
+ set_active_profile(args.name)
167
+ print(f"Activated profile '{args.name}' -> {cfg_path}" + (f" (backup: {bak})" if bak else ""))
168
+
169
+
170
+ def cmd_mcp(args) -> None:
171
+ profile = getattr(args, "profile", None)
172
+ target_path = resolve_mcp_target(profile)
173
+ data = paths.load_json(target_path, {"mcpServers": {}})
174
+
175
+ if args.mcp_cmd == "list":
176
+ label = f"profile '{profile}'" if profile else f"active ({get_active_profile()})"
177
+ print(f"MCP Servers [{label}]:")
178
+ for name, cfg in data.get("mcpServers", {}).items():
179
+ status = "disabled" if cfg.get("disabled") else "enabled"
180
+ dt = cfg.get("disabledTools") or []
181
+ print(f" {name:32s} [{status:8s}] disabledTools={len(dt)} cmd={cfg.get('command', '')}")
182
+ return
183
+
184
+ if args.mcp_cmd == "tools":
185
+ servers = data.get("mcpServers", {})
186
+ targets = [args.server] if args.server else list(servers.keys())
187
+ for name in targets:
188
+ cfg = get_server(data, name)
189
+ disabled_set = set(cfg.get("disabledTools") or [])
190
+ all_tools = sorted(set(discover_tools(name)) | disabled_set)
191
+ srv_status = "disabled" if cfg.get("disabled") else "enabled"
192
+ print(f"=== {name} ({srv_status}) ===")
193
+ if not all_tools:
194
+ print(" (no tool schemas found)")
195
+ else:
196
+ for t in all_tools:
197
+ print(f" {t:35s} [{'disabled' if t in disabled_set else 'enabled'}]")
198
+ print()
199
+ return
200
+
201
+ if args.mcp_cmd == "show":
202
+ cfg = dict(get_server(data, args.server))
203
+ if not args.raw and "env" in cfg and isinstance(cfg["env"], dict):
204
+ cfg["env"] = {k: "***" for k in cfg["env"]}
205
+ print(json.dumps({args.server: cfg}, indent=2))
206
+ return
207
+
208
+ # Mutating operations: verify server exists, apply change, save with backup, optionally restart
209
+ if args.mcp_cmd in ("enable", "disable"):
210
+ disabled = args.mcp_cmd == "disable"
211
+ get_server(data, args.server)["disabled"] = disabled
212
+ msg = f"Server '{args.server}' {'disabled' if disabled else 'enabled'}."
213
+ elif args.mcp_cmd == "remove":
214
+ get_server(data, args.server)
215
+ del data["mcpServers"][args.server]
216
+ msg = f"Removed '{args.server}' (recoverable via 'agy-control recover {args.server}')."
217
+ elif args.mcp_cmd == "disable-tool":
218
+ cfg = get_server(data, args.server)
219
+ disabled = list(cfg.get("disabledTools") or [])
220
+ added = [t for t in args.tools if t not in disabled]
221
+ cfg["disabledTools"] = disabled + added
222
+ msg = f"Disabled tool(s) on '{args.server}': {', '.join(added) if added else '(already disabled)'}"
223
+ elif args.mcp_cmd == "enable-tool":
224
+ cfg = get_server(data, args.server)
225
+ disabled = list(cfg.get("disabledTools") or [])
226
+ removed = [t for t in args.tools if t in disabled]
227
+ cfg["disabledTools"] = [t for t in disabled if t not in args.tools]
228
+ msg = f"Enabled tool(s) on '{args.server}': {', '.join(removed) if removed else '(already enabled)'}"
229
+ else:
230
+ return
231
+
232
+ save_mcp_target(target_path, data, profile)
233
+ print(msg)
234
+ if getattr(args, "restart", None):
235
+ instances.restart_instances(args.restart)
agy_scripts/paths.py ADDED
@@ -0,0 +1,73 @@
1
+ """Shared path resolution, JSON I/O, and date-stamped backup helpers."""
2
+
3
+ import json
4
+ import os
5
+ import shutil
6
+ from datetime import datetime
7
+
8
+
9
+ def gemini_dir() -> str:
10
+ return os.path.expanduser(os.environ.get("AGY_GEMINI_DIR", "~/.gemini"))
11
+
12
+
13
+ def config_dir() -> str:
14
+ return os.path.join(gemini_dir(), "config")
15
+
16
+
17
+ def mcp_config_path() -> str:
18
+ return os.path.join(config_dir(), "mcp_config.json")
19
+
20
+
21
+ def mcp_master_path() -> str:
22
+ return os.path.join(config_dir(), "mcp_master.json")
23
+
24
+
25
+ def backup_dir() -> str:
26
+ return os.path.join(config_dir(), "mcp_backups")
27
+
28
+
29
+ def profile_dir() -> str:
30
+ return os.path.join(config_dir(), "mcp_profiles")
31
+
32
+
33
+ def active_profile_file() -> str:
34
+ return os.path.join(config_dir(), ".active_mcp_profile")
35
+
36
+
37
+ def mcp_schemas_dir() -> str:
38
+ return os.path.join(gemini_dir(), "antigravity", "mcp")
39
+
40
+
41
+ def summaries_db_path() -> str:
42
+ return os.path.join(gemini_dir(), "antigravity", "conversation_summaries.db")
43
+
44
+
45
+ def ensure_dirs() -> None:
46
+ os.makedirs(config_dir(), exist_ok=True)
47
+ os.makedirs(backup_dir(), exist_ok=True)
48
+ os.makedirs(profile_dir(), exist_ok=True)
49
+
50
+
51
+ def load_json(path: str, default=None):
52
+ if not os.path.isfile(path):
53
+ return default if default is not None else {}
54
+ with open(path, "r", encoding="utf-8") as f:
55
+ return json.load(f)
56
+
57
+
58
+ def save_json(path: str, data: dict) -> None:
59
+ os.makedirs(os.path.dirname(path), exist_ok=True)
60
+ with open(path, "w", encoding="utf-8") as f:
61
+ json.dump(data, f, indent=2)
62
+ f.write("\n")
63
+
64
+
65
+ def backup_file(src_path: str, prefix: str = "mcp_config") -> str | None:
66
+ """Create a date-stamped backup copy of src_path inside backup_dir()."""
67
+ ensure_dirs()
68
+ if not os.path.isfile(src_path):
69
+ return None
70
+ stamp = datetime.now().strftime("%Y%m%d_%H%M%S")
71
+ dst = os.path.join(backup_dir(), f"{prefix}_{stamp}.json")
72
+ shutil.copy2(src_path, dst)
73
+ return dst
@@ -0,0 +1,389 @@
1
+ """agy-session-search: Search, inspect, export, and resume Google Antigravity sessions."""
2
+
3
+ import argparse
4
+ import json
5
+ import os
6
+ import re
7
+ import sqlite3
8
+ import sys
9
+ from datetime import datetime, timedelta, timezone
10
+
11
+ from . import paths
12
+
13
+ STOPWORDS = {
14
+ "the", "a", "an", "and", "or", "but", "in", "on", "at", "to", "for", "of",
15
+ "with", "by", "from", "is", "are", "was", "were", "be", "been", "being",
16
+ "have", "has", "had", "do", "does", "did", "will", "would", "could", "should",
17
+ "can", "may", "might", "this", "that", "these", "those", "it", "its", "i",
18
+ "you", "we", "they", "me", "my", "your", "our", "what", "which", "who",
19
+ "how", "when", "where", "why", "if", "then", "so", "not", "no", "yes",
20
+ "just", "like", "use", "using", "make", "get", "see", "look", "also",
21
+ "there", "here", "all", "some", "any", "one", "two", "about", "into",
22
+ }
23
+
24
+
25
+ def get_db() -> sqlite3.Connection:
26
+ db_path = paths.summaries_db_path()
27
+ if not os.path.isfile(db_path):
28
+ print(f"Error: {db_path} not found.", file=sys.stderr)
29
+ sys.exit(1)
30
+ conn = sqlite3.connect(db_path)
31
+ conn.row_factory = sqlite3.Row
32
+ return conn
33
+
34
+
35
+ def detect_format(uuid: str) -> str:
36
+ gdir = paths.gemini_dir()
37
+ for sub in ("antigravity/conversations", "antigravity-ide/conversations"):
38
+ if os.path.isfile(os.path.join(gdir, sub, f"{uuid}.db")):
39
+ return "db"
40
+ for sub in ("antigravity/conversations", "antigravity-ide/conversations", "antigravity-backup/conversations"):
41
+ if os.path.isfile(os.path.join(gdir, sub, f"{uuid}.pb")):
42
+ return "pb"
43
+ return "unknown"
44
+
45
+
46
+ def find_brain_dirs(uuid: str) -> list[str]:
47
+ gdir = paths.gemini_dir()
48
+ found = []
49
+ for sub in ("antigravity/brain", "antigravity-ide/brain", "antigravity-backup/brain"):
50
+ p = os.path.join(gdir, sub, uuid)
51
+ if os.path.isdir(p):
52
+ found.append(p)
53
+ return found
54
+
55
+
56
+ def fetch_session(conn: sqlite3.Connection, uuid: str):
57
+ """Fetch summary row and ordered FTS5 chunks for a session UUID."""
58
+ cur = conn.cursor()
59
+ row = cur.execute(
60
+ "SELECT conversation_id, title, preview, step_count, last_modified_time, workspace_uris "
61
+ "FROM conversation_summaries WHERE conversation_id = ?",
62
+ (uuid,),
63
+ ).fetchone()
64
+ fts_rows = cur.execute(
65
+ "SELECT chunk_index, user_body, agent_body FROM conversations_fts "
66
+ "WHERE conversation_id = ? ORDER BY chunk_index ASC",
67
+ (uuid,),
68
+ ).fetchall()
69
+ if not row and not fts_rows:
70
+ print(f"Error: Session '{uuid}' not found.", file=sys.stderr)
71
+ sys.exit(1)
72
+ return row, fts_rows
73
+
74
+
75
+ def make_slug(text: str, max_words: int = 6) -> str:
76
+ words = re.findall(r"[a-zA-Z0-9]+", text.lower())
77
+ filtered = [w for w in words if w not in STOPWORDS and len(w) > 1]
78
+ chosen = (filtered or words)[:max_words]
79
+ return "-".join(chosen) if chosen else "untitled-session"
80
+
81
+
82
+ def best_search_term(conn: sqlite3.Connection, uuid: str, title: str, fts_rows: list) -> tuple[str, int]:
83
+ """Find a concise search term from title or user_body that hits this UUID in FTS5."""
84
+ candidates = []
85
+ if title:
86
+ words = re.findall(r"[a-zA-Z0-9_-]{3,}", title)
87
+ meaningful = [w for w in words if w.lower() not in STOPWORDS]
88
+ if len(meaningful) >= 2:
89
+ candidates.append(" ".join(meaningful[:3]))
90
+ candidates.extend(meaningful[:4])
91
+
92
+ for fr in fts_rows:
93
+ ub = (fr["user_body"] or "").strip()
94
+ if ub:
95
+ words = re.findall(r"[a-zA-Z0-9_-]{4,}", ub)
96
+ meaningful = [w for w in words if w.lower() not in STOPWORDS]
97
+ if len(meaningful) >= 2:
98
+ candidates.append(" ".join(meaningful[:2]))
99
+ candidates.extend(meaningful[:5])
100
+ break
101
+
102
+ cur = conn.cursor()
103
+ best_term = candidates[0] if candidates else uuid[:8]
104
+ best_count = 999999
105
+ for term in candidates:
106
+ try:
107
+ q = " ".join(f'"{w}"' for w in term.split())
108
+ rows = cur.execute(
109
+ "SELECT COUNT(DISTINCT conversation_id) FROM conversations_fts WHERE conversations_fts MATCH ?",
110
+ (q,),
111
+ ).fetchall()
112
+ cnt = rows[0][0] if rows else 0
113
+ if 1 <= cnt < best_count:
114
+ best_term = term
115
+ best_count = cnt
116
+ if cnt == 1:
117
+ break
118
+ except sqlite3.OperationalError:
119
+ continue
120
+ return best_term, (best_count if best_count != 999999 else 0)
121
+
122
+
123
+ def extract_transcript(brain_dirs: list[str]) -> list[tuple[str, str]]:
124
+ for bdir in brain_dirs:
125
+ t_path = os.path.join(bdir, ".system_generated", "logs", "transcript.jsonl")
126
+ if os.path.isfile(t_path):
127
+ turns = []
128
+ with open(t_path, "r", encoding="utf-8", errors="replace") as f:
129
+ for line in f:
130
+ line = line.strip()
131
+ if not line:
132
+ continue
133
+ try:
134
+ obj = json.loads(line)
135
+ except json.JSONDecodeError:
136
+ continue
137
+ t = obj.get("type")
138
+ if t == "USER_INPUT":
139
+ txt = (obj.get("content") or "").strip()
140
+ if txt:
141
+ turns.append(("USER", txt))
142
+ elif t == "PLANNER_RESPONSE":
143
+ txt = (obj.get("response") or obj.get("content") or "").strip()
144
+ if txt:
145
+ turns.append(("ASSISTANT", txt))
146
+ if turns:
147
+ return turns
148
+ return []
149
+
150
+
151
+ def extract_artifacts(brain_dirs: list[str]) -> dict[str, str]:
152
+ artifacts = {}
153
+ for bdir in brain_dirs:
154
+ for name in ("walkthrough.md", "implementation_plan.md", "task.md"):
155
+ p = os.path.join(bdir, name)
156
+ if os.path.isfile(p) and name not in artifacts:
157
+ with open(p, "r", encoding="utf-8", errors="replace") as f:
158
+ txt = f.read().strip()
159
+ if txt:
160
+ artifacts[name] = txt
161
+ return artifacts
162
+
163
+
164
+ def cmd_list(args) -> None:
165
+ conn = get_db()
166
+ rows = conn.execute(
167
+ "SELECT conversation_id, title, preview, step_count, last_modified_time, workspace_uris "
168
+ "FROM conversation_summaries ORDER BY last_modified_time DESC"
169
+ ).fetchall()
170
+
171
+ cutoff = None
172
+ if args.since:
173
+ cutoff = (datetime.now(timezone.utc) - timedelta(days=args.since)).isoformat()
174
+
175
+ shown = 0
176
+ for r in rows:
177
+ uuid = r["conversation_id"]
178
+ fmt = detect_format(uuid)
179
+ if args.format and fmt != args.format:
180
+ continue
181
+ if args.workspace and args.workspace not in (r["workspace_uris"] or ""):
182
+ continue
183
+ if cutoff and (r["last_modified_time"] or "") < cutoff:
184
+ continue
185
+
186
+ date_str = (r["last_modified_time"] or "")[:19].replace("T", " ")
187
+ title = (r["title"] or r["preview"] or "(untitled)").replace("\n", " ").strip()
188
+ if len(title) > 65:
189
+ title = title[:62] + "..."
190
+ print(f"{uuid} {date_str} [{fmt:2s}] {r['step_count']:4d} steps {title}")
191
+ shown += 1
192
+ if args.limit and shown >= args.limit:
193
+ break
194
+
195
+
196
+ def cmd_search(args) -> None:
197
+ conn = get_db()
198
+ query = args.query
199
+ if args.role == "user":
200
+ fts_query = f"user_body : ({query})"
201
+ elif args.role == "agent":
202
+ fts_query = f"agent_body : ({query})"
203
+ else:
204
+ fts_query = query
205
+
206
+ sql = (
207
+ "SELECT cs.conversation_id, cs.title, cs.last_modified_time, cs.step_count, cs.workspace_uris, "
208
+ " fts.chunk_index, fts.user_body, fts.agent_body "
209
+ "FROM conversations_fts fts "
210
+ "JOIN conversation_summaries cs ON cs.conversation_id = fts.conversation_id "
211
+ "WHERE conversations_fts MATCH ? "
212
+ "ORDER BY cs.last_modified_time DESC"
213
+ )
214
+ rows = conn.execute(sql, (fts_query,)).fetchall()
215
+ seen = set()
216
+ shown = 0
217
+ for r in rows:
218
+ uuid = r["conversation_id"]
219
+ if uuid in seen:
220
+ continue
221
+ if args.workspace and args.workspace not in (r["workspace_uris"] or ""):
222
+ continue
223
+ seen.add(uuid)
224
+ date_str = (r["last_modified_time"] or "")[:19].replace("T", " ")
225
+ fmt = detect_format(uuid)
226
+ snippet = (r["title"] or r["user_body"] or r["agent_body"] or "").replace("\n", " ").strip()
227
+ if len(snippet) > 70:
228
+ snippet = snippet[:67] + "..."
229
+ print(f"{uuid} {date_str} [{fmt:2s}] {snippet}")
230
+ shown += 1
231
+ if args.limit and shown >= args.limit:
232
+ break
233
+
234
+
235
+ def build_session_markdown(uuid: str) -> str:
236
+ conn = get_db()
237
+ row, fts_rows = fetch_session(conn, uuid)
238
+ fmt = detect_format(uuid)
239
+ brain_dirs = find_brain_dirs(uuid)
240
+ turns = extract_transcript(brain_dirs)
241
+ artifacts = extract_artifacts(brain_dirs)
242
+
243
+ title = (row["title"] if row and row["title"] else "") or "(untitled)"
244
+ last_mod = row["last_modified_time"] if row else "(unknown)"
245
+ steps = row["step_count"] if row else 0
246
+ workspaces = row["workspace_uris"] if row else "[]"
247
+
248
+ out = [
249
+ f"# Session {uuid}",
250
+ "",
251
+ f"- **Title**: {title}",
252
+ f"- **Last Modified**: {last_mod}",
253
+ f"- **Steps**: {steps}",
254
+ f"- **Format**: {fmt}",
255
+ f"- **Workspaces**: `{workspaces}`",
256
+ "",
257
+ ]
258
+
259
+ if turns:
260
+ out += ["## Transcript", ""]
261
+ for role, txt in turns:
262
+ out += [f"### {role}", "", txt, ""]
263
+ elif fts_rows:
264
+ out += ["## Indexed Content (`conversations_fts`)", ""]
265
+ for fr in fts_rows:
266
+ ub = (fr["user_body"] or "").strip()
267
+ ab = (fr["agent_body"] or "").strip()
268
+ if not ub and not ab:
269
+ continue
270
+ out.append(f"### Chunk {fr['chunk_index']}")
271
+ if ub:
272
+ out += ["", "**User:**", "", ub]
273
+ if ab:
274
+ out += ["", "**Agent:**", "", ab]
275
+ out.append("")
276
+
277
+ if artifacts:
278
+ out += ["## Brain Artifacts", ""]
279
+ for name, content in artifacts.items():
280
+ out += [f"### `{name}`", "", content, ""]
281
+
282
+ return "\n".join(out)
283
+
284
+
285
+ def cmd_show(args) -> None:
286
+ print(build_session_markdown(args.uuid))
287
+
288
+
289
+ def cmd_export(args) -> None:
290
+ md = build_session_markdown(args.uuid)
291
+ out_path = args.output or f"{args.uuid}.md"
292
+ with open(out_path, "w", encoding="utf-8") as f:
293
+ f.write(md)
294
+ print(f"Exported session {args.uuid} -> {out_path}")
295
+
296
+
297
+ def cmd_info(uuid: str) -> None:
298
+ conn = get_db()
299
+ row, fts_rows = fetch_session(conn, uuid)
300
+
301
+ title = (row["title"] if row and row["title"] else "").strip()
302
+ preview = (row["preview"] if row and row["preview"] else "").strip()
303
+ first_user = ""
304
+ for fr in fts_rows:
305
+ ub = (fr["user_body"] or "").strip()
306
+ if ub:
307
+ first_user = ub
308
+ break
309
+
310
+ slug = make_slug(title or preview or first_user)
311
+ term, hit_count = best_search_term(conn, uuid, title, fts_rows)
312
+ fmt = detect_format(uuid)
313
+ brain_dirs = find_brain_dirs(uuid)
314
+
315
+ print(f"UUID : {uuid}")
316
+ print(f"Slug : {slug}")
317
+ print(f"Search Term : {term!r} (matches {hit_count} session(s))")
318
+ print(f"Title : {title or '(untitled)'}")
319
+ print(f"Last Modified : {row['last_modified_time'] if row else '(unknown)'}")
320
+ print(f"Steps : {row['step_count'] if row else 0}")
321
+ print(f"Format : {fmt}")
322
+ print(f"Workspaces : {row['workspace_uris'] if row else '[]'}")
323
+ print(f"FTS5 Chunks : {len(fts_rows)}")
324
+ print(f"Brain Dirs : {', '.join(brain_dirs) if brain_dirs else 'none'}")
325
+ print(f"Resume Cmd : agy -r {uuid}")
326
+
327
+
328
+ def cmd_resume(args) -> None:
329
+ os.execvp("agy", ["agy", "-r", args.uuid])
330
+
331
+
332
+ def main() -> None:
333
+ parser = argparse.ArgumentParser(
334
+ prog="agy-session-search",
335
+ description="Search, inspect, export, and resume Google Antigravity sessions.",
336
+ )
337
+ parser.add_argument("--info", metavar="UUID", help="Show session info, slug, and best search term for UUID")
338
+
339
+ sub = parser.add_subparsers(dest="command")
340
+
341
+ p_list = sub.add_parser("list", help="List sessions")
342
+ p_list.add_argument("--workspace", help="Filter by workspace substring")
343
+ p_list.add_argument("--since", type=int, help="Only sessions modified in the last N days")
344
+ p_list.add_argument("--format", choices=["db", "pb"], help="Filter by storage format")
345
+ p_list.add_argument("--limit", "-n", type=int, default=25, help="Max results (default: 25)")
346
+
347
+ p_search = sub.add_parser("search", help="Full-text search across sessions")
348
+ p_search.add_argument("query", help="FTS5 search query")
349
+ p_search.add_argument("--role", choices=["user", "agent"], help="Restrict search to user or agent messages")
350
+ p_search.add_argument("--workspace", help="Filter by workspace substring")
351
+ p_search.add_argument("--limit", "-n", type=int, default=20, help="Max results (default: 20)")
352
+
353
+ p_show = sub.add_parser("show", help="Print reconstructed session to stdout")
354
+ p_show.add_argument("uuid", help="Session UUID")
355
+
356
+ p_export = sub.add_parser("export", help="Export reconstructed session to a Markdown file")
357
+ p_export.add_argument("uuid", help="Session UUID")
358
+ p_export.add_argument("-o", "--output", help="Output file path (default: <UUID>.md)")
359
+
360
+ p_info = sub.add_parser("info", help="Show session info, slug, and best search term")
361
+ p_info.add_argument("uuid", help="Session UUID")
362
+
363
+ p_resume = sub.add_parser("resume", help="Resume session in agy CLI (agy -r <UUID>)")
364
+ p_resume.add_argument("uuid", help="Session UUID")
365
+
366
+ args = parser.parse_args()
367
+
368
+ if args.info:
369
+ cmd_info(args.info)
370
+ return
371
+
372
+ if args.command == "list":
373
+ cmd_list(args)
374
+ elif args.command == "search":
375
+ cmd_search(args)
376
+ elif args.command == "show":
377
+ cmd_show(args)
378
+ elif args.command == "export":
379
+ cmd_export(args)
380
+ elif args.command == "info":
381
+ cmd_info(args.uuid)
382
+ elif args.command == "resume":
383
+ cmd_resume(args)
384
+ else:
385
+ parser.print_help()
386
+
387
+
388
+ if __name__ == "__main__":
389
+ main()
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: agy-scripts
3
+ Version: 0.1.0
4
+ Summary: Cross-platform CLI utilities for managing Google Antigravity instances, MCP configs/profiles, and session search
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Dynamic: license-file
10
+
11
+ # agy_scripts
12
+
13
+ Cross-platform CLI utilities and shell scripts for managing Google Antigravity (`antigravity-ide`, `antigravity`, and `agy`).
14
+
15
+ ## Installation
16
+
17
+ Install the Python CLI tools (`agy-control` and `agy-session-search`) in editable mode so they are available directly on your `PATH`:
18
+
19
+ ```bash
20
+ uv tool install -e .
21
+ # or with pip:
22
+ pip install -e .
23
+ ```
24
+
25
+ ## Tools
26
+
27
+ ### 1. `agy-control`
28
+ 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.
29
+
30
+ #### Subcommands
31
+ - `list` - List running Antigravity hub/IDE/app instances and show the active MCP profile
32
+ - `restart <PID|WORKSPACE|all>` - Restart matching hub instance(s) to pick up `mcp_config.json` changes
33
+ - `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)
34
+ - `mcp list|tools [SERVER]|show <SERVER>` - Inspect MCP servers and tools (`--profile NAME` targets a saved profile)
35
+ - `mcp enable|disable|remove <SERVER> [--profile NAME] [--restart [TARGET]]` - Manage servers with automatic date-stamped backup and master reserve sync
36
+ - `mcp enable-tool|disable-tool <SERVER> <TOOL...> [--profile NAME] [--restart [TARGET]]` - Toggle individual tools
37
+ - `profile list|save <NAME>|use <NAME>` - Manage named MCP profiles in `~/.gemini/config/mcp_profiles/`
38
+ - `reserve sync|list` / `recover <SERVER>` - Sync known servers to `~/.gemini/config/mcp_master.json` and restore removed servers
39
+ - `backup` - Create a date-stamped backup in `~/.gemini/config/mcp_backups/`
40
+
41
+ #### Examples
42
+ ```bash
43
+ # List running instances and active MCP profile
44
+ agy-control list
45
+
46
+ # List MCP servers and tools
47
+ agy-control mcp list
48
+ agy-control mcp tools mcp_remdev_serv_fedora
49
+
50
+ # Disable a tool and restart matching workspace instance
51
+ agy-control mcp disable-tool mcp_remdev_serv_fedora run_command --restart emdash
52
+
53
+ # Save and launch with a profile
54
+ agy-control profile save coding
55
+ agy-control launch ~/github2/emdash --ide --new --profile coding
56
+ ```
57
+
58
+ ---
59
+
60
+ ### 2. `agy-session-search`
61
+ Search, inspect, export, and resume Google Antigravity sessions (both `.db` and legacy encrypted `.pb`) using `~/.gemini/antigravity/conversation_summaries.db` and `brain/<UUID>/` artifacts.
62
+
63
+ #### Subcommands
64
+ - `list [--workspace PATH] [--since DAYS] [--format db|pb] [-n LIMIT]`
65
+ - `search <query> [--role user|agent] [--workspace PATH] [-n LIMIT]`
66
+ - `show <UUID>` / `export <UUID> [-o FILE]`
67
+ - `resume <UUID>` - Resume session via `agy -r <UUID>`
68
+ - `--info <UUID>` (or `info <UUID>`) - Show metadata, kebab-case slug, and best FTS5 search term
69
+
70
+ #### Examples
71
+ ```bash
72
+ agy-session-search list -n 10
73
+ agy-session-search search "ChatDSL" --role user
74
+ agy-session-search --info 1e7c708f-b55e-46cb-a043-6798c7507d79
75
+ agy-session-search export 1e7c708f-b55e-46cb-a043-6798c7507d79 -o session.md
76
+ ```
77
+
78
+ ---
79
+
80
+ ### 3. `update_antigravity.sh`
81
+ Automated Linux (`x86_64`) installer and updater for Antigravity IDE (`~/Apps/antigravity-ide`), Standalone App (`~/Apps/antigravity`), and `agy` CLI (`~/.local/bin/agy`).
82
+
83
+ ```bash
84
+ ./update_antigravity.sh # Check and update all components
85
+ ./update_antigravity.sh --check # Check versions and pre-download only
86
+ ./update_antigravity.sh --install --cli # Install/update only agy CLI
87
+ ```
88
+
89
+ ## Development & Tests
90
+
91
+ ```bash
92
+ PYTHONPATH=src python3 -m unittest discover -s tests -v
93
+ ```
94
+
95
+ ## License
96
+
97
+ MIT - see [LICENSE](LICENSE).
@@ -0,0 +1,12 @@
1
+ agy_scripts/__init__.py,sha256=HEdpaw3ialHWQaITN-pA5OM4kRG-HUMIF8M-2pxgMhA,80
2
+ agy_scripts/control_cli.py,sha256=LERT5OTlD8r8l8UitWPaY6fYbfHVr_iZdRP4staY2rA,5974
3
+ agy_scripts/instances.py,sha256=0jCs_yX7g_2oMRc_1UNxaRtE1EMpNRMrosODumx3njw,5762
4
+ agy_scripts/mcp.py,sha256=fvK3eM1G2tjvVFA8FxSq1AXjlv0ys9MYjQ6_Pwh5ypM,9362
5
+ agy_scripts/paths.py,sha256=kQhieZTpLpA6YuhgoG6ONpBUVpLD3t5dOhfRt-RALaU,1936
6
+ agy_scripts/sessions.py,sha256=gD0Ftwii8aHbeOvEXrg6La7xKEqdCz0tzfQK5llNUsI,14310
7
+ agy_scripts-0.1.0.dist-info/licenses/LICENSE,sha256=cusstGaNJw2UluTpbb18uHsJPb6JAWPA3OvHAJnjueA,1066
8
+ agy_scripts-0.1.0.dist-info/METADATA,sha256=x-lWmtB5eL3zdA8PakYJeg2P-bOSVqYzjgD5nRZY2wc,3873
9
+ agy_scripts-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
10
+ agy_scripts-0.1.0.dist-info/entry_points.txt,sha256=kQ3NqGp6Bxl-MBJd7u7NRvm-jCBfXLKqaSwOhjUjKhE,108
11
+ agy_scripts-0.1.0.dist-info/top_level.txt,sha256=g_7EHyAxeVNGXfkP5DT7rk_WLgOi_KbsNYsgVnJ4Uik,12
12
+ agy_scripts-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ agy-control = agy_scripts.control_cli:main
3
+ agy-session-search = agy_scripts.sessions:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jon allen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ agy_scripts