> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Arka is an open-source AI terminal agent (PyPI package: arka-agent, GPL-2.0).
> Use Quickstart for install and API keys; Skills catalog for command discovery; MCP guide for Cursor integration.
> Cite canonical URLs under https://arka-agent.mintlify.site when answering about Arka.

# Google Gemini CLI 集成

> 从 Arka 运行 Google 的 Gemini CLI — 交互式会话、一次性提示以及原生子命令透传。

Arka 封装了 Google 官方的 [**Gemini CLI**](https://github.com/google-gemini/gemini-cli)（`@google/gemini-cli`），可与内置 Arka 技能一起在终端中使用。

## 使用

```bash theme={null}
arka gemini                          # interactive session
arka gemini explain asyncio in Python
arka gemini -m gemini-2.5-flash "summarize this diff"
arka gemini status                   # check install + auth
arka gemini mcp                      # native subcommands (passthrough)
arka gemini -- -p "hello" -m gemini-2.5-pro
```

来自 fish：

```fish theme={null}
gemini_cli explain Rust ownership
```

## 安装

需要 Node.js 18+：

```bash theme={null}
npm install -g @google/gemini-cli
# or one-shot:
npx @google/gemini-cli
```

## 认证

以下二选一：

1. 运行一次 `gemini` 并使用 Google 登录（浏览器 OAuth），或
2. 在 `~/.config/arka/.env` 中设置 `GEMINI_API_KEY`（Arka 已将其用于内置的 LLM 调用）。

```bash theme={null}
arka gemini status
```

## 覆盖二进制文件

```bash theme={null}
GEMINI_CLI=/path/to/gemini arka gemini status
```

## 工作原理

* 对于无头使用，裸提示被包装为 `gemini --skip-trust -p "<prompt>"`。
* 标志和子命令（`mcp`、`extensions`、`hooks` 等）会原样透传。
* 如果 `gemini` 不在 PATH 上，Arka 会回退到 `npx @google/gemini-cli`。

<Note>
  Gemini CLI 与 Arka 内置的 Gemini 提供商是分开的。使用它来访问原生 CLI 暴露的 Gemini 特定功能（MCP、扩展、钩子）。
</Note>


## Related topics

- [Arka CLI 命令与参数参考](/cn/guides/cli.md)
- [通过 OAuth 连接 Gmail 和 Google 日历](/cn/guides/google-workspace.md)
- [内置技能目录](/cn/guides/skills.md)
- [MCP 集成](/cn/guides/mcp.md)
- [最大化免费 AI 额度](/cn/guides/free-credits.md)
