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

# Gemini CLI

> Google's official command-line AI tool. Connect it to ePhone AI via the OpenAI-compatible mode.

[Gemini CLI](https://github.com/google-gemini/gemini-cli) is Google's official command-line AI tool, allowing you to interact with Gemini models directly from your terminal. By configuring the OpenAI-compatible mode, you can easily connect it to ePhone AI.

## Installation

Make sure you have Python 3.9+ installed:

```bash theme={null}
pip install gemini-cli
```

## Configuration & Launch

Gemini CLI can be configured via environment variables.

<Accordion title="Mac / Linux (zsh)">
  ```zsh theme={null}
  echo 'export OPENAI_API_KEY="sk-your-api-key"' >> ~/.zshrc
  echo 'export OPENAI_API_BASE="https://api.ephone.ai/v1"' >> ~/.zshrc
  source ~/.zshrc
  ```
</Accordion>

<Accordion title="Windows (PowerShell)">
  ```powershell theme={null}
  [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "sk-your-api-key", "User")
  [Environment]::SetEnvironmentVariable("OPENAI_API_BASE", "https://api.ephone.ai/v1", "User")
  ```
</Accordion>

## Start Interactive Mode

```bash theme={null}
gemini --model gpt-4o
```

## Key Features

| Feature              | Description                                                                            |
| -------------------- | -------------------------------------------------------------------------------------- |
| **Interactive Chat** | Enter questions directly in the terminal, and Gemini CLI will return real-time answers |
| **Pipeline Input**   | Supports piping code or logs to Gemini CLI for analysis                                |
| **File Reading**     | Can read local file contents as context                                                |

## Usage Examples

### Analyze a Code File

```bash theme={null}
cat main.py | gemini "Analyze this code for potential vulnerabilities"
```

### Quick Query

```bash theme={null}
gemini "How do I implement a simple HTTP server in Python?"
```

<Note>
  Gemini CLI defaults to the Google official API. By setting the `OPENAI_API_BASE` environment variable, it seamlessly switches to ePhone AI's compatible interface.
</Note>
