Skip to main content
Glama
Antigravity with Gemini
by 2580m
README.md
# Antigravity with Gemini

**English** | [简体中文](README.zh-CN.md)

> Gemini thinks. Antigravity works.

Use **Gemini Web (`gemini.google.com`)** as the high-level planning and code-review brain for **Antigravity** coding sessions, while keeping all code editing, shell execution, git operations, and testing inside your local Antigravity harness.

No API keys, no reverse proxies — uses Gemini Web's native **Connected Apps → `+ Custom` → Connect to MCP Server** with a local **read-only** MCP bridge secured by OAuth 2.1 + one-time pairing codes.

## Quick Start

Requirements: Node.js ≥ 20, git, `cloudflared`.

```bash
corepack pnpm install
corepack pnpm build
corepack pnpm test

# Start the local bridge daemon and open a secure tunnel + pairing code
node bin/a2g.js serve --workspace /path/to/your/project
node bin/a2g.js setup -w /path/to/your/project
```

Then in `https://gemini.google.com`:
1. Open **Connected Apps** → **`+ Custom`** → **Connect to MCP Server**.
2. Paste the `https://.../mcp` URL (leave **Other settings / Client ID & Secret** blank for OAuth 2.1 Dynamic Client Registration).
3. Enter the 8-character one-time pairing code on the authorization page and click **Connect**.

## Recommended Prompt Setup (Optional)

Gemini Web defaults to general Q&A behavior and often starts new chats at **low** thinking level. While optional, pairing **`4 Neon` + `Medium` thinking (Chat mode)** with engineering instructions significantly improves planning and code review quality:

- **Default model/thinking preferences**: `a2g prefs` defaults to `Neon` + `medium` (customizable via `a2g prefs set --model <name> --thinking low|medium|high`).
- **Built-in MCP `instructions`**: `a2g-bridge` automatically sends a concise engineering workflow instruction block alongside its untrusted-workspace warning.
- **Dedicated Gem (Suggested)**: Create a dedicated coding Gem at `https://gemini.google.com/gems/view` with the full engineering prompt (see [README.zh-CN.md](README.zh-CN.md#推荐提示词配置可选建议)) so it applies at full system-prompt priority without affecting everyday chats.

## Documentation

- [Architecture](docs/architecture.md)
- [A2G Protocol](docs/protocol.md)
- [Security Model](docs/security.md)
- [Antigravity Skill](skill/SKILL.md)

## License

[MIT](LICENSE)