C.W.K.
Stream
Lesson 01 of 10 · published

Install & Authenticate

~12 min · gemini, install, auth, free-tier

Level 0🌱 Novice
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

One npm package, four auth paths

Gemini CLI ships as @google/gemini-cli (open source, Apache 2.0). After install, gemini is on your PATH. Four auth options: OAuth via Google Account (free tier — 60 req/min, 1,000/day on Gemini 2.5 Flash via the gemini-cli loginflow), API key via GEMINI_API_KEY (Google AI Studio key, pay-as-you-go), Vertex AI via GOOGLE_GENAI_USE_VERTEXAI=true + GCP project (enterprise routing), Gemini Code Assist (paid Google Workspace integration with elevated quotas).

The free tier is the standout — Google ships a meaningful free quota for individual developers, with the same model that powers paid usage. Prototyping doesn't require a credit card.

Code

Install + four auth paths·bash
# Install
npm install -g @google/gemini-cli
gemini --version

# Path A — Google Account OAuth (free tier)
gemini                       # browser flow on first run

# Path B — Google AI Studio API key
echo 'export GEMINI_API_KEY="..."' >> ~/.zshrc
source ~/.zshrc

# Path C — Vertex AI (enterprise)
export GOOGLE_GENAI_USE_VERTEXAI=true
export GOOGLE_CLOUD_PROJECT=my-gcp-project
export GOOGLE_CLOUD_LOCATION=us-central1
gcloud auth application-default login

# Path D — Gemini Code Assist (Workspace)
gemini auth code-assist
Verify·bash
# Health check
gemini auth status
gemini --version

# Smoke test in a real repo
cd ~/myproject
gemini -p "list the files in this repo and describe the project"

# See available models
gemini models list

External links

Exercise

Install Gemini CLI and authenticate via the free-tier OAuth path. Run gemini auth status + a smoke prompt. Capture the rate-limit response in your notes — knowing where the free ceiling is matters.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.