Gemini CLI¶
Google's Gemini AI assistant with broad knowledge and multimodal capabilities.
Overview¶
Gemini CLI is Google's command-line interface for the Gemini AI model. It excels at:
- Broad knowledge and general questions
- Documentation and explanations
- Multimodal tasks (when supported)
- Research and information gathering
Installation¶
Install Gemini CLI from Google:
Basic Usage¶
# Use Gemini with clinvk
clinvk --backend gemini "explain how this algorithm works"
clinvk -b gemini "write documentation for this API"
Models¶
| Model | Description |
|---|---|
gemini-2.5-pro |
Latest and most capable model |
gemini-2.5-flash |
Faster, optimized for speed |
Specify a model:
Configuration¶
Configure Gemini in ~/.clinvk/config.yaml:
backends:
gemini:
# Default model
model: gemini-2.5-pro
# Enable/disable this backend
enabled: true
# Extra CLI flags
extra_flags: []
Environment Variable¶
Session Management¶
Gemini uses --resume for session resume:
Sandbox Mode¶
Gemini supports sandbox mode for controlled execution:
Unified Options¶
These options work with Gemini:
| Option | Description |
|---|---|
model |
Model to use |
max_tokens |
Maximum response tokens |
max_turns |
Maximum agentic turns |
Best Practices¶
Use for Explanations
Gemini's broad knowledge makes it excellent for explaining concepts and providing context.
Leverage for Documentation
Use Gemini to write or improve documentation with its clear explanations.
Research Tasks
Gemini is great for gathering information and research-oriented queries.
Use Cases¶
Documentation¶
Explanations¶
Research¶
Code Review¶
Comparison with Other Backends¶
| Aspect | Gemini | Claude | Codex |
|---|---|---|---|
| Knowledge breadth | Excellent | Good | Good |
| Code generation | Good | Excellent | Excellent |
| Explanations | Excellent | Excellent | Good |
| Speed | Fast | Moderate | Fast |
Workflow Example¶
Use Gemini for research and documentation:
{
"steps": [
{
"name": "research",
"backend": "gemini",
"prompt": "research best practices for authentication in Go"
},
{
"name": "implement",
"backend": "claude",
"prompt": "implement authentication based on: {{previous}}"
},
{
"name": "document",
"backend": "gemini",
"prompt": "write documentation for: {{previous}}"
}
]
}
Troubleshooting¶
Backend Not Available¶
# Check if Gemini is installed
which gemini
# Check clinvk detection
clinvk config show | grep gemini
Authentication¶
Ensure you have valid Google Cloud credentials configured for the Gemini CLI.