Gemini CLI Integration Guide

Configure the Google Gemini CLI with a QCode.cc API key — enterprise paid keys; Pro / consumer tiers were retired on 2026-06-18 (QCode does not offer Gemini for now; reference only)

Updated 2026-10-15

Need an API key? Sign up →Endpoints & base URLs →

On This Page

⚠️ Currently unavailable: QCode has temporarily taken all Gemini models offline, so the steps below for calling Gemini through QCode cannot be used for now and are kept for reference only; please use Claude, GPT, or the Chinese models instead.

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

At a glance

Item Details
Models you can use Gemini (not offered by QCode for now; reference only) · 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".

QCode.cc supports Claude Code and OpenAI Codex, which can use the same key. The Gemini CLI setup steps are kept below for reference, but QCode does not offer Gemini models for now.

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

QCode does not offer Gemini models for now. The query below shows how to list them once they are offered again (reference only):

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 other access points:

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

Get started with QCode

One API key for Claude Code, Codex and more — billed per token, per-model prices on qcode.cc/models

Enterprise →