Add Antigravity fleet tools: af (fleet connector), agy-mode (mode switcher), aa (act), ap (plan)

This commit is contained in:
Kryštof Pešek
2026-10-30 19:34:34 +01:00
parent dc84a14bd2
commit 0e7918c4a3
4 changed files with 83 additions and 0 deletions
Executable
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# ~/bin/af - Antigravity Fleet Unified Session Connector
# Attaches to the central persistent Antigravity CLI session on boxC.
SESSION_NAME="agy"
CENTRAL_IP="10.0.0.14"
CENTRAL_HOST="boxC"
REMOTE_PORT="2222"
EXTERNAL_HOST="home"
# Determine current hostname
CURRENT_HOST="$(hostname)"
if [[ "$CURRENT_HOST" == "boxC" || "$CURRENT_HOST" == "B" ]]; then
# Already on central node: attach or create local tmux session
exec tmux new-session -A -s "$SESSION_NAME" agy "$@"
else
# Remote node (bazina, t520, chromebook, or phone)
# 1. Try local LAN first
if ping -c 1 -W 1 "$CENTRAL_IP" &>/dev/null; then
exec ssh -t "$CENTRAL_HOST" "tmux new-session -A -s '$SESSION_NAME' agy $*"
else
# 2. Fallback to external SSH via home gateway
echo "LAN connection to $CENTRAL_HOST unreachable, attempting external fallback..."
exec ssh -p "$REMOTE_PORT" -t "$EXTERNAL_HOST" "tmux new-session -A -s '$SESSION_NAME' agy $*"
fi
fi