Google Gemini CLI 사용법: npm·brew 설치, Google 로그인, @ 파일
Gemini CLI 설치, Google 로그인, @ 파일 참조로 첫 터미널 Agent 프롬프트.
Google Gemini CLI 첫 시간은 프롬프트보다 Node.js, PATH의 gemini, Google 로그인 미완료에서 막힌다. 공식 README와 geminicli.com/docs대로 설치하고, 프로젝트에서 로그인한 뒤 첫 프롬프트에 @로 파일 컨텍스트를 넣는다.
검색어는 Google Gemini CLI 설치와 @ 파일. This page follows google-gemini/gemini-cli install and auth notes plus the file-management tutorial for @ references. It is Google’s terminal agent, not this site’s meeting product. For a short huddle to review a diff, open a room on wbmeet; see how to create and join a room.
Gemini CLI 대상
Gemini CLI is an open-source (Apache 2.0) terminal-first agent: read repos, edit files, run shell, optional Google Search grounding. Many developers use Sign in with Google (OAuth); the README documents free-tier limits for personal accounts (see cloud.google.com/gemini/docs/quotas). Alternatives: GEMINI_API_KEY from AI Studio or Vertex AI for enterprise.
Install with npm or Homebrew
- 1
Prepare Node.js
npm install needs a supported Node.js (see the official installation page). Confirm
node -vandnpm -v. Restricted environments can use the README conda + nodejs recipe. - 2
Global install or npx
npm install -g @google/gemini-cli. macOS/Linux:brew install gemini-cli. No global install:npx @google/gemini-cli. Channels:@latest,@preview,@nightlyper Release Channels in the README. - 3
Verify the command
New terminal:
gemini --version. Ifcommand not found, add npm’s global bin directory to PATH.
Sign in with Google (or API key)
- 1
Start from the project directory
cdinto your repo and rungemini. Choose Sign in with Google and finish OAuth in the browser. - 2
Code Assist license (optional)
For org Gemini Code Assist, README suggests
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"beforegemini. - 3
API key path (optional)
Create a key at
aistudio.google.com/apikey, thenexport GEMINI_API_KEY="YOUR_API_KEY". Never commit keys to Git.
First prompt and @ file context
- 1
Force-read with @
Official file-management tutorial:
@src/foo.tsreads the file immediately and injects it. Example:@src/utils/helpers.ts Explain what each export does. - 2
Multiple files and folders
Chain references:
@src/A.tsx @src/types/User.ts. Whole folder:@src/utils/(large folders use more tokens—prefer named files first). - 3
One reviewable task
Follow with a diff-friendly ask: fix one typo in
@README.mdand show the unified diff before writing. Approve small edits only in hour one.
# First hour · Gemini CLI · 2026-09
npm install -g @google/gemini-cli
# or: brew install gemini-cli
gemini --version
cd /path/to/your/repo
gemini
# Sign in with Google
@src/main.ts Summarize the entry point and list public exports.
@src/main.ts Add one-line JSDoc to the main export; show diff before writing.Install vs auth
| Path | Good for | First-hour note |
|---|---|---|
| npm global | Cross-platform daily use | PATH includes npm global bin |
| Homebrew | macOS / Linux | brew upgrade gemini-cli |
| npx | Zero-install trial | Slower each run |
| Google OAuth | Individual devs | Check official quotas page |
| GEMINI_API_KEY | Model/billing control | Keys stay out of Git |
gemini not found
Check npm global path and open a new terminal. npx isolates PATH issues.
Browser login stuck
Copy the OAuth URL from the terminal; check browser and proxy settings.
Wrong @ path
Paths resolve from the current working directory; confirm you are at the repo root.
Official path: install Gemini CLI → Google sign-in or API key → use
@filefor context → small change with reviewed diff. Trust geminicli.com/docs and your installed version.
- Vs other terminal agents
- Commands and auth differ per vendor; you can keep several CLIs. See our Claude Code install note for comparison.
- What is GEMINI.md?
- Project-level context file supported by the CLI—configure after you are comfortable with @ references.
- Not a meeting-product guide
- Only Gemini CLI’s first hour. Short whiteboard call: wbmeet.
더 확인할 질문
Homebrew가 필수인가?
아니다. npm 전역 설치가 README 주 경로이며 macOS/Linux는 brew install gemini-cli 가능.
무료 Google 계정으로 충분한가?
개인 OAuth에는 공식 quotas 페이지의 무료 한도가 있다. 초과 시 API 키 또는 유료.
@ 파일과 디렉터리 차이?
단일 @는 정확하고 토큰 절약. @디렉터리는 넓은 질문용이나 비용 큼. 처음엔 1–2 파일.
묻지 않고 쓰나?
공식은 unified diff 강조. 첫 시간엔 작은 변경만 승인.