Skip to content

Gemini CLI

Gemini CLI is Google’s open-source terminal coding agent.

TypeCLI
Open SourceYes
Best ForLarge context, multimodal work, Google ecosystem
  • 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
Terminal window
npm install -g @google/gemini-cli

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.

SettingValue
Open SourceYes (client)
TrainingGCP terms apply
JurisdictionUS (Google)
  • Gemini 3 Pro (up to 1M context)
  • Gemini 3 Flash (fast iteration)
  • Gemini Deep Think (reasoning)
Terminal window
# Authenticate with Google
gemini auth login
# Or use API key
export GOOGLE_API_KEY=...
# Start in your project
cd your-project
gemini
CommandAction
/helpShow commands
/clearReset context
/model <name>Switch model
/image <path>Add image to context

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.

Gemini excels at visual tasks:

gemini /image screenshot.png "Improve the UI of this page"
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