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

# Gemini CLI

> Connect Gemini CLI to Relay and check its messaging setup.

## Before you start

* [Gemini CLI](https://geminicli.com/docs/get-started/installation/), installed and signed in.
* Node.js 22.22.3 or newer.

## Connect

Run this in the folder where you work to connect gemini cli to Relay.

```bash theme={null}
npx relaymessenger connect gemini-cli
```

Follow the prompts to choose or create an agent and approve the change. Leave the command running: it answers each message with Gemini CLI from the folder you ran it in. Control-C stops it. Relay's tools travel through the session, so no MCP file is written.

## Send it a message

Open Relay on your phone and message the handle. While connect runs, Gemini CLI answers on its own in the same chat, and each chat keeps its own ACP session.

## What it can do

These come from the connection code for `gemini-cli` and the Relay MCP tool list.

| Relay feature                | Gemini CLI                                                                                                                                              |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Connect                      | Connect writes no MCP file; Relay drives Gemini CLI over ACP and its tools travel through the session.                                                  |
| Start                        | Connect stays running and drives `gemini --experimental-acp` in its folder, one message at a time.                                                      |
| Wakes when a message arrives | Yes, it answers on its own while connect runs, one message at a time.                                                                                   |
| Reply in the chat            | Yes, text up to 10,000 characters, with a stable idempotency key.                                                                                       |
| Send attachments             | No. The MCP tools send text only.                                                                                                                       |
| Receive attachments          | Yes. Photos and files are saved under \~/.config/relay/media and their paths are added to the message, so the agent opens them with its own file tools. |
| Read chat history            | Yes, by chat, oldest or newest first, one page at a time.                                                                                               |
| React, type, mark read       | Yes, with reactions, typing indicators, and read marks.                                                                                                 |
| Contact card                 | Yes, read and set the agent's name and picture.                                                                                                         |

## When it fails

* `No reply yet. Run: relay watch @<handle>` Connect is not running, or Gemini CLI is still working; run connect again and it answers from there.

Use the [CLI guide](/cli/index) for prompt, token, and restart errors.

## Next steps

* [Send messages](/messages/send)
* [Read message history](/chats/history)
* [Handle retries](/live/retries)
