Gemini CLI
Gemini CLI is a tool that lets you interact with Gemini models through a command-line interface.
You can view Help Guide for more details.
Install Gemini CLI
Install Gemini CLI globally using npm:
npm install -g @google/gemini-cliAfter installation, the gemini command will be available in your terminal.
Configuration
Gemini CLI reads its configuration from environment variables.
Step 1: Open (or create) the environment file
vim ~/.envStep 2: Add the following configuration
# Base URL for Gemini requests routed through AI Gateway
GOOGLE_GEMINI_BASE_URL=https://gateway.theturbo.ai
# Your AI Gateway / AI Gateway API key
GEMINI_API_KEY=YOUR_API_KEY
# Default Gemini model
GEMINI_MODEL=gemini-2.5-flashReplace YOUR_API_KEY with the API key generated after creating an AI Gateway instance.
Use Gemini CLI
Once configured, start Gemini CLI by running:
Gemini CLI will now send all requests through AI Gateway, allowing centralized access to Gemini models with unified authentication and management.
Last updated