Gemini CLI Deployment Guide
Google AI programming assistant installation guide
Prerequisites
Please complete the Node.js environment installation first, ensuring Node.js 18+ is properly installed.
Quick Configuration with CC-Switch (Recommended)
Prerequisite
Before configuring Gemini CLI with CC-Switch, ensure you have globally installed the Gemini CLI tool via npm:
npm install -g @google/gemini-cliVerify installation: gemini --version
We recommend using the CC-Switch configuration tool for graphical configuration — simple and quick with no need to manually create configuration files.
Configuration Steps
Launch CC-Switch and Switch to the Gemini Tab
- Open the CC-Switch application
- Click the "Gemini" tab at the top
- Click the orange "+" button in the upper right corner to add a new configuration
Fill in Gemini CLI Provider Configuration
- Provider Name: Custom name (e.g., "元渊智能")
- Base URL: Enter
https://api.ai.soraliststudio.com - API Key: Paste your Gemini-specific token from the 元渊智能 platform
- Model: Select
gemini-3-pro-previewor other available models - Security settings: Adjust as needed (optional)
- Click "Save"
- CC-Switch will automatically create
~/.gemini/.envandsettings.jsonfiles - You can add multiple provider configurations and switch between them anytime
- After switching, close and restart Gemini CLI for changes to take effect
Enable Configuration
- Find the "元渊智能" configuration you just created
- Click the "Currently Used" button on the right side
- The configuration will be marked as "Currently Used" (green label)
- Restart Gemini CLI for the new configuration to take effect
System Tray Quick Switch
CC-Switch supports quick Gemini CLI configuration switching via the system tray:
- Right-click the CC-Switch icon in the system tray
- Select the Gemini category from the menu
- Directly select the configuration to switch to
- Configuration takes effect immediately
- Ensure you create a Gemini CLI-specific token from the 元渊智能 platform
- Gemini tokens are not interchangeable with Claude Code/CodeX tokens
- You need to restart Gemini CLI after switching configurations
- You can test API endpoint speed in CC-Switch
Manual Command Line Configuration
If you don't use CC-Switch, follow these steps to manually install and configure Gemini CLI.
1. Install Gemini CLI Globally
npm install -g @google/gemini-cli2. Configure Gemini CLI
Replace GEMINI_API_KEY below with your Gemini CLI-specific API key obtained from https://ai.soraliststudio.com!
Create the %USERPROFILE%\.gemini\ folder in your user directory.
Create the .env file:
GOOGLE_GEMINI_BASE_URL=https://api.ai.soraliststudio.com
GEMINI_API_KEY=your-api-key-from-元渊智能.cc
GEMINI_MODEL=gemini-3-pro-previewCreate the settings.json file:
{
"ide": {
"enabled": true
},
"security": {
"auth": {
"selectedType": "gemini-api-key"
}
}
}3. Launch Gemini CLI
gemini1. Install Gemini CLI Globally
npm install -g @google/gemini-cli2. Configure Gemini CLI
Create configuration directory:
mkdir -p ~/.gemini
cd ~/.geminiCreate .env file:
cat > .env << 'EOF'
GOOGLE_GEMINI_BASE_URL=https://api.ai.soraliststudio.com
GEMINI_API_KEY=your-api-key-from-元渊智能.cc
GEMINI_MODEL=gemini-3-pro-preview
EOFCreate settings.json file:
cat > settings.json << 'EOF'
{
"ide": {
"enabled": true
},
"security": {
"auth": {
"selectedType": "gemini-api-key"
}
}
}
EOF3. Launch Gemini CLI
gemini1. Install Gemini CLI Globally
sudo npm install -g @google/gemini-cli2. Configure Gemini CLI
Create configuration directory:
mkdir -p ~/.gemini
cd ~/.geminiCreate .env file:
cat > .env << 'EOF'
GOOGLE_GEMINI_BASE_URL=https://api.ai.soraliststudio.com
GEMINI_API_KEY=your-api-key-from-元渊智能.cc
GEMINI_MODEL=gemini-3-pro-preview
EOFCreate settings.json file:
cat > settings.json << 'EOF'
{
"ide": {
"enabled": true
},
"security": {
"auth": {
"selectedType": "gemini-api-key"
}
}
}
EOF3. Launch Gemini CLI
geminiFAQ
Where do I get the API Key?
Log in to the 元渊智能 platform and create a Gemini CLI-specific token.
Configuration File Locations
- Windows:
%USERPROFILE%\.gemini\ - macOS/Linux:
~/.gemini/
How is this guide?