What is Gemini CLI?
The Gemini command line interface (CLI) is Google’s official AI coding assistant that runs directly in your terminal. It understands your codebase and helps you code faster through natural language commands.Prerequisites
Before integrating Gemini CLI with TrueFoundry, ensure you have:- TrueFoundry Account: A TrueFoundry account with at least one Gemini Provider Account configured and a Personal Access Token (Generate here)
-
Gemini CLI Installation: Install Gemini CLI by running:
Setup Configuration
First, get thebase URL
and Provider Name
from your TrueFoundry AI Gateway playground using the unified code snippet:

controlPlaneURL
→ Your TrueFoundry Control Plane URLgoogleGeminiProviderName
→ Your Gemini Provider Account nameyour-truefoundry-api-key
→ Your TrueFoundry Personal Access Token
Using Gemini CLI
-
Start the CLI:
-
Setup Authentication:
- If you see authentication options, choose
Use Gemini API Key
- If not prompted, type
/auth
and select the Use Gemini API Key option
- If you see authentication options, choose

-
Start using Gemini:
Why not Vertex AI?Gemini CLI supports both Vertex AI and Gemini API. However, Vertex AI mode constructs URLs automatically based on your
GCP project and region
, ignoring the GOOGLE_GEMINI_BASE_URL
environment variable. Since TrueFoundry needs to route requests through our gateway, we use Direct Gemini mode which allows base URL customization.