DocsIntegrationGemini CLI

Gemini CLI

Google's official terminal agent. Two environment variables route it through the site's Gemini-compatible endpoint.

Prerequisites
Signed in with balance · key created in the right group (create a key) · model IDs from the models table or /v1/models

Download & install

Requires Node.js 20+: npm install -g @google/gemini-cli, then run gemini.

Setup steps

  1. 1
    Create a key in a group that includes Gemini models (see Create a key).
  2. 2
    Export GEMINI_API_KEY=sk-xxxx and GOOGLE_GEMINI_BASE_URL=https://api.daoxe.com (site root, no /v1 or /v1beta).
  3. 3
    Open a new terminal, run gemini, pick «Use Gemini API key» as the auth method; select a site Gemini model with -m <model-id>.
bash
# ~/.zshrc / ~/.bashrc
export GEMINI_API_KEY="sk-xxxx"
export GOOGLE_GEMINI_BASE_URL="https://api.daoxe.com"

gemini -m 你的Gemini模型ID
bash
# 先用 curl 验证 Gemini 兼容端点 / smoke-test the Gemini endpoint first
curl "https://api.daoxe.com/v1beta/models/你的Gemini模型ID:generateContent?key=sk-xxxx" \
-H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"ping"}]}]}'

Choosing models

Only Gemini-family models are served on /v1beta; copy IDs (the gemini-* series) from the recommended models table.

Common pitfalls

  • Base must be the site root https://api.daoxe.com: the CLI appends /v1beta/... itself, so an extra /v1 gives 404.
  • Environment variables only apply to new shells — reopen the terminal before running gemini.
  • Gemini models also work through OpenAI-protocol tools (Base https://api.daoxe.com/v1) — see the protocol checklist.

UI reference

Gemini CLI · auth method selection · Click image to enlarge

Related