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 Google Gemini or Vertex AI Provider Account configured and a Personal Access Token (Generate here)
-
Gemini CLI Installation: Install Gemini CLI by running:
Setup Configuration
1. Create Provider Account
Create a provider account for either Google Gemini or Vertex AI:- Google Gemini: Follow the Google Gemini setup guide
- Vertex AI: Follow the Vertex AI setup guide
Provider Support: Both Google Gemini and Vertex AI providers are supported. The gateway automatically handles the necessary transformations for Vertex AI when using the Gemini CLI.
2. Get Configuration Details
Get thebase URL
and Provider Name
from your TrueFoundry AI Gateway playground using the unified code snippet:

3. Configure Environment Variables
Configure Gemini CLI to use TrueFoundry by setting these environment variables:controlPlaneURL
→ Your TrueFoundry Control Plane URLproviderAccountName
→ Your Provider Account name (eitherGoogle Gemini or Vertex AI
)your-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: