A daemon that enables CodexBar's Antigravity provider to work without the Antigravity app running.
CodexBar detects the Antigravity language server by looking for language_server_macos processes. This daemon mimics the language server endpoints that CodexBar expects, allowing you to use Antigravity's AI capabilities through CodexBar even when the Antigravity app is not open.
- Token Extraction: Reads the OAuth refresh token from Antigravity's SQLite database (
~/Library/Application Support/Antigravity/User/globalStorage/state.vscdb) - OAuth Refresh: Uses the refresh token to obtain valid access tokens from Google's OAuth service
- Quota Proxy: Proxies requests to
cloudcode-pa.googleapis.comto fetch your quota and model information - Endpoint Mimicry: Provides the endpoints CodexBar expects:
/exa.language_server_pb.LanguageServerService/GetUserStatus/exa.language_server_pb.LanguageServerService/GetCommandModelConfigs/exa.language_server_pb.LanguageServerService/GetUnleashData/v1internal:retrieveUserQuota
- Python 3.7+
- macOS
- CodexBar installed
- Antigravity app installed (duh)
# Clone the repository
git clone https://github.com/mdgld/antigravity-daemon.git
cd antigravity-daemonpython3 language_server_macos_arm.py [--port PORT]The default port is 54399. The daemon will:
- Automatically generate TLS certificates
- Extract your refresh token from Antigravity's database
- Start listening for CodexBar connections
To run automatically on login:
# Create the LaunchAgent directory if it doesn't exist
mkdir -p ~/Library/LaunchAgents
# Create the plist file
cat > ~/Library/LaunchAgents/com.user.antigravity-daemon.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.antigravity-daemon</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/Users/matthewgold/code/antigravity/language_server_macos_arm.py</string>
<string>--port</string>
<string>54399</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/antigravity-daemon.log</string>
<key>StandardErrorPath</key>
<string>/tmp/antigravity-daemon.log</string>
</dict>
</plist>
EOF
# Load the LaunchAgent
launchctl load ~/Library/LaunchAgents/com.user.antigravity-daemon.plistEnsure your ~/.codexbar/config.json has the Antigravity provider configured. The daemon will automatically pick up any planLabelOverride setting from your provider config.
You can customize the plan name displayed in CodexBar by adding a planLabelOverride to your CodexBar provider configuration:
{
"providers": [
{
"id": "antigravity",
"planLabelOverride": "My Custom Plan"
}
]
}If you need to use a different port:
python3 language_server_macos_arm.py --port 54398Logs are written to stdout. When running as a LaunchAgent, check:
tail -f /tmp/antigravity-daemon.logIf you see "oauthToken not found in globalStorage", make sure:
- Antigravity app has been launched at least once
- You are logged into Antigravity
Ensure the path exists:
ls ~/Library/Application\ Support/Antigravity/User/globalStorage/Find and kill the existing process:
lsof -i :54399
kill <PID>- TLS certificates are generated locally and stored in
/tmp/ - Refresh tokens are read from Antigravity's local database
- No credentials are stored by this daemon (tokens are cached in memory only)
MIT License