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-cliConfiguration
Create Configuration Directory
mkdir -p ~/.geminiCreate .env File
Create ~/.gemini/.env file:
GOOGLE_GEMINI_BASE_URL=https://api-lb.cubence.ai
GEMINI_API_KEY=your-api-key-here
GEMINI_MODEL=gemini-3-pro-previewPlease replace your-api-key-here with the API Key created on the Cubence platform.
Create settings.json
Create ~/.gemini/settings.json file:
{
"ide": {
"enabled": true
},
"security": {
"auth": {
"selectedType": "gemini-api-key"
}
}
}Verify Configuration
Run gemini in the terminal to verify the configuration.
Create Configuration Directory
PowerShell:
mkdir $env:USERPROFILE\.geminiCreate .env File
Create .env file in the %USERPROFILE%\.gemini\ directory:
GOOGLE_GEMINI_BASE_URL=https://api-lb.cubence.ai
GEMINI_API_KEY=your-api-key-here
GEMINI_MODEL=gemini-3-pro-previewPlease replace your-api-key-here with the API Key created on the Cubence platform.
Create settings.json
Create settings.json file:
{
"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.