> ## Documentation Index
> Fetch the complete documentation index at: https://marrow-docs.hologrow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Gemini CLI

# 使用 Gemini CLI 连接 Marrow

Gemini CLI 是面向终端的 Google Gemini Agent，可通过 MCP 读取 Marrow 已同步数据。请先安装并登录 [Gemini CLI](https://github.com/google-gemini/gemini-cli)，连接并同步至少一个数据源，并在 AI Platforms 创建 MCP key。

在项目根目录运行：

```bash theme={null}
gemini mcp add --transport http --scope project \
  -H "Authorization: Bearer YOUR_MCP_KEY" \
  marrow "https://mcp.marrow.ai/mcp/v1"
```

将 `YOUR_MCP_KEY` 替换为实际密钥。远程 streamable HTTP 服务器必须使用 `--transport http`；`--scope project` 会写入 `.gemini/settings.json`，改用 `--scope user` 则写入 `~/.gemini/settings.json`。

重启 Gemini CLI 后运行：

```bash theme={null}
gemini mcp list
```

确认服务器已加载，再测试：

```
Show me my Amazon Seller sales for the last 7 days.
```

为避免在配置中明文保存密钥，可在 `mcpServers.marrow.headers` 中使用 `Bearer ${MARROW_MCP_KEY}`，并在启动 Gemini CLI 前导出该环境变量。Marrow 为只读，请随时在 AI Platforms 中轮换或撤销密钥。
