Login
Back to Blog
Gemini CLI 사용자 가이드 - 터미널에서 사용하는 Google AI

Gemini CLI 사용자 가이드 - 터미널에서 사용하는 Google AI

C
Crazyrouter Team
January 24, 2026
28 views한국어Tutorial
Share:

Gemini CLI는 Google에서 제공하는 오픈소스 커맨드라인 AI 도구로, Gemini의 성능을 직접 터미널로 가져옵니다. 프롬프트에서 모델까지 가장 직접적인 경로를 제공하는 가벼운 방식으로 Gemini에 접근할 수 있습니다. 프록시를 설정하면 네트워크가 제한된 환경에서도 Gemini CLI 서비스를 사용할 수 있습니다.

왜 Gemini CLI를 선택해야 할까요?#

  • 강력한 Gemini 2.5 Pro: 100만 토큰 컨텍스트 윈도우 제공
  • 내장 도구: Google Search 기반 지식, 파일 작업, Shell 명령, 웹 스크래핑
  • 확장 가능: 사용자 정의 통합을 위한 MCP(Model Context Protocol) 지원
  • 터미널 우선: 커맨드라인에서 작업하는 개발자를 위해 설계
  • 오픈 소스: Apache 2.0 라이선스

설치#

빠른 설치#

설치 없이 npx로 바로 실행#

bash
# 공식 리포지토리 사용
npx https://github.com/google-gemini/gemini-cli

npm으로 전역 설치#

bash
npm install -g @google/gemini-cli

Homebrew로 설치 (macOS/Linux)#

bash
brew install gemini-cli

시스템 요구 사항#

  • Node.js 20 이상 버전
  • macOS, Linux, 또는 Windows

프록시 설정#

환경 변수 설정#

프록시를 사용하기 전에 다음 환경 변수를 설정하세요:

Linux / macOS#

bash
# API Key 설정
export GEMINI_API_KEY=sk-your-api-key-here

# API Proxy URL 설정
export GOOGLE_GEMINI_BASE_URL=https://crazyrouter.com/

Windows CMD#

cmd
set GEMINI_API_KEY=sk-your-api-key-here
set GOOGLE_GEMINI_BASE_URL=https://crazyrouter.com/

Windows PowerShell#

powershell
$env:GEMINI_API_KEY = "sk-your-api-key-here"
$env:GOOGLE_GEMINI_BASE_URL = "https://crazyrouter.com/"

Tip: 이 환경 변수들을 .bashrc, .zshrc 또는 사용 중인 쉘 설정 파일에 추가하면, 터미널을 열 때마다 자동으로 설정됩니다.

빠른 시작#

기본 사용법#

현재 디렉토리에서 시작#

bash
gemini

여러 디렉토리 포함하기#

bash
gemini --include-directories ../lib,../docs

특정 모델 사용하기#

bash
gemini -m gemini-2.5-flash

비대화형 스크립트 모드#

간단한 텍스트 응답 받기:

bash
gemini -p "Explain the architecture of this codebase"

구조화된 JSON 출력 받기:

bash
gemini -p "Explain the architecture of this codebase" --output-format json

빠른 예시#

새 프로젝트 시작하기#

bash
cd new-project/
gemini
> Write me a Discord bot that answers questions using the FAQ.md file I provided

기존 코드 분석하기#

bash
git clone https://github.com/google-gemini/gemini-cli
cd gemini-cli
gemini
> Give me a summary of all changes from yesterday

주요 기능#

코드 이해 및 생성#

  • 대규모 코드베이스 질의 및 편집
  • 멀티모달 기능을 사용해 PDF, 이미지, 스케치로부터 새로운 애플리케이션 생성
  • 자연어로 디버깅 및 문제 해결

자동화 및 통합#

  • Pull Request 조회나 복잡한 rebase 처리 같은 운영 작업 자동화
  • MCP 서버를 통해 새로운 기능 연결
  • 스크립트에서 비대화형으로 실행해 워크플로 자동화

고급 기능#

  • 내장 Google Search를 사용한 실시간 정보 조회
  • 복잡한 세션을 저장하고 복원하기 위한 대화 체크포인트
  • 프로젝트에 맞게 동작을 조정하는 커스텀 컨텍스트 파일(GEMINI.md)

자주 사용하는 명령과 예시#

코드베이스 탐색#

code
> Describe the main components of this system architecture
> What security mechanisms are in place?
> Provide a step-by-step onboarding document for new developers

기존 코드 작업#

code
> Implement a first draft for GitHub issue #123
> Help me migrate this codebase to the latest version of Java. Start with a plan

워크플로 자동화#

code
> Create a slideshow showing the git history from the past 7 days, grouped by feature and team member
> Create a full-screen web app for wall display showing our most interactive GitHub issues

시스템 상호작용#

code
> Convert all images in this directory to png and rename them using the date from exif data
> Organize my PDF invoices by spending month

GitHub 통합#

Gemini CLI GitHub Action을 사용해 Gemini CLI를 GitHub 워크플로에 직접 통합할 수 있습니다:

  • Pull Request 리뷰: 맥락 있는 피드백과 제안을 포함한 자동 코드 리뷰
  • 이슈 분류: 내용 분석을 기반으로 GitHub 이슈에 자동 라벨링 및 우선순위 지정
  • 온디맨드 도움말: 이슈와 Pull Request에서 @gemini-cli를 멘션해 디버깅, 설명, 작업 위임에 대한 도움 받기
  • 사용자 정의 워크플로: 팀의 요구에 맞춰 자동, 예약, 온디맨드 워크플로 구성

문제 해결#

사용 중 문제가 발생하면 다음을 확인해 보세요:

1. 환경 변수 확인#

bash
echo $GEMINI_API_KEY
echo $GOOGLE_GEMINI_BASE_URL

2. 네트워크 연결 확인#

bash
curl -I https://crazyrouter.com/

3. 에러 메시지 확인#

에러 메시지는 보통 문제의 원인을 알려줍니다. 일반적인 문제는 다음과 같습니다:

  • 잘못된 형식의 API 키
  • 네트워크 연결 문제
  • 잘못된 프록시 설정

4. SOCKS 프록시 형식#

SOCKS 프록시를 사용하는 경우, 형식이 올바른지 확인하세요:

code
socks5://<user>:<pass>@<proxy>:<port>

5. 버그 보고#

내장 명령을 사용해 이슈를 보고할 수 있습니다:

bash
/bug

릴리스 버전#

Preview#

새로운 프리뷰 버전은 매주 화요일 UTC 23:59에 릴리스됩니다:

bash
npm install -g @google/gemini-cli@preview

Stable#

새로운 안정 버전은 매주 화요일 UTC 20:00에 릴리스됩니다:

bash
npm install -g @google/gemini-cli@latest

Nightly#

Nightly 버전은 매일 UTC 00:00에 릴리스됩니다:

bash
npm install -g @google/gemini-cli@nightly

MCP 서버 사용#

~/.gemini/settings.json 에 MCP 서버를 설정해, 사용자 정의 도구로 Gemini CLI 기능을 확장할 수 있습니다:

text
> @github list my open pull requests
> @slack send a summary of today's commits to #dev channel
> @database run a query to find inactive users

Crazyrouter 가격 정보#

할인된 요금으로 Gemini 모델에 접근하세요:

ModelInput PriceOutput Price
gemini-2.5-pro$0.625/1M tokens$2.50/1M tokens
gemini-2.5-flash$0.038/1M tokens$0.15/1M tokens
gemini-2.5-flash-lite$0.019/1M tokens$0.075/1M tokens

모든 가격에는 공식 요금 대비 45% 할인이 적용되어 있습니다.

관련 리소스#


도움이 필요하신가요? 지원팀에 문의하거나 Crazyrouter 문서를 확인해 더 많은 정보를 얻을 수 있습니다.

Related Articles