Antigravity Bridge
One-directional knowledge bridge from Google Antigravity IDE to OpenClaw.
Syncs .md files from your Antigravity/Gemini projects into the OpenClaw workspace, where they are natively embedded and indexed for memory_search. No MEMORY.md dumping, no custom state tracking — just files on disk, indexed automatically.
When to Use
- - User says "sync antigravity", "bridge sync", "pull antigravity docs"
- You need cross-project awareness of Antigravity-managed context
- After an Antigravity session, to surface new decisions/rules/tasks to OpenClaw
- Scheduled (cron) to keep the knowledge fresh automatically
When NOT to Use
- - Primary coding work (use Antigravity for that — it has IDE, LSP, deep code awareness)
- Writing back to Antigravity projects (this is one-way only: Antigravity → OpenClaw)
- Querying the synced knowledge (just use
memory_search — the files are already indexed)
Architecture
CODEBLOCK0
Key design decisions:
- - Files land in
antigravity/<project-name>/ under the OpenClaw workspace destination - OpenClaw's native embedder indexes them automatically via INLINECODE4
- INLINECODE5 is idempotent — safe to run repeatedly or on cron
- Source paths that don't exist are skipped gracefully (no failure)
Setup Guide
Step 1: Prerequisites
CODEBLOCK1
Step 2: Copy the config template
CODEBLOCK2
Step 3: Edit the config
Open ~/.openclaw/workspace/antigravity-bridge.yaml and configure your projects:
CODEBLOCK3
- -
projects — list of Antigravity-managed repos knowledge — standalone knowledge directories (e.g. Gemini's global knowledge store)destination — subfolder within the OpenClaw workspace (default: antigravity)
Step 4: Configure OpenClaw extraPaths
Tell OpenClaw to index the synced directory. In your OpenClaw config (~/.openclaw/config.yaml or equivalent), add:
CODEBLOCK4
Replace with the actual workspace path. After saving, restart OpenClaw or reload memory indexing.
Step 5: Test with --dry-run
CODEBLOCK5
You'll see what would be synced without touching anything.
Step 6: Run for real
CODEBLOCK6
Step 7: Verify with memory_search
After syncing, query OpenClaw memory to confirm indexing:
CODEBLOCK7
If results come back from the synced files, the bridge is working.
Config Reference
CODEBLOCK8
Path types:
- - Directory — rsync runs with
--include='*.md' --exclude='*' recursively - Single file — rsync copies the file directly (must end in
.md)
Missing sources: If a configured path doesn't exist, sync.sh logs a warning and skips it. Other paths continue normally. Exit code remains 0.
CLI Reference
CODEBLOCK9
Examples:
CODEBLOCK10
Cron Integration
Add to crontab (crontab -e) for automatic syncing:
CODEBLOCK11
Create the log directory first:
CODEBLOCK12
Troubleshooting
yq: command not found
Install yq: brew install yq (macOS) or see https://github.com/mikefarah/yq
Config file not found
Copy the template: INLINECODE18
rsync: command not found
Install rsync: brew install rsync (macOS) or INLINECODE21
No results from memory_search
- - Check that
memorySearch.extraPaths includes the destination folder - Restart OpenClaw after changing extraPaths
- Verify files landed in the right place: INLINECODE23
Files not updating
- - Run with
--verbose to see rsync output - Check source paths exist: INLINECODE25
Wrong files synced
- - Only
.md files are synced (rsync filter: --include='*.md' --exclude='*') - To sync other file types, edit sync.sh patterns
Security & Privacy
- - All data stays local. No external API calls, no cloud sync, no network access.
- Only
.md files are synced. rsync filters (--filter='+ *.md' --filter='- *') enforce markdown-only transfer. No secrets, credentials, API keys, binary state, session tokens, or config files are ever copied. - INLINECODE30 and
.gemini/ directories are Antigravity's documentation folders containing markdown notes about rules, tasks, memory, and project context. They do not contain credentials or sensitive runtime state — those are stored elsewhere by the IDE. - sync.sh only reads from user-configured source paths and writes to a designated OpenClaw workspace subfolder.
- No credentials or tokens required to run.
- Safe to run with
--dry-run to inspect behavior before committing. - Dependencies:
rsync (system), yq (YAML parser) — both declared in manifest metadata.
反重力桥
从Google Antigravity IDE到OpenClaw的单向知识桥。
将Antigravity/Gemini项目中的.md文件同步到OpenClaw工作区,这些文件会被原生嵌入并索引以供memory_search使用。无需MEMORY.md转储,无需自定义状态跟踪——只需磁盘上的文件,自动索引。
何时使用
- - 用户说同步antigravity、桥接同步、拉取antigravity文档
- 你需要跨项目感知Antigravity管理的上下文
- 在Antigravity会话之后,将新的决策/规则/任务呈现给OpenClaw
- 定时(cron)自动保持知识更新
何时不使用
- - 主要编码工作(使用Antigravity——它拥有IDE、LSP、深度代码感知)
- 写回Antigravity项目(这是单向的:Antigravity → OpenClaw)
- 查询已同步的知识(只需使用memory_search——文件已被索引)
架构
Antigravity IDE OpenClaw 工作区
───────────────── ─────────────────────────────
~/repo/acme-corp/acme-platform/
.agent/memory/ ──rsync──► antigravity/acme-platform/
.agent/rules/ ──rsync──► .agent/memory/
.agent/skills/ ──rsync──► .agent/rules/
.agent/sessions/ ──rsync──► .agent/skills/
.agent/tasks.md ──rsync──► .agent/sessions/
.gemini/GEMINI.md ──rsync──► .agent/tasks.md
docs/ ──rsync──► .gemini/GEMINI.md
*.md (根目录) ──rsync──► docs/
*.md (根目录)
~/.gemini/antigravity/
knowledge/ ──rsync──► antigravity/gemini-knowledge/
───────────────── ─────────────────────────────
│
OpenClaw 原生嵌入器
(memorySearch.extraPaths)
│
memory_search 查询 ✓
关键设计决策:
- - 文件放置在OpenClaw工作区目标下的antigravity/<项目名称>/中
- OpenClaw的原生嵌入器通过memorySearch.extraPaths自动索引它们
- sync.sh是幂等的——可安全重复运行或通过cron运行
- 不存在的源路径会被优雅跳过(不会失败)
设置指南
步骤1:前置条件
bash
rsync(通常在macOS/Linux上预装)
rsync --version
yq — YAML解析器(需要安装)
brew install yq # macOS
或:sudo apt install yq # Ubuntu/Debian
或:snap install yq # Ubuntu snap
yq --version
步骤2:复制配置模板
bash
cp ~/.openclaw/workspace/skills/antigravity-bridge/config-template.yaml \
~/.openclaw/workspace/antigravity-bridge.yaml
步骤3:编辑配置
打开~/.openclaw/workspace/antigravity-bridge.yaml并配置你的项目:
yaml
projects:
- name: acme-platform
repo: ~/repo/acme-corp/acme-platform
paths:
- .agent/memory
- .agent/rules
- .agent/skills
- .agent/tasks.md
- .gemini/GEMINI.md
- docs
includerootmd: true
knowledge:
- name: gemini-knowledge
path: ~/.gemini/antigravity/knowledge
destination: antigravity
- - projects — Antigravity管理的仓库列表
- knowledge — 独立的知识目录(例如Gemini的全局知识存储)
- destination — OpenClaw工作区内的子文件夹(默认:antigravity)
步骤4:配置OpenClaw extraPaths
告诉OpenClaw索引同步的目录。在你的OpenClaw配置(~/.openclaw/config.yaml或等效文件)中,添加:
yaml
memorySearch:
extraPaths:
- ~/path/to/openclaw/workspace/antigravity
替换为实际的工作区路径。保存后,重启OpenClaw或重新加载内存索引。
步骤5:使用--dry-run测试
bash
~/.openclaw/workspace/skills/antigravity-bridge/sync.sh --dry-run --verbose
你将看到将要同步的内容,而不会实际改动任何东西。
步骤6:实际运行
bash
~/.openclaw/workspace/skills/antigravity-bridge/sync.sh --verbose
步骤7:使用memory_search验证
同步后,查询OpenClaw内存以确认索引:
memory_search: acme-platform agent rules
memory_search: GEMINI.md
如果从同步的文件中返回结果,说明桥接工作正常。
配置参考
yaml
~/.openclaw/workspace/antigravity-bridge.yaml
projects:
- name: <字符串> # 标识符 — 用作子文件夹名称
repo: <路径> # Antigravity项目的根目录(~会被展开)
paths: # 相对于项目根目录的路径列表
- .agent/memory # 目录 → 递归同步 *.md
- .agent/tasks.md # 单个文件 → 直接同步
- docs # 目录 → 递归同步 *.md
includerootmd: true # 也同步项目根目录的 *.md 文件(可选,默认:false)
knowledge:
- name: <字符串> # 标识符 — 用作子文件夹名称
path: <路径> # 要同步 *.md 的源路径(~会被展开)
destination: antigravity # OpenClaw工作区中的目标子文件夹
# 完整路径:<工作区>/<目标>/
路径类型:
- - 目录 — rsync使用--include=.md --exclude=递归运行
- 单个文件 — rsync直接复制文件(必须以.md结尾)
缺失源: 如果配置的路径不存在,sync.sh会记录警告并跳过。其他路径继续正常执行。退出码保持为0。
CLI参考
sync.sh [选项]
选项:
--config <路径> 配置文件(默认:~/.openclaw/workspace/antigravity-bridge.yaml)
--project <名称> 仅同步此项目(按名称)
--dry-run 显示将要同步的内容,不进行实际更改
--verbose 显示rsync输出和详细进度
--help 显示此帮助
示例:
bash
同步所有内容
sync.sh
仅同步一个项目
sync.sh --project acme-platform
预览而不改动文件
sync.sh --dry-run --verbose
使用自定义配置
sync.sh --config ~/my-bridge.yaml
Cron集成
添加到crontab(crontab -e)以实现自动同步:
cron
反重力桥 — 工作时间每小时同步(周一至周五,08:00-18:00)
0 8-18
1-5 ~/.openclaw/workspace/skills/antigravity-bridge/sync.sh >> ~/.openclaw/logs/antigravity-bridge.log 2>&1
每晚完全同步(所有天,02:00)
0 2
* ~/.openclaw/workspace/skills/antigravity-bridge/sync.sh --verbose >> ~/.openclaw/logs/antigravity-bridge.log 2>&1
首先创建日志目录:
bash
mkdir -p ~/.openclaw/logs
故障排除
yq: command not found
安装yq:brew install yq(macOS)或参见 https://github.com/mikefarah/yq
Config file not found
复制模板:cp config-template.yaml ~/.openclaw/workspace/antigravity-bridge.yaml
rsync: command not found
安装rsync:brew install rsync(macOS)或 sudo apt install rsync
memory_search没有结果
- - 检查memorySearch.extraPaths是否包含目标文件夹
- 更改extraPaths后重启OpenClaw
- 验证文件是否在正确位置:ls ~/.openclaw/workspace/antigravity/
文件未更新
- - 使用--verbose运行以查看rsync输出
- 检查源路径是否存在: