| marp | true |
|---|---|
| theme | tessl-cheatsheet |
| paginate | false |
| size | 1400px 1200px |
| style | section { columns: 3; } section p, section li, section td { line-height: 1.2; } |
npm install -g @google/gemini-cli
gemini
# or run without installing:
npx @google/gemini-cliOAuth login tier: 60 req/min, 1000 req/day with a Google account.
- OAuth — "Sign in with Google" (default)
- API key —
export GEMINI_API_KEY=...(aistudio.google.com) - Vertex AI —
GOOGLE_API_KEY+GOOGLE_GENAI_USE_VERTEXAI=true
| Flag | Action |
|---|---|
-m / --model |
Choose model |
-p / --prompt |
Non-interactive |
--approval-mode |
Autonomy: default / auto_edit / yolo / plan |
-s / --sandbox |
Run sandboxed |
-o / --output-format |
text / json / stream-json |
-r / --resume |
Resume a session |
| Command | Description |
|---|---|
/init |
Generate GEMINI.md |
/tools |
List available tools |
/mcp |
MCP servers (list,auth,refresh) |
/chat |
save · resume · list |
/memory |
add · show · reload |
/compress |
Summarize context |
/model |
Switch model / routing |
/stats · /clear · /bug |
Usage · clear · report |
| Key | Action |
|---|---|
Enter |
Send message |
Shift+Tab |
Cycle approval modes |
Ctrl+Y |
Toggle YOLO |
Ctrl+T |
Toggle TODO list |
Ctrl+L |
Clear screen |
Esc |
Dismiss/cancel |
? |
Shortcuts panel |
| Tool | Function |
|---|---|
read_file / write_file / replace |
Read & edit files |
list_directory / glob |
Browse & find files |
search_file_content |
Grep/search code |
run_shell_command |
Execute commands |
web_fetch / google_web_search |
Web access |
save_memory / invoke_agent |
Memory · subagents |
Precedence (later wins): User ~/.gemini/settings.json → Project .gemini/settings.json → System.
GEMINI.md context file is hierarchical — discovered upward from cwd, plus global ~/.gemini/GEMINI.md.
Add under mcpServers in settings.json:
"myserver": {
"command": "npx",
"args": ["-y", "server-pkg"]
}Also supports url / httpUrl. MCP tools are called automatically; MCP prompts surface as slash commands. Custom commands: TOML in .gemini/commands/.
Default routing is Auto — simple prompts → Gemini 3 Flash, complex → Gemini 3 Pro. Switch model or routing (Auto/Pro/Manual) with /model. Run /init to seed GEMINI.md; reference files with @path/to/file.
Tessl · Gemini CLI Cheat Sheet · __VERSION__