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

# Gemini CLI

> 将 Gemini CLI 接入 Syon

Gemini CLI is Google's open-source AI coding CLI, available through the `gemini` command.

## 1. Install Gemini CLI from scratch

Already have Gemini CLI? Skip to the next section.

macOS users can install with Homebrew:

plaintext

```
brew install gemini-cli
```

Or install with npm:

plaintext

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

Windows users should install Node.js first, then install the CLI with npm.

## 2. Get your Syon API Key

Open the [Syon dashboard](https://syon.com/dashboard?tab=api-keys), create an account, create an API key in the `sk-...` format, and copy it. You can also view the complete model list in the dashboard.

## 3. Connect to Syon

Replace `<your-Syon-key>` with the key you copied, then paste the full block into your terminal:

plaintext

```
mkdir -p ~/.gemini && cat > ~/.gemini/.env <<'EOF'
GOOGLE_GEMINI_BASE_URL=https://api.syon.com
GEMINI_API_KEY=sk-<your-Syon-key>
GEMINI_API_KEY_AUTH_MECHANISM=bearer
EOF
```

After saving, you do not need to restart the terminal or run `source`. The next `gemini` command will read the configuration.

When you run `gemini`, the "Get started" screen asks how you want to authenticate:

1. Sign in with Google
2. Use Gemini API Key
3. Vertex AI

Highlight "Use Gemini API Key" and press Enter. Gemini will read the Syon API Key you configured. Press Enter again to continue.

If you already selected OAuth login before, reset it with:

plaintext

```
rm ~/.gemini/settings.json
```

On the next launch, the authentication wizard will appear again. Choose Use Gemini API Key.
