Skip to Content

Gemini CLI Setup

Gemini CLI  is Google’s command-line tool for Gemini models. With OfoxAI, you can use the Gemini protocol while gaining access to a broader model selection.

Setup Steps

1. Install Gemini CLI

npm install -g @google/gemini-cli

2. Configure OfoxAI

Gemini CLI uses the Gemini native protocol. Point it to OfoxAI via the configuration file:

~/.gemini/settings.json
{ "apiKey": "<your OFOXAI_API_KEY>", "baseUrl": "https://api.ofox.ai/gemini" }

Or use environment variables:

~/.zshrc
export GEMINI_API_KEY=<your OFOXAI_API_KEY>

The base URL configuration method for Gemini CLI may change with version updates. If the above method doesn’t work, refer to the latest Gemini CLI documentation.

3. Verify

gemini "Hello, tell me about yourself"

Available Models

ModelDescription
google/gemini-3.1-pro-previewMost capable reasoning
google/gemini-3-flash-previewFast and cost-effective
google/gemini-3-pro-previewMultimodal fast model

Use Cases

  • Code generation and review — Gemini models excel at code understanding
  • Long file analysis — Leverage the 1M token context window
  • Multimodal tasks — Analyze images, PDFs, and other files

Using Gemini CLI through OfoxAI also gives you the benefits of fallback and routing optimization. See Advanced for details.

Last updated on