본문 바로가기
C.W.K.
Stream
Lesson 02 of 10 · published

대화형 REPL — 테마, 기록, /help

~12 min · gemini, interactive, repl, history

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

Gemini도 대화형 세션과 단발 실행을 나눠 쓴다

gemini를 실행하면 실시간 답변을 받는 REPL이 열려. /help, /clear, /compact, /cost, /theme, /exit 같은 기본 명령을 쓰고, Shift+Enter로 여러 줄 지시를 입력하며 Ctrl+C로 현재 작업을 멈춰.

gemini -p는 한 번 처리하고 표준 출력에 결과를 남긴 뒤 끝나. Claude Code의 -p, Codex의 exec와 같은 자리라 파이프와 자동화에 써. 1M 문맥 창이 넓어도 새 작업으로 바뀔 때 /compact하면 다음 응답이 더 빠르고 저렴해.

Code

세 가지 실행 방식 비교·bash
# Interactive REPL (default)
gemini

# Print mode
gemini -p "explain the auth flow in this repo"

# Compose with shell
git diff HEAD~1 | gemini -p "review for bugs"

# History persists across sessions in ~/.gemini/history.jsonl
TUI 단축키·text
↑/↓          previous / next prompt
Shift+Enter  newline in composer
Ctrl+C       interrupt current operation
Ctrl+D       exit
/clear       reset conversation
/compact     squeeze history
/theme       change color scheme
/exit        quit

External links

Exercise

Gemini REPL에서 실제 세션을 열어. /compact를 한 번 이상 쓰고, 출력 모드에서도 같은 질문을 던져봐. 어떤 방식을 가장 먼저 찾게 됐는지 적어.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.