Gemini CLI Setup Guide
Install and configure the Gemini CLI tool to connect to the Coding Flow platform.
Gemini CLI is Google's official terminal-based AI assistant tool. This guide walks you through the installation and configuration process.
Before you begin, complete the Node.js Environment Installation Guide.
Prerequisites
- A valid API Key (e.g.
sk-******) - An accessible service address (Base URL) (usually provided by your deployment/gateway)
Common service Endpoint for This Site
Step 1: Install Gemini CLI
Windows
npm install -g @google/gemini-cliLinux
sudo npm install -g @google/gemini-climacOS(npm)
sudo npm install -g @google/gemini-climacOS(Homebrew)
brew install gemini-cliVerify the installation
After the installation is complete, run the following command. If a version number is displayed, the installation was successful.
Bash
gemini --versionStep 2: Create the configuration
Set environment variables so Gemini CLI can connect to the Coding Flow platform. You need to configure three variables:
GOOGLE_GEMINI_BASE_URL— Service endpointGEMINI_API_KEY— Your API keyGEMINI_MODEL— The model to use
Temporary setup (current session)
Windows
$env:GOOGLE_GEMINI_BASE_URL = "https://api.codingflow.ai"
$env:GEMINI_API_KEY = "YOUR_API_KEY"
$env:GEMINI_MODEL = "gemini-3-pro-preview"Linux
export GOOGLE_GEMINI_BASE_URL="https://api.codingflow.ai"
export GEMINI_API_KEY="YOUR_API_KEY"
export GEMINI_MODEL="gemini-3-pro-preview"macOS
export GOOGLE_GEMINI_BASE_URL="https://api.codingflow.ai"
export GEMINI_API_KEY="YOUR_API_KEY"
export GEMINI_MODEL="gemini-3-pro-preview"Permanent setup
Windows
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://api.codingflow.ai", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "YOUR_API_KEY", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("GEMINI_MODEL", "gemini-3-pro-preview", [System.EnvironmentVariableTarget]::User)Linux
echo 'export GOOGLE_GEMINI_BASE_URL="https://api.codingflow.ai"' >> ~/.bashrc
echo 'export GEMINI_API_KEY="YOUR_API_KEY"' >> ~/.bashrc
echo 'export GEMINI_MODEL="gemini-3-pro-preview"' >> ~/.bashrc
source ~/.bashrcmacOS
echo 'export GOOGLE_GEMINI_BASE_URL="https://api.codingflow.ai"' >> ~/.zshrc
echo 'export GEMINI_API_KEY="YOUR_API_KEY"' >> ~/.zshrc
echo 'export GEMINI_MODEL="gemini-3-pro-preview"' >> ~/.zshrc
source ~/.zshrcImportant
Replace YOUR_API_KEY with the API key you obtained from Coding Flow Platform.
Configuration parameter details
GOOGLE_GEMINI_BASE_URL: The API endpoint provided by the model provider, fixed tohttps://api.codingflow.ai/v1.GEMINI_API_KEY: The authentication key, here represented asYOUR_API_KEY.GEMINI_MODEL: The model name.
Step 3: Start using Gemini CLI
Bash
gemini