Skip to content

Gemini CLI

Gemini CLI is Google’s powerful coding assistant with advanced reasoning capabilities.

Terminal window
npm install -g @google/gemini-cli

Configuring Gemini CLI to work with DeepIntShield

Section titled “Configuring Gemini CLI to work with DeepIntShield”

Gemini CLI supports multiple authentication methods. Choose the one that matches your account type.

Log in with your Google account for free-tier access (60 requests/min, 1,000 requests/day).

  1. Set the DeepIntShield base URL

    Terminal window
    export GOOGLE_GEMINI_BASE_URL=http://localhost:8080/genai
  2. Run Gemini CLI and sign in

    Terminal window
    gemini

    Select Login with Google and authenticate via your browser. All traffic automatically routes through DeepIntShield.

For users with a Gemini API key (obtain one from Google AI Studio):

  1. Configure environment variables

    Terminal window
    export GEMINI_API_KEY=your-api-key # Gemini API key or DeepIntShield virtual key
    export GOOGLE_GEMINI_BASE_URL=http://localhost:8080/genai
  2. Run Gemini CLI

    Terminal window
    gemini

    Select Use Gemini API Key in the CLI prompt for authentication.

Gemini CLI authentication

For enterprise users with Vertex AI access:

Terminal window
export GOOGLE_API_KEY=your-api-key # Google API key or DeepIntShield virtual key
export GOOGLE_GENAI_USE_VERTEXAI=true
export GOOGLE_GEMINI_BASE_URL=http://localhost:8080/genai
gemini

Now all Gemini CLI traffic flows through DeepIntShield, giving you access to any provider/model configured in your DeepIntShield setup, plus observability and governance.

Use the -m flag to start Gemini CLI with a specific model:

Terminal window
gemini -m gemini-2.5-flash
gemini -m gemini-2.5-pro

DeepIntShield automatically translates GenAI API requests to other providers, so you can use Gemini CLI with models from OpenAI, Anthropic, Mistral, and more. Use the provider/model-name format to specify any DeepIntShield-configured model.

Terminal window
# Start with an OpenAI model
gemini -m openai/gpt-5
# Start with an Anthropic model
gemini -m anthropic/claude-sonnet-4-5-20250929
# Start with a Groq model
gemini -m groq/llama-3.3-70b-versatile

DeepIntShield supports the following providers with the provider/model-name format:

openai, azure, gemini, vertex, bedrock, mistral, groq, cerebras, cohere, perplexity, xai, ollama, openrouter, huggingface, nebius, parasail, replicate, vllm, sgl