Gemini
Clanker supports two Gemini provider modes: gemini-api (Google AI Studio with an API key) and gemini (Vertex AI with Application Default Credentials). Both use the Google GenAI SDK.
gemini-api (Google AI Studio)
This is the recommended mode for most users. It requires an API key from Google AI Studio.
Provider Details
| Property | Value |
|---|---|
| Config key | gemini-api |
| Default model | gemini-2.5-flash |
| Auth method | API key from Google AI Studio |
Configuration
yaml
ai:
default_provider: gemini-api
providers:
gemini-api:
model: gemini-2.5-flash
api_key_env: GEMINI_API_KEYEnvironment Variable
| Variable | Description |
|---|---|
GEMINI_API_KEY | Google AI Studio API key |
CLI Flag Overrides
| Flag | Description |
|---|---|
--ai-profile gemini-api | Select this provider |
--gemini-key <key> | Override the API key for this query |
--gemini-model <model> | Override the model for this query |
Usage Example
bash
export GEMINI_API_KEY="AIzaSy..."
clanker ask "What EC2 instances are running in us-east-1?"
# Override model
clanker ask --gemini-model gemini-2.5-pro "Generate a compliance report"gemini (Vertex AI / Application Default Credentials)
This mode uses GCP Application Default Credentials and does not require an API key. It is intended for users who already have a GCP project configured.
Provider Details
| Property | Value |
|---|---|
| Config key | gemini |
| Default model | gemini-2.0-flash |
| Auth method | GCP Application Default Credentials (gcloud auth application-default login) |
Configuration
yaml
ai:
default_provider: gemini
providers:
gemini:
model: gemini-2.0-flashSetup
Before using this provider, authenticate with GCP:
bash
gcloud auth application-default loginCLI Flag Overrides
| Flag | Description |
|---|---|
--ai-profile gemini | Select this provider |
--gemini-model <model> | Override the model for this query |
Usage Example
bash
clanker ask --ai-profile gemini "List all Cloud Run services"Fallback Behavior
If the Gemini provider fails to initialize (for example, due to missing credentials), Clanker automatically falls back to OpenAI if an OpenAI API key is available. This fallback is logged when debug mode is enabled.