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

# Gemini CLI

> Configura Google Gemini CLI para usar la API de TokenLab

## Resumen

Google Gemini CLI es una herramienta de línea de comandos para interactuar con los modelos de Gemini. TokenLab proporciona un punto de conexión compatible que te permite usar Gemini CLI con acceso a cientos de modelos.

<Warning>
  Esta integración debe tratarse como experimental: Gemini CLI no documenta actualmente un flujo estable con una URL base personalizada al estilo TokenLab. Si necesita una integración de TokenLab realmente compatible, prefiera Codex CLI, Claude Code u OpenCode.
</Warning>

## Requisitos del sistema

* **Node.js**: Versión 20.0+
* **SO**: Windows 10/11, macOS 10.15+, Ubuntu 20.04+ o Debian 10+

## Instalación

```bash theme={null}
npm install -g @google/gemini-cli
```

Verifica la instalación:

```bash theme={null}
gemini --version
```

## Configuración

### Paso 1: Obtén tu API Key

1. Inicia sesión en el [TokenLab Dashboard](https://tokenlab.sh/dashboard)
2. Navega a [API Keys](https://tokenlab.sh/dashboard/api)
3. Crea y copia tu API key (formato: `sk-...`)

### Paso 2: Configura las variables de entorno

**Temporal (sesión actual):**

```bash theme={null}
export GEMINI_API_KEY="sk-your-tokenlab-key"
export GOOGLE_GEMINI_BASE_URL="https://api.tokenlab.sh"
```

**Configuración permanente:**

Añade a tu archivo de configuración de shell:

<Tabs>
  <Tab title="Bash">
    ```bash theme={null}
    echo 'export GEMINI_API_KEY="sk-your-tokenlab-key"' >> ~/.bashrc
    echo 'export GOOGLE_GEMINI_BASE_URL="https://api.tokenlab.sh"' >> ~/.bashrc
    source ~/.bashrc
    ```
  </Tab>

  <Tab title="Zsh">
    ```bash theme={null}
    echo 'export GEMINI_API_KEY="sk-your-tokenlab-key"' >> ~/.zshrc
    echo 'export GOOGLE_GEMINI_BASE_URL="https://api.tokenlab.sh"' >> ~/.zshrc
    source ~/.zshrc
    ```
  </Tab>

  <Tab title="Fish">
    ```bash theme={null}
    set -Ux GEMINI_API_KEY "sk-your-tokenlab-key"
    set -Ux GOOGLE_GEMINI_BASE_URL "https://api.tokenlab.sh"
    ```
  </Tab>
</Tabs>

<Warning>
  Reinicia tu terminal después de la configuración para que los cambios surtan efecto.
</Warning>

<Note>
  **Limitación conocida**: En algunos casos, Gemini CLI puede no respetar `GOOGLE_GEMINI_BASE_URL` si existe una sesión de Google en caché. Si experimentas problemas de conexión, intenta limpiar la caché de la CLI o iniciar una nueva sesión de terminal.
</Note>

## Uso
