Skip to content

YashMahawa/antigravity-server-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antigravity Server Control

Operate a remote Antigravity IDE from Telegram using Chrome DevTools Protocol (CDP), without private API interception.

Features

  • Send prompts from Telegram to Antigravity.
  • Inspect state with /status, /screen, and /conversation.
  • Switch models from /models.
  • Run safely with workspace restriction (AUTHORIZED_WORKSPACE_ROOT).
  • Handle approval prompts with manual mode or AUTO_ALLOW=true.

Project layout

  • index.js — Telegram bot entrypoint.
  • src/cdp.js — CDP automation engine.
  • setup.sh — systemd + environment bootstrap.
  • scripts/auth-link.js — emits a browser login URL.
  • scripts/smoke-test.js — checks CDP/model access.
  • scripts/export-antigravity-profile.sh — export signed-in profile from laptop.
  • scripts/import-antigravity-profile.sh — import profile archive on server.
  • scripts/migrate-antigravity-profile.sh — one-step laptop→server profile migration.

Quick start (fresh server)

  1. Install dependencies and prepare .env:
npm install
cp .env.example .env
  1. Set at least:
BOT_TOKEN=...
AUTHORIZED_CHAT_ID=...
  1. Run setup:
npm run setup
  1. Start services:
systemctl --user start <service-prefix>-xvfb <service-prefix>-ide <service-prefix>-bot
  1. Verify:
npm run smoke

Copy existing Antigravity login/config from laptop to server

This is the fastest path for new users who are already signed in locally.

One-step (recommended)

Run this from your laptop in this repo:

npm run profile:migrate -- <server-user>@<server-host> --service-prefix <service-prefix>

Example:

npm run profile:migrate -- raid@10.36.16.97 --service-prefix agsc-yash

This single command exports local profile, uploads it, imports on server, and restarts <service-prefix>-ide + <service-prefix>-bot.

Useful options:

npm run profile:migrate -- <server> --source ~/.config/Antigravity --remote-data-dir ~/.antigravity-server-data --service-prefix agsc-myinstance
npm run profile:migrate -- <server> --no-restart

On laptop/workstation

Create a profile archive:

bash scripts/export-antigravity-profile.sh ~/antigravity-profile.tar.gz

If auto-detection fails, provide source explicitly:

bash scripts/export-antigravity-profile.sh ~/antigravity-profile.tar.gz --source "<local-antigravity-profile-dir>"

Copy the archive to server:

scp ~/antigravity-profile.tar.gz <server-user>@<server-host>:/tmp/

On server

Import to your server user-data directory:

bash scripts/import-antigravity-profile.sh /tmp/antigravity-profile.tar.gz ~/.antigravity-server-data

Set in .env:

AG_USER_DATA_DIR=/home/<server-user>/.antigravity-server-data

Then restart the IDE service when you are ready:

systemctl --user restart <service-prefix>-ide

Environment settings

  • Required: BOT_TOKEN, AUTHORIZED_CHAT_ID
  • Common: AUTHORIZED_WORKSPACE_ROOT, SERVICE_PREFIX, CDP_PORT, DISPLAY_NUM
  • Runtime data: AG_USER_DATA_DIR, AG_EXTERNAL_OPEN_CAPTURE_FILE
  • Optional default approval: AUTO_ALLOW=true

Telegram commands

  • /help
  • /status
  • /stop
  • /new
  • /screen
  • /conversation
  • /models
  • /open <relative-or-absolute-path-within-workspace-root>
  • /auto on
  • /auto off
  • /restart
  • /shutdown

Security and privacy

  • Only AUTHORIZED_CHAT_ID can control the bot.
  • File operations are constrained to AUTHORIZED_WORKSPACE_ROOT.
  • Do not commit .env, profile archives, screenshots, or logs.
  • Repository files are host/user/token agnostic by default.

Common operations

Start:

systemctl --user start <service-prefix>-xvfb <service-prefix>-ide <service-prefix>-bot

Stop:

systemctl --user stop <service-prefix>-bot <service-prefix>-ide <service-prefix>-xvfb

Tail bot logs:

journalctl --user -u <service-prefix>-bot -f

Print login URL:

npm run auth:url

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors