Skip to content

♊ Gemini CLI Integration Guide ​

Gemini CLI is Google’s official terminal tool for calling Gemini models. With this guide, you can point it to Old Dog AI and call top models such as gemini-3.2-pro with ultra‑long context directly from your terminal.


📥 Step 1: Prerequisites & installation ​

Before using it, make sure Node.js is installed (recommended v20 or higher).

  1. Install (global):

    bash
    npm install -g @google/gemini-cli
  2. Check version:

    bash
    gemini --version
  3. Upgrade (if already installed):

    bash
    npm upgrade -g @google/gemini-cli

⚙️ Step 2: Environment variables (Option A: temporary) ​

For a quick connectivity test, set environment variables in the current shell (replace sk-xxxx with your API key):

  • macOS / Linux:

    bash
    export GOOGLE_GEMINI_BASE_URL="[https://api.olddog.shop](https://api.olddog.shop)"
    export GEMINI_API_KEY="sk-xxxxxxxxxxxxxxxx"
  • Windows PowerShell:

    powershell
    $env:GOOGLE_GEMINI_BASE_URL="[https://api.olddog.shop](https://api.olddog.shop)"
    $env:GEMINI_API_KEY="sk-xxxxxxxxxxxxxxxx"
  • Windows CMD:

    cmd
    set GOOGLE_GEMINI_BASE_URL=[https://api.olddog.shop](https://api.olddog.shop)
    set GEMINI_API_KEY=sk-xxxxxxxxxxxxxxxx

⚠️ Note: The value of GOOGLE_GEMINI_BASE_URL must be https://api.olddog.shop and must not end with an extra /.

  1. Create the config file: create a .gemini folder under your home directory (if it doesn’t exist), and then create a file named .env inside it.
    • Windows: C:\Users\您的用户名\.gemini\.env
    • macOS / Linux: ~/.gemini/.env
  2. Paste config: open the file and paste (replace sk-xxxx with your key):
    toml
    GOOGLE_GEMINI_BASE_URL="[https://api.olddog.shop](https://api.olddog.shop)"
    GEMINI_API_KEY="sk-xxxxxxxxxxxxxxxx"

💡 How it’s loaded: Gemini CLI searches for .env in order: current directory → ~/.gemini/.env → ~/.env. It stops at the first match, so keeping it in .gemini is recommended.


🤖 Step 3: Set a default model (optional) ​

To ensure you call gemini-3.2-pro or gemini-2.5-pro, you can set a default model.

  • Method 1 (recommended): add a line to the .env file:
toml
GEMINI_MODEL="gemini-3.2-pro"
  • Method 2: specify it at launch:
bash
gemini --model gemini-3.2-pro

🚀 Step 4: Verify ​

  1. Start:
bash
gemini
  1. Confirm replies: enter any prompt. If configured correctly, Gemini CLI will connect to Old Dog AI and return a response.

  2. Check auth: run /auth and confirm it shows Use Gemini API key.


💡 Troubleshooting ​

  • GEMINI_API_KEY not set: verify the .env file path and name (especially on Windows, ensure it’s .env not .env.txt).

  • Timeouts / errors:

  • Ensure GOOGLE_GEMINI_BASE_URL is https://api.olddog.shop.

  • Important: do not add a trailing slash /.

  • Switch models: besides editing .env, you can also switch via GEMINI_MODEL env var or the startup flag.