Skip to main content
Glama
Antigravity File Opener

Antigravity File Opener


为什么需要这个插件?

在使用 Google Antigravity 生成脚本、文档、压缩包或配置文件时,如果每次想用外部编辑器打开文件或定位它所在的文件夹,都需要在对话框打字让 Agent 代劳,会频繁打断工作流。

Antigravity File Opener 基于官方 MCP Apps (ui://) 规范(无需修改 app.asar、无需开启调试端口、不破坏官方签名),在每轮产出文件后自动于对话气泡内渲染一张类似 OpenAI Codex 的交互式「产出文件卡片」:

  • 左键点击蓝色文件名:直接调用系统默认程序打开该文件。

  • 右键点击文件行 或 点击右侧 ⋯ 按钮:弹出打开方式菜单:

    • ↗ 默认方式打开(系统默认关联应用)

    • 📂 打开所在文件夹 / 在访达中显示(打开资源管理器并自动高亮选中该文件)

    • 💠 用 VS Code 打开(自动探测多盘符与系统路径下的 VS Code)

    • 📝 用记事本 / 文本编辑打开

    • ⚙️ 选择其他打开方式…(调出 Windows 原生“打开方式”应用选择弹窗)

    • 💻 在此目录打开终端(优先唤醒 Windows Terminal wt.exe / PowerShell / macOS Terminal)

    • 📋 复制完整路径

  • 一键定位按钮(📂 文件夹):行尾保留单次点击直达所在目录的快捷按钮。

  • 侧边栏「产出文件」汇总面板:内置 PostToolUse 自动追踪钩子,自动记录 write_file / edit_file 触碰过的文件;随时可通过右侧面板 + → 产出文件 或左侧导航栏集中查看历史产出。

  • 深浅色主题与中英双语自适应:自动跟随 Antigravity 当前主题变量与界面语言(简体中文 / English)。


Related MCP server: Antigravity Open in Default App

快速安装

前置条件:本机已安装 Node.js 18+(node 在系统 PATH 中)。本插件已预打包单文件 UI,无需运行 npm install。

方式一:让你的 Antigravity AI 助手自动代装(最省心)

直接把下面这句话复制发给 Antigravity 对话框即可:

请帮我从 GitHub 安装 antigravity-file-opener 插件到 ~/.gemini/config/plugins/file-opener 并刷新 MCP 服务。

方式二:通过 Antigravity CLI 一键安装

agy plugin install https://github.com/zzy937245098-droid/antigravity-file-opener

方式三:通过 npx 或克隆安装

# 使用 npx 一键全局安装(替换 zzy937245098-droid 为实际仓库名)
npx github:zzy937245098-droid/antigravity-file-opener install

# 或者克隆仓库后运行内置安装脚本
git clone https://github.com/zzy937245098-droid/antigravity-file-opener.git
node antigravity-file-opener/cli.js install

如需仅安装到当前项目工作区(.agents/plugins/file-opener),可加上 --workspace:

node cli.js install --workspace

卸载

node cli.js uninstall

工作原理与目录结构

antigravity-file-opener/
├── plugin.json              # Antigravity 插件清单
├── mcp_config.json          # MCP Server 启动配置
├── hooks.json               # PostToolUse 自动追踪钩子配置
├── server.js                # 零依赖跨平台 MCP App 服务端
├── cli.js                   # 全局 / 工作区一键安装与卸载 CLI
├── dist/
│   └── app.html             # 预构建单文件交互式卡片 UI (MCP App)
├── hooks/
│   └── post-tool-use.js     # 自动归档 write_file / edit_file 产出路径
├── rules/
│   └── AGENTS.md            # 引导 Agent 产出文件时自动挂载交互卡片
├── src/
│   └── app.js               # 前端交互源码 (@modelcontextprotocol/ext-apps)
└── tests/
    └── server.test.mjs      # MCP 协议与 CLI 自动化测试套件

本地二次开发

如果你想自定义菜单项或界面样式:

npm install          # 安装构建依赖 (@modelcontextprotocol/ext-apps, esbuild)
npm run build        # 重新打包 dist/app.html
npm test             # 运行自动化测试

开源协议

本项目基于 MIT License 开源。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables browsing, editing, and previewing workspace files — Markdown, images, PDFs, and Git diffs — directly inside Google Antigravity's sidebars. Provides a file tree with quick search, CodeMirror-based editing with syntax highlighting, and one-click chat context attachment, all without consuming model tokens.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables users to open generated HTML pages, PDFs, Office documents, and images straight from chat cards or a side-pane file list using their OS default application, or to choose another installed app via an Open With dropdown. Also reveals files in Finder or File Explorer, tracks recent outputs across conversations, and blocks risky executable launches.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables files generated or modified by the assistant to appear as interactive cards in chat, offering one-click actions to reveal and highlight the file in Windows File Explorer, open it with its default application, open the containing folder, or copy the full path. It also adapts automatically to light and dark themes through the MCP Apps protocol.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables an Antigravity agent to render an inline interactive card of local output files, letting users preview files in the workspace sidebar and open, reveal, or copy their paths through native Windows actions.
      MIT