| Server IP : 85.155.190.233 / Your IP : 216.73.216.103 Web Server : nginx/1.24.0 System : Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : wp-moonbloom ( 1001) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /opt/Gemini_Swarm_Core/scripts/ |
Upload File : |
import paramiko
import os
import sys
# Reconfigure stdout/stderr to utf-8 if possible
if hasattr(sys.stdout, 'reconfigure'):
try:
sys.stdout.reconfigure(encoding='utf-8')
except Exception:
pass
if hasattr(sys.stderr, 'reconfigure'):
try:
sys.stderr.reconfigure(encoding='utf-8')
except Exception:
pass
def safe_print(msg):
try:
print(msg)
except UnicodeEncodeError:
enc = sys.stdout.encoding or 'utf-8'
print(msg.encode(enc, errors='replace').decode(enc))
IP = "85.155.190.233"
PORT = 50022
USER = "root"
KEY_PATH = os.path.expanduser("~/.ssh/id_ed25519")
def setup_cli():
safe_print(f"Connecting to {IP}:{PORT} using key {KEY_PATH}...")
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
key = paramiko.Ed25519Key.from_private_key_file(KEY_PATH)
client.connect(IP, port=PORT, username=USER, pkey=key, timeout=10)
safe_print("Connected successfully!")
except Exception as e:
safe_print(f"Connection failed: {e}")
return
def run_cmd(cmd):
safe_print(f"Running remote command: {cmd}")
stdin, stdout, stderr = client.exec_command(cmd)
exit_status = stdout.channel.recv_exit_status()
out = stdout.read().decode('utf-8', errors='replace')
err = stderr.read().decode('utf-8', errors='replace')
if exit_status != 0:
safe_print(f"Command failed with code {exit_status}")
safe_print(f"STDERR:\n{err}")
else:
safe_print("Command succeeded.")
if out.strip():
safe_print(f"STDOUT:\n{out}")
return exit_status, out, err
# 1. Install Node.js v20 from NodeSource
safe_print("Adding NodeSource Node.js v20 repository...")
run_cmd("curl -fsSL https://deb.nodesource.com/setup_20.x | bash -")
safe_print("Installing Node.js...")
run_cmd("apt-get install -y nodejs")
# 2. Verify versions
safe_print("Verifying Node.js and npm installation...")
run_cmd("node -v")
run_cmd("npm -v")
# 3. Install Antigravity CLI (agy)
safe_print("Installing Antigravity CLI (agy)...")
run_cmd("curl -fsSL https://antigravity.google/cli/install.sh | bash")
# 4. Verify agy command
safe_print("Verifying agy version...")
run_cmd("agy changelog 2>&1 | head -3 || ~/.local/bin/agy changelog 2>&1 | head -3")
client.close()
safe_print("Antigravity CLI (agy) installation on VPS completed!")
if __name__ == "__main__":
setup_cli()