Here's the English translation of the provided Markdown document:
Source: Official Documentation
npm install -g @anthropic-ai/gemini-cli
The first run will guide you through Google account login, or you can set environment variables:
export GEMINI_API_KEY="YOUR_API_KEY"
| Parameter | Description | Example |
|---|---|---|
--model <model> |
Specify model | --model gemini-2.5-flash |
--yolo |
YOLO mode, automatically approve all tool calls | gemini --yolo |
--approval-mode <mode> |
Approval mode: default/auto_edit/yolo |
--approval-mode auto_edit |
--allowed-tools <tools> |
List of allowed tools (comma separated) | --allowed-tools '' (disable all) |
--output-format <format> |
Output format: text/json/stream-json |
--output-format text |
--sandbox / -s |
Enable sandbox mode | gemini -s |
--prompt <prompt> / -p |
Non-interactive mode, pass prompt directly | gemini -p "query" |
--prompt-interactive <prompt> / -i |
Interactive mode with initial prompt | gemini -i "explain" |
--debug / -d |
Enable debug mode | gemini -d |
gemini-2.5-flash - Fast modelgemini-2.5-pro - Advanced modelgemini-3-flash-preview - Latest Flashgemini-3-pro-preview - Latest Pro# Basic headless call (piped input)
cat input.txt | gemini -p "Your prompt" --output-format text
# Disable tool calls (plain text output)
cat input.txt | gemini -p "Your prompt" --output-format text --allowed-tools ''
# YOLO mode (skip all confirmations)
gemini --yolo "Your prompt"
# Or use approval-mode
gemini --approval-mode yolo "Your prompt"
Configuration is stored in ~/.gemini/settings.json or project .gemini/settings.json:
{
"security": {
"disableYoloMode": false
},
"model": {
"name": "gemini-2.5-flash"
}
}
export http_proxy=http://127.0.0.1:9910
export https_proxy=http://127.0.0.1:9910
--allowed-tools '' to skip.timeout command wrapper.2>/dev/null.