내장 도구

Gemini CLI에서 제공하는 강력한 내장 도구의 완전한 참조

파일 시스템셸 명령웹 도구

도구 카테고리

다양한 작업을 수행하는 데 도움이 되는 기능별로 구성된 내장 도구

파일 시스템 도구

파일과 디렉토리를 읽고, 쓰고, 관리하는 도구

read_file

파일의 내용을 읽기

매개변수:
path(string)필수

읽을 파일의 경로

반환값:

string - 파일 내용

사용 예제:
AI: I'll read the package.json file for you.

Tool call: read_file
Parameters: {"path": "./package.json"}

Result: {
  "name": "my-project",
  "version": "1.0.0",
  "dependencies": {
    "express": "^4.18.0"
  }
}

write_file

파일에 내용 쓰기

매개변수:
path(string)필수

파일을 쓸 경로

content(string)필수

파일에 쓸 내용

반환값:

string - 성공 확인

사용 예제:
AI: I'll create a new README file for you.

Tool call: write_file
Parameters: {
  "path": "./README.md",
  "content": "# My Project\n\nThis is a sample project."
}

Result: File written successfully to ./README.md

list_files

주어진 경로의 파일과 디렉토리 나열

매개변수:
path(string)필수

나열할 디렉토리 경로

recursive(boolean)

재귀적으로 나열할지 여부

반환값:

array - 파일과 디렉토리 목록

사용 예제:
AI: Let me list the files in the src directory.

Tool call: list_files
Parameters: {"path": "./src", "recursive": false}

Result: [
  "index.js",
  "utils.js",
  "components/",
  "styles/"
]

셸 도구

셸 명령과 스크립트를 실행하는 도구

run_shell_command

셸 명령 실행

매개변수:
command(string)필수

실행할 셸 명령

cwd(string)

명령의 작업 디렉토리

반환값:

object - stdout, stderr 및 종료 코드가 포함된 명령 결과

사용 예제:
AI: I'll check the current Git status.

Tool call: run_shell_command
Parameters: {"command": "git status --porcelain"}

Result: {
  "stdout": " M src/index.js\n?? new-file.txt",
  "stderr": "",
  "exitCode": 0
}

run_script

스크립트 파일 실행

매개변수:
script_path(string)필수

스크립트 파일의 경로

args(array)

스크립트에 전달할 인수

반환값:

object - 스크립트 실행 결과

사용 예제:
AI: I'll run the build script with production flag.

Tool call: run_script
Parameters: {
  "script_path": "./scripts/build.sh",
  "args": ["--production"]
}

Result: {
  "stdout": "Building for production...\nBuild completed successfully!",
  "stderr": "",
  "exitCode": 0
}

웹 도구

웹 요청, 검색 및 온라인 콘텐츠를 위한 도구

web_fetch

URL에서 콘텐츠 가져오기

매개변수:
url(string)필수

콘텐츠를 가져올 URL

headers(object)

요청 헤더

반환값:

object - 콘텐츠, 상태 및 헤더가 포함된 응답

사용 예제:
AI: I'll fetch data from the API endpoint.

Tool call: web_fetch
Parameters: {"url": "https://api.github.com/repos/google-gemini/gemini-cli"}

Result: {
  "status": 200,
  "content": "{\"name\": \"gemini-cli\", \"description\": \"...\"}"
}

web_search

웹에서 정보 검색

매개변수:
query(string)필수

검색 쿼리

num_results(number)

반환할 결과 수

반환값:

array - 검색 결과 목록

사용 예제:
AI: I'll search for information about Gemini CLI.

Tool call: web_search
Parameters: {"query": "Gemini CLI documentation", "num_results": 5}

Result: [
  {
    "title": "Gemini CLI Official Documentation",
    "url": "https://docs.geminicli.cloud",
    "snippet": "Complete documentation for Gemini CLI..."
  }
]

메모리 도구

세션 정보를 저장하고 검색하는 도구

remember

나중에 사용하기 위해 정보 저장

매개변수:
key(string)필수

정보를 저장할 키

value(string)필수

저장할 값

반환값:

string - 저장 확인

사용 예제:
AI: I'll remember your preference.

Tool call: remember
Parameters: {"key": "user_preference", "value": "prefer TypeScript for development"}

Result: Information stored under key 'user_preference'

recall

이전에 저장된 정보 검색

매개변수:
key(string)필수

정보를 검색할 키

반환값:

string - 저장된 값

사용 예제:
AI: Let me retrieve your preference.

Tool call: recall
Parameters: {"key": "user_preference"}

Result: "prefer TypeScript for development"

디렉토리 도구

디렉토리 작업 및 탐색을 위한 도구

create_directory

새 디렉토리 생성

매개변수:
path(string)필수

생성할 디렉토리의 경로

recursive(boolean)

상위 디렉토리를 재귀적으로 생성할지 여부

반환값:

string - 생성 확인

사용 예제:
AI: I'll create a new project directory.

Tool call: create_directory
Parameters: {"path": "./src/components", "recursive": true}

Result: Directory './src/components' created successfully

get_current_directory

현재 작업 디렉토리 가져오기

매개변수:

매개변수 없음

반환값:

string - 현재 디렉토리 경로

사용 예제:
AI: Let me check the current working directory.

Tool call: get_current_directory
Parameters: {}

Result: "/Users/username/projects/my-app"

도구 구성

도구 동작 및 권한 구성

도구 활성화/비활성화

gemini config set tools-enabled truegemini config set file-tools-enabled falsegemini config set web-tools-enabled true

도구 타임아웃

gemini config set tool-timeout 30gemini config set web-timeout 10gemini config set shell-timeout 60

관련 리소스

도구 및 사용자 정의에 대해 자세히 알아보기