♊ 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).
Install (global):
bashnpm install -g @google/gemini-cliCheck version:
bashgemini --versionUpgrade (if already installed):
bashnpm 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:
bashexport 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:
cmdset 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_URLmust behttps://api.olddog.shopand must not end with an extra/.
⚙️ Step 2: Configure endpoint & key (Option B: .env file — recommended)
- Create the config file: create a
.geminifolder under your home directory (if it doesn’t exist), and then create a file named.envinside it.- Windows:
C:\Users\您的用户名\.gemini\.env - macOS / Linux:
~/.gemini/.env
- Windows:
- Paste config: open the file and paste (replace
sk-xxxxwith your key):tomlGOOGLE_GEMINI_BASE_URL="[https://api.olddog.shop](https://api.olddog.shop)" GEMINI_API_KEY="sk-xxxxxxxxxxxxxxxx"
💡 How it’s loaded: Gemini CLI searches for
.envin order: current directory →~/.gemini/.env→~/.env. It stops at the first match, so keeping it in.geminiis 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:
GEMINI_MODEL="gemini-3.2-pro"Method 2: specify it at launch:
gemini --model gemini-3.2-pro🚀 Step 4: Verify
- Start:
geminiConfirm replies: enter any prompt. If configured correctly, Gemini CLI will connect to Old Dog AI and return a response.
Check auth: run
/authand confirm it showsUse 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_URLishttps://api.olddog.shop.Important: do not add a trailing slash
/.Switch models: besides editing
.env, you can also switch viaGEMINI_MODELenv var or the startup flag.
