Как установить Gemini CLI: вход Google и первая проверяемая задача в Git-репо
Gemini CLI, вход Google, первая проверяемая задача в Git-репозитории.
The first hour with Google Gemini CLI in a Git repo you own usually breaks on a missing gemini binary, an unfinished Google sign-in, or skipping git status at the repo root—not on prompt wording. Install from official docs, authenticate, then land one change you can review with git diff.
The query is how to use Gemini CLI for your first reviewable Git repo coding task. This page follows google-gemini/gemini-cli install and auth notes at geminicli.com/docs. For @ file injection syntax, see our Gemini CLI @ files note. Not a meeting-product guide—open a room on wbmeet to walk a diff; see how to create and join a room.
What Gemini CLI does in a repo
Gemini CLI is Google’s open-source terminal agent (gemini): read the workspace, edit files, run shell after approval. Many developers use Sign in with Google (OAuth); alternatives include GEMINI_API_KEY from AI Studio. Free quotas and rate limits: cloud.google.com/gemini/docs/quotas.
Install Gemini CLI
- 1
Prepare Node.js
Confirm
node -vandnpm -vmeet geminicli.com/docs/get-started/installation. Restricted environments can use the README conda recipe. - 2
Global install or trial
npm install -g @google/gemini-cli; macOS/Linux optionalbrew install gemini-cli. Trial without global install:npx @google/gemini-cli. Open a new terminal, thengemini --version. - 3
Fix command not found
Add npm’s global bin directory to PATH (common with nvm). If still stuck, follow official troubleshooting on geminicli.com/docs.
Sign in with Google
- 1
Start at the repo root
cdinto a Git repo you own. Rungit statusbefore the agent edits files. - 2
Launch gemini and OAuth
Run
gemini, choose Sign in with Google, finish OAuth in the browser. Org Gemini Code Assist users may setGOOGLE_CLOUD_PROJECTper README before starting. - 3
API key path (optional)
Create a key at
aistudio.google.com/apikey, exportGEMINI_API_KEY, then start. Never commit keys to Git.
First reviewable repo coding task
- 1
Prompt one: read-only
Example: “In three sentences, explain this repo’s entry module and main public API; read @README.md if needed.” Confirm paths match disk.
- 2
Prompt two: small diff
Example: “Add a unit test for one untested helper, or fix one README typo—show the unified diff before writing.” Approve single-file edits only in hour one.
- 3
Review with git diff
Run
git diffyourself. If Gemini proposesnpm test, read the command and output before Allow. Usegit restoreif the change is wrong.
# First hour · Gemini CLI · Git repo · 2026-10-14
npm install -g @google/gemini-cli
cd /path/to/your/git/repo
git status
gemini
# Sign in with Google
# Prompt 1: explain entry (read-only)
# Prompt 2: one unit test; diff first
git diffInstall vs auth
| Path | Good for | First-hour note |
|---|---|---|
| npm global | Cross-platform | PATH includes global bin |
| Homebrew | macOS / Linux | brew upgrade gemini-cli |
| Google OAuth | Individuals | Check quotas page |
| GEMINI_API_KEY | Billing control | Keys stay out of Git |
Too many files touched
Ask for one file only; @ a single path instead of a huge directory.
Alongside Codex or Claude Code
Multiple terminal agents can coexist—avoid two agents editing the same tree at once. Compare OpenAI Codex CLI and Claude Code.
Stuck on chat-only
Repo explanation is warmup; finish with a reversible diff and git diff.
Suggested path: official install → Google sign-in →
git statusat repo root → read-only prompt → small diff +git diff. Trust geminicli.com/docs for your version.
- Vs the @ files guide
- This page focuses on a reviewable coding task in Git; @ syntax details live in our Gemini CLI @ files note.
- GEMINI.md
- Project context file—add after basics; never store secrets there.
- Scope
- Only Gemini CLI’s first repo hour, not wbmeet meeting setup.
Questions worth checking
Must I master @ files first?
No. Name paths in plain language for hour one; @ references help precision—see the dedicated @ files post.
Will it git commit for me?
It should not push without your workflow; git commands run after approval. Commit yourself in hour one.
Is a free Google account enough?
Personal OAuth has documented free quotas at cloud.google.com/gemini/docs/quotas; beyond that use an API key or paid tier.
Must the first task be a test?
No. Any small reversible change counts as long as you review with git diff.