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

# Gemini CLI

> Run Gemini CLI through ACP in Replicas workspaces.

Replicas supports [Gemini CLI](https://github.com/google-gemini/gemini-cli) through its Agent Client Protocol mode.

## Setup

Create a key in [Google AI Studio](https://aistudio.google.com/apikey), then add it under **Gemini API Key** in [Coding Agents settings](https://replicas.dev/dashboard/agents).

See [Credentials](/admin/credentials) for personal and organization credential behavior.

## Use Gemini CLI

Choose **Gemini CLI** from the workspace agent picker. Replicas runs `gemini --acp` with Gemini 3 Flash Preview by default. You can also select Gemini 3.1 Pro Preview.

Gemini CLI streams messages and tool activity through ACP and supports persistent sessions, Plan Mode, image input, interruption, and queued-message steering. Replicas security policies run before each tool, and pull requests are discovered immediately after relevant tools complete.

Inference analytics include Gemini CLI input and output token usage.

Use Gemini CLI for repository tasks that benefit from Gemini's coding and tool-use capabilities. Select another agent when the task depends on provider-specific features Gemini CLI does not support.

## Programmatic use

Create a Gemini workspace through the [API](/features/api) with `"coding_agent": "gemini"`, or use the same value with the MCP `create_replica` tool.

```json theme={null}
{
  "name": "gemini-review",
  "environment_id": "ENVIRONMENT_UUID",
  "message": "Review this repository and fix the failing build",
  "coding_agent": "gemini"
}
```

For scheduled or event-driven work, choose Gemini CLI in the automation editor or create one with the CLI:

```bash theme={null}
replicas automation create "gemini-review" \
  --environment ENVIRONMENT_UUID \
  --prompt "Review new pull requests for regressions" \
  --agent-provider gemini
```

See [Automations](/features/automations), [MCP](/features/mcp), and the [API guide](/features/api) for trigger and authentication details.
