# Gemini CLI Setup Guide

> Connect Gemini CLI to LLMoxy through ~/.gemini/.env and use `gemini-4-argon`.

Gemini CLI is Google's terminal agent. Its configuration lives in `~/.gemini/`, so you don't need to change shell environment variables.

Before you start, get an [LLMoxy token](https://en.llmoxy.com/docs/get-started/get-token). A token from the **auto** group is recommended.

## Install

```bash
npm install -g @google/gemini-cli
gemini --version
```

## Connect to LLMoxy

Create the configuration directory and write `.env`:

```bash
# macOS / Linux
mkdir -p ~/.gemini
cat > ~/.gemini/.env <<'EOF'
GOOGLE_GEMINI_BASE_URL=https://llmoxy.com
GEMINI_API_KEY=your LLMoxy API Key
GEMINI_MODEL=gemini-4-argon
EOF
```

```powershell
# Windows PowerShell
mkdir -Force "$env:USERPROFILE\.gemini"
@"
GOOGLE_GEMINI_BASE_URL=https://llmoxy.com
GEMINI_API_KEY=your LLMoxy API Key
GEMINI_MODEL=gemini-4-argon
"@ | Out-File -Encoding utf8 "$env:USERPROFILE\.gemini\.env"
```

Optional: choose API Key sign-in explicitly:

```json
{
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  }
}
```

Save the content above as `~/.gemini/settings.json` (`%USERPROFILE%\.gemini\settings.json` on Windows).

> **TIP**
> Gemini CLI's URL does **not** include `/v1`. Replace `your LLMoxy API Key` with your real token from the console.

## Launch

```bash
gemini
```

## FAQ

**`gemini: command not found`**
Make sure `node -v` works, then reopen your terminal. The package name is `@google/gemini-cli`.

**Calls fail**
Check that `.env` has no extra spaces, the token's group is auto, and the account has a balance.

**Can't connect on Linux**
Run `curl -I https://llmoxy.com`; if you need a proxy, add `HTTPS_PROXY=http://your-proxy:port` to `.env`.

This is the markdown version of https://en.llmoxy.com/docs/code-tutorials/gemini-cli.
