Claude Code showed a terminal agent on Anthropic. Gemini CLI is Google’s peer: an open-direction command-line coding agent that calls Gemini models (AI Studio, Gemini API, or Vertex AI). Cross-link Vol. 22.1 Google / DeepMind / Gemini / Vertex and Vol. 18 Gemini SDK—same substrate, different job (developer agent vs your FastAPI backend).
Gemini’s long context (Vol. 11 context length) is the catalog differentiator versus typical IDE Tab windows. Vol. 15 agent loops + HITL still apply. After this lecture the module leaves terminals and IDEs for prompt-to-app builders: Bolt.new.
Learning Objectives
By the end of this lesson, students should be able to:
- Describe Gemini CLI as a terminal coding agent on Gemini / Vertex, not an IDE autocomplete plugin.
- Explain when long context helps repo Q&A vs when retrieval + ignore files still win.
- Authenticate via AI Studio API key vs Vertex IAM without mixing consumer and VPC data terms.
- Compare Gemini CLI to Claude Code, Copilot CLI, and GUI IDEs qualitatively.
- Apply HITL tool permissions and Vol. 20 privacy to shell/file tools.
- Know when Google-estate teams should standardize here vs Anthropic or GitHub.
Gemini CLI is Google’s command-line interface for agentic coding (and related developer tasks) using Gemini models. It typically runs in a repository, uses tools (read/write, shell, search), and can attach large context or project instruction files (names such as GEMINI.md evolve—check current docs). It may be distributed as an open-source CLI that you point at AI Studio, the Gemini API, or Vertex. It is not a replacement for the Gemini SDK inside your product, and it is not VS Code Tab.
Agentic CLI vs Autocomplete vs Long Context
| Mode | What Gemini CLI is | What it is not |
|---|---|---|
| Agent loop | Plan → tools → edit → test (Vol. 15) | Unsupervised prod deploy |
| Autocomplete | Optional via IDE plugins elsewhere (Gemini in VS Code/Android Studio, etc.) | This CLI’s headline job |
| Long context | Can ingest large specs / many files when the window allows | A reason to paste .env or ignore Vol. 11 lost-in-the-middle |
| Multimodal | Screenshots / diagrams into the CLI when supported | A substitute for Vol. 19 eval |
Lean on long context
- One-shot “read this RFC + these 8 files”
- Migration notes that must stay consistent
- When retrieval indexes are immature
Still retrieve / ignore
- Monorepos larger than the useful window
- Secrets, lockfiles, build artifacts
- High-frequency Tab-like edits (use an IDE)
Vertex vs AI Studio
- Vertex: IAM, VPC-SC, enterprise DPA
- AI Studio keys: fast student labs
- Do not mix prod customer data into Studio keys
Privacy and Repo Context
Same rules as Claude Code: the agent sees what it reads. Google data-use terms differ between consumer Gemini, AI Studio, and Vertex—Vol. 20 privacy means you pick the SKU before pointing the CLI at a private repo. Ignore secrets. Prefer project-scoped workdirs. HITL on shell. Long context is not a privacy feature; it can make over-sharing easier.
Catalog Snapshot (Qualitative)
| Dimension | Gemini CLI | Claude Code | Cursor / Copilot |
|---|---|---|---|
| Pricing posture | Gemini API / AI Studio / Vertex usage (and any CLI-related quotas); possible free-tier experiments—live SKU sheet | Anthropic plan / API tokens | IDE seats + premium/agent meters |
| Strengths | Long context; Google Cloud alignment; open CLI; multimodal inputs; pairs with Vertex | Mature agent UX; Claude coding quality; CLAUDE.md culture | Ghost text + visual diff; Copilot multi-IDE |
| Weaknesses | Newer habit-share than Copilot/Cursor; IAM/setup cost on Vertex; not a full IDE | Not Google-estate native; no Tab | Weaker huge-context paste story; GitHub/VS Code gravity |
| Agentic vs autocomplete | Agentic CLI default | Agentic CLI default | Autocomplete + agents |
| Privacy / repo | Choose Studio vs Vertex terms deliberately; ignore + HITL tools | Anthropic retention SKU + permissions | Privacy Mode / content exclusion |
CLI Pattern Sketch
Binary names, flags, and instruction filenames change. Verify against current Gemini CLI docs. Educational only; repos you maintain.
When to Pick Gemini CLI
Pick Gemini CLI when
- Vertex / Google Cloud is the mandated AI substrate.
- Long-context repo or RFC tasks win your bake-off.
- You want an open CLI you can inspect and script.
- Multimodal “here is a screenshot of the bug” helps.
Pick something else when
- Anthropic-standard shop → Claude Code.
- JetBrains Tab + GitHub PRs → Copilot.
- AI-native desktop UX → Cursor / Windsurf.
- Zero-install web MVP → Bolt / Lovable / Replit.
Related Lectures
| Lecture | Role |
|---|---|
| Google / Gemini catalog (22.1) | Models, Studio, Vertex vs this CLI |
| Gemini SDK | Service-side client, not the developer agent |
| Claude Code | Terminal bake-off peer |
| Context length | Why huge windows still need ignore lists |
| Agent loop / deployment | HITL + CI |
“Gemini CLI is the Gemini SDK.” SDK = your product; CLI = your laptop agent. Second: a 1M-token window means dump the monorepo including secrets. Third: AI Studio keys are fine for regulated customer repos. Fourth: Gemini CLI replaces Android Studio / VS Code Tab. Fifth: inventing free unlimited Vertex. Sixth: unsupervised gcloud prod deploys as a demo flex.
Knowledge Check
- Short Answer: What is Gemini CLI’s primary shape? Answer: A terminal coding agent on Gemini/Vertex, not IDE ghost text.
- True/False: Gemini CLI and the Vol. 18 Gemini SDK are interchangeable UXes. Answer: False.
- Multiple Choice: Long context is best used to: (a) attach large specs/files deliberately, (b) paste .env, (c) skip tests. Answer: (a).
- Short Answer: When should a private repo use Vertex instead of AI Studio keys? Answer: When enterprise IAM/DPA/VPC controls are required (prod/customer data).
- True/False: Ignore lists still matter even with a huge context window. Answer: True.
- Multiple Choice: Pricing posture is: (a) Gemini/Vertex usage (+ quotas), (b) a memorized $12 seat, (c) n8n Docker only. Answer: (a).
- Short Answer: Name Claude Code’s role relative to Gemini CLI. Answer: Anthropic terminal-agent bake-off peer.
- True/False: This lecture authorizes exploit generation via Gemini CLI. Answer: False.
- Multiple Choice: Next lecture is: (a) Bolt.new, (b) Zapier, (c) Midjourney. Answer: (a).
- Short Answer: Which Vol. 22.1 lecture catalogs Gemini/Vertex? Answer: Google / DeepMind / Gemini / Gemma / NotebookLM / Veo / Imagen / AI Studio / Vertex AI.
Key Takeaways
- Gemini CLI is Google’s agentic terminal tool—pair with Vertex for private repos.
- Long context is a strength, not a license to dump secrets or skip retrieval hygiene.
- Do not confuse it with the Gemini SDK inside Vol. 18 services.
- Bake off against Claude Code; keep Copilot/Cursor for Tab.
- Next: Bolt.new — browser prompt-to-app.
Lab: Same /health + pytest task as Claude Code, on Gemini CLI (or a scripted mock if keys are unavailable). Compare cited files vs actual tree. Discuss Studio vs Vertex for a fake “PII repo.”
Transition: “What if the user is not a developer living in a terminal?” Preview Bolt.new WebContainers.
Recap: Gemini CLI closes the terminal-agent pair: Google long context + Vertex privacy SKUs, still HITL. Continue to Bolt.new.