Gemini CLI Integration Guide

Configure the Google Gemini CLI with a QCode.cc API key — enterprise paid keys; Pro / free tiers were retired on 2026-06-18

Updated 2026-09-18
On This Page

Last verified: 2026-09-18 · 📄 Per official docs (Gemini CLI v0.60.0 (2026-09-15; Pro/free tiers stopped being served 2026-06-18, enterprise paid keys continue))

At a glance

Item Details
Models you can use Gemini ✅ · Claude ❌ · GPT ❌ · Chinese models ❌
Protocol & Base URL Gemini: https://api.qcode.cc/gemini (the CLI appends /v1beta/... itself — do not add it by hand)
Where to configure ~/.gemini/settings.json or env GOOGLE_GEMINI_BASE_URL + GEMINI_API_KEY
Official docs google-gemini/gemini-cli

⚠️ Important change: the consumer sign-in path was replaced by Google Antigravity CLI. The official post of 2026-05-19 states, verbatim, that from 2026-06-18 Gemini CLI and the Gemini Code Assist IDE extensions "will stop serving requests" — for Google AI Pro and Ultra, and for people using it free of charge with a personal account. What became available that day was Antigravity CLI and Antigravity 2.0 (the Antigravity IDE itself shipped earlier, on 2025-11-18). Enterprise is a different case: organizations on a Gemini Code Assist Standard or Enterprise licence keep access, and the same post says "Gemini CLI will remain accessible via paid Gemini and Gemini Enterprise Agent Platform API keys". So this page still applies to enterprise paid keys; Pro / Ultra / free users should move to Google Antigravity CLI.

The repository is not unmaintained: on the day of this check (2026-09-18) it still published a nightly build, and the latest stable release is v0.60.0 (2026-09-15). The accurate wording is "stopped serving consumer sign-ins", not "stopped being maintained".

🚧 Limited Availability: Gemini resources are currently available on a limited basis and not yet widely offered. If you have significant usage needs, please contact our live chat or email hi@qcode.cc — we can arrange dedicated Gemini resources for you.

QCode.cc supports Claude Code, OpenAI Codex, and Google Gemini CLI. After purchasing a plan, all three tools share the same quota, giving you flexibility to choose which tool to use.

What is Gemini CLI

Gemini CLI is Google's command-line AI programming assistant, similar to Claude Code, that helps you with code development, debugging, and file operations in the terminal.

Available Models

The following Gemini models are available through QCode.cc:

Treat the live query as authoritative — do not copy a fixed list from any document, including this one:

curl -s https://api.qcode.cc/gemini/v1beta/models \
  -H "x-goog-api-key: cr_your_qcode_key"

Whatever ids come back are the Gemini models you can call; put one in GEMINI_MODEL. The full catalogue and live prices are on qcode.cc/models.

Version note: since 2026-06-18 Gemini CLI no longer serves Pro / Ultra / free personal accounts — switch to Google Antigravity CLI (Antigravity CLI and Antigravity 2.0 became available 2026-05-19); enterprise paid keys are unaffected and can keep using Gemini CLI.

Configuration Overview

Gemini CLI requires the following environment variables:

  • GOOGLE_GEMINI_BASE_URL - Service endpoint

  • GEMINI_API_KEY - API key (same as Claude Code)

  • GEMINI_MODEL - Model selection The settings file is the other officially supported path: user-level ~/.gemini/settings.json, project-level .gemini/settings.json (project overrides user). The model is model.name, the auth type is security.auth.selectedType; string values in those files may reference environment variables with $VAR, ${VAR} or ${VAR:-default}. The docs state that GOOGLE_GEMINI_BASE_URL applies to gemini-api-key authentication, so set both variables as shown below.

macOS Configuration

Step 1: Install Node.js

Gemini CLI requires Node.js to run.

If you have Homebrew installed, use it to install Node.js:

# Update Homebrew
brew update

# Install Node.js
brew install node
Method 2: Official Download
  1. Visit https://nodejs.org/

  2. Download the LTS version for macOS

  3. Open the downloaded .pkg file

  4. Follow the installer instructions to complete installation

macOS Notes
  • You may need to use sudo if you encounter permission issues

  • First run may require approval in System Preferences

  • Terminal or iTerm2 is recommended

Verify Node.js Installation

After installation, open Terminal and run:

node --version
npm --version

If version numbers are displayed, installation was successful!

Step 2: Install Gemini CLI

Install Gemini CLI globally using npm:

npm install -g @google/gemini-cli

After installation, verify:

gemini --version

Step 3: Configure Gemini CLI Environment Variables

Set the following environment variables to connect to the proxy service:

Temporary Setup (Current Session)

Run the following commands in terminal:

export GOOGLE_GEMINI_BASE_URL="https://api.qcode.cc/gemini"
export GEMINI_API_KEY="cr_xxxxxxxxxx"
export GEMINI_MODEL="gemini-2.5-pro"

Replace cr_xxxxxxxxxx with your QCode.cc API key. Use the same API key as Claude Code.

Permanent Setup (Shell Configuration)

Add the following to your shell configuration file (~/.zshrc):

# Gemini CLI Configuration
export GOOGLE_GEMINI_BASE_URL="https://api.qcode.cc/gemini"
export GEMINI_API_KEY="cr_xxxxxxxxxx"
export GEMINI_MODEL="gemini-2.5-pro"

Then run:

source ~/.zshrc

Verify Gemini CLI Environment Variables

Verify in terminal:

echo $GOOGLE_GEMINI_BASE_URL
echo $GEMINI_API_KEY
echo $GEMINI_MODEL

Linux / WSL2 Configuration

Step 1: Install Node.js

Gemini CLI requires Node.js to run.

nvm makes it easy to manage multiple Node.js versions:

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Reload shell configuration
source ~/.bashrc

# Install latest LTS version
nvm install --lts
Method 2: Using Package Manager
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

# Fedora
sudo dnf install nodejs

# Arch Linux
sudo pacman -S nodejs npm
Linux / WSL2 Notes
  • WSL2 users should install in Linux subsystem, not Windows

  • Using nvm helps avoid permission issues

  • Ensure shell configuration file properly loads nvm

Verify Node.js Installation

After installation, open terminal and run:

node --version
npm --version

If version numbers are displayed, installation was successful!

Step 2: Install Gemini CLI

Install Gemini CLI globally using npm:

npm install -g @google/gemini-cli

After installation, verify:

gemini --version

Step 3: Configure Gemini CLI Environment Variables

Set the following environment variables to connect to the proxy service:

Temporary Setup (Current Session)

Run the following commands in terminal:

export GOOGLE_GEMINI_BASE_URL="https://api.qcode.cc/gemini"
export GEMINI_API_KEY="cr_xxxxxxxxxx"
export GEMINI_MODEL="gemini-2.5-pro"

Replace cr_xxxxxxxxxx with your QCode.cc API key. Use the same API key as Claude Code.

Permanent Setup (Shell Configuration)

Add the following to your shell configuration file (~/.bashrc):

# Gemini CLI Configuration
export GOOGLE_GEMINI_BASE_URL="https://api.qcode.cc/gemini"
export GEMINI_API_KEY="cr_xxxxxxxxxx"
export GEMINI_MODEL="gemini-2.5-pro"

Then run:

source ~/.bashrc

If using Zsh, add to ~/.zshrc and run source ~/.zshrc.

Verify Gemini CLI Environment Variables

Verify in terminal:

echo $GOOGLE_GEMINI_BASE_URL
echo $GEMINI_API_KEY
echo $GEMINI_MODEL

Windows Configuration

Step 1: Install Node.js

Gemini CLI requires Node.js to run.

  1. Open your browser and visit https://nodejs.org/

  2. Click the "LTS" version to download (recommended for stability)

  3. Double-click the downloaded .msi file

  4. Follow the installation wizard, keeping default settings

Method 2: Using Package Manager

If you have Chocolatey or Scoop installed, use command line:

# Using Chocolatey
choco install nodejs

# Or using Scoop
scoop install nodejs
Windows Notes
  • PowerShell is recommended over CMD

  • Run as Administrator if you encounter permission issues

  • Some antivirus software may flag it; add to whitelist if needed

Verify Node.js Installation

After installation, open PowerShell or CMD and run:

node --version
npm --version

If version numbers are displayed, installation was successful!

Step 2: Install Gemini CLI

Install Gemini CLI globally using npm:

npm install -g @google/gemini-cli

After installation, verify:

gemini --version

Step 3: Configure Gemini CLI Environment Variables

Set the following environment variables to connect to the proxy service:

PowerShell Temporary Setup (Current Session)

Run the following commands in PowerShell:

$env:GOOGLE_GEMINI_BASE_URL = "https://api.qcode.cc/gemini"
$env:GEMINI_API_KEY = "cr_xxxxxxxxxx"
$env:GEMINI_MODEL = "gemini-2.5-pro"

Replace cr_xxxxxxxxxx with your QCode.cc API key. Use the same API key as Claude Code.

PowerShell Permanent Setup (User Level)

Run the following commands in PowerShell:

# Set user-level environment variables (permanent)
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://api.qcode.cc/gemini", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "cr_xxxxxxxxxx", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("GEMINI_MODEL", "gemini-2.5-pro", [System.EnvironmentVariableTarget]::User)

You need to reopen PowerShell for changes to take effect.

Verify Gemini CLI Environment Variables

Verify in PowerShell:

echo $env:GOOGLE_GEMINI_BASE_URL
echo $env:GEMINI_API_KEY
echo $env:GEMINI_MODEL

Troubleshooting

Node.js Version Too Old

Problem: Gemini CLI reports Node.js version incompatibility

Solution:

  1. Check Node.js version: node --version

  2. The official requirement is Node.js 20.0.0 or higher (engines.node >=20.0.0); staying on 18 fails right after install

  3. Upgrade using nvm: nvm install --lts && nvm use --lts

Environment Variables Not Taking Effect

Problem: Cannot connect after setting environment variables

Solution:

  1. Ensure you reopened terminal or ran source command

  2. Check variable names are correct (case-sensitive)

  3. Verify API key format is correct (starts with cr_)

Network Connection Issues

Problem: Cannot connect to QCode.cc service

Solution:

  1. Check network connection

  2. Verify GOOGLE_GEMINI_BASE_URL is correctly set

  3. Try backup endpoints:

  4. Asia backup: https://asia.qcode.cc/gemini

Related Documents

Roo Code Setup
Use QCode.cc from the Roo Code VS Code extension: pick the Anthropic provider, tick the custom base URL, and Claude works
Connect SillyTavern to QCode
Chat with QCode.cc's Claude / GPT models in SillyTavern; an honest note on whether gpt-image-2 image generation can be connected, plus alternatives
Aider Integration
Configure Aider with QCode.cc: Claude over the Anthropic endpoint (anthropic/ prefix), GPT and Chinese models over the OpenAI-compatible endpoint
🚀
Get Started with QCode — Claude Code & Codex
One plan for both Claude Code and Codex, Asia-Pacific low latency
View Pricing Plans → Create Account
Team of 3+?
Enterprise: dedicated domain + sub-key management + ban protection, from ¥250/person/mo
Learn Enterprise →