Gemini CLI
Gemini CLI is the terminal entry for Gemini. With Qiuqiu Token, use CC Switch first, then fall back to manual installation and .env when needed.
Recommended Path
- Use CC Switch Quick Config to write the Qiuqiu Token provider, Gemini CLI token, Base URL, and model.
- If CC Switch does not apply, install Gemini CLI manually.
- Continue to
.envonly when manual configuration is required.
Install and Configure
Prepare balance and the Gemini CLI Base URL in Quick Start, then create a Gemini CLI token in Create an API Token.
Windows
winget install OpenJS.NodeJS.LTS
choco install nodejs-lts
scoop install nodejs-ltsnode -v
npm -vnpm install -g @google/gemini-cligemini --versioncd your-project-folder
geminiManual Configuration
Create the configuration directory:
- Windows:
%USERPROFILE%\.gemini - macOS / Linux:
~/.gemini
mkdir %USERPROFILE%\.gemini
cd %USERPROFILE%\.geminiCreate .env
Create .env after preparing a Gemini CLI token and the OpenAI-compatible Base URL.
GEMINI_API_KEY=PASTE_GEMINI_CLI_TOKEN_KEY
GOOGLE_GEMINI_BASE_URL=https://api.qiuqiutoken.com/v1Restart all Gemini CLI terminal windows so the new configuration is loaded.
Verification
- The terminal recognizes
gemini. .envcontains the Gemini CLI token andGOOGLE_GEMINI_BASE_URL.- Gemini CLI starts in a project directory and completes a small request.
- The Qiuqiu Token console shows usage.
FAQ
geminidoes not exist: add the npm global bin directory to PATH and reopen the terminal.- Permission is insufficient during installation: fix the npm user-level directory first.
- Node.js is too old: install Node.js 18+ and reopen the terminal.
- It still connects to the default service: check
.envand old local environment variables.
