Gemini CLI
Gemini CLI is Google’s open-source terminal coding agent.
Overview
Section titled “Overview”| Type | CLI |
| Open Source | Yes |
| Best For | Large context, multimodal work, Google ecosystem |
Key Features
Section titled “Key Features”- Flexible Access — Works with both Google account access and API keys
- Large Context — Up to 1M tokens (see caveats below)
- Agentic — File editing, terminal commands
- Google Integration — Works with Google Cloud
- Multimodal — Image understanding
Installation
Section titled “Installation”npm install -g @google/gemini-cliAccess Model
Section titled “Access Model”Gemini CLI supports both Google account access and API-key-based access. Limits and account terms change often, so check Google’s current docs before relying on a specific allowance.
Privacy
Section titled “Privacy”| Setting | Value |
|---|---|
| Open Source | Yes (client) |
| Training | GCP terms apply |
| Jurisdiction | US (Google) |
Models Available
Section titled “Models Available”- Gemini 3 Pro (up to 1M context)
- Gemini 3 Flash (fast iteration)
- Gemini Deep Think (reasoning)
Getting Started
Section titled “Getting Started”# Authenticate with Googlegemini auth login
# Or use API keyexport GOOGLE_API_KEY=...
# Start in your projectcd your-projectgeminiKey Commands
Section titled “Key Commands”| Command | Action |
|---|---|
/help | Show commands |
/clear | Reset context |
/model <name> | Switch model |
/image <path> | Add image to context |
Use Cases
Section titled “Use Cases”Large Codebase Analysis
Section titled “Large Codebase Analysis”Gemini’s large context window helps with codebase-wide tasks:
gemini "Analyze this entire codebase and explain the architecture"Note: For very large codebases, results may be inconsistent. Consider chunking or using targeted queries.
Visual/UI Work
Section titled “Visual/UI Work”Gemini excels at visual tasks:
gemini /image screenshot.png "Improve the UI of this page"Multimodal Debugging
Section titled “Multimodal Debugging”gemini /image error-screenshot.png "What's causing this error?"- Use Gemini 3 Pro for larger context needs
- Use Gemini Flash for quick iterations
- Leverage multimodal for UI/visual tasks
- Start with the access path that matches your Google workflow, then verify current limits separately
- Don’t rely on full 1M context — quality degrades past ~200k