Updated:

Gemini CLI Setup

Gemini CLI is an official command-line tool provided by Google. Through the Cubence platform, you can use Gemini series models.

Base URL and routes

The examples use the Mainland China route, https://api-lb.cubence.ai. For global use, set the Base URL to https://api.cubence.ai; outside Mainland China, you can use https://api.cubence.com. Keep any request path when switching routes. See API endpoints and Base URL configuration.


Installation

Before installing the CLI, make sure your computer has Node >= 18 installed.

npm install -g @google/gemini-cli

Configuration

Create Configuration Directory

mkdir -p ~/.gemini

Create .env File

Create ~/.gemini/.env file:

.env
GOOGLE_GEMINI_BASE_URL=https://api-lb.cubence.ai
GEMINI_API_KEY=your-api-key-here
GEMINI_MODEL=gemini-3-pro-preview

Please replace your-api-key-here with the API Key created on the Cubence platform.

Create settings.json

Create ~/.gemini/settings.json file:

settings.json
{
"ide": {
  "enabled": true
},
"security": {
  "auth": {
    "selectedType": "gemini-api-key"
  }
}
}

Verify Configuration

Run gemini in the terminal to verify the configuration.


Having Issues?

Check the FAQ, or get help through pre-sales and after-sales support.