1---2name: gemini-cli-guide3description: Complete Gemini CLI usage guide. Use when users ask about Gemini CLI commands, flags, options, configuration, or usage patterns. Triggers on questions like "how to use gemini command", "gemini cli flags", "how to configure gemini", "gemini slash commands", "gemini authentication", "GEMINI.md file", or requests for Gemini CLI examples. Use when this capability is needed.4---56# Gemini CLI Reference78Quick reference for Gemini CLI commands and configuration.910## Installation1112| Method | Command |13|--------|---------|14| NPX (no install) | `npx @google/gemini-cli` |15| NPM | `npm install -g @google/gemini-cli` |16| Homebrew | `brew install gemini-cli` |17| MacPorts | `sudo port install gemini-cli` |1819## Authentication2021| Method | Setup |22|--------|-------|23| Google OAuth | Run `gemini` and select "Login with Google" |24| API Key | Set `GEMINI_API_KEY` env var (get from aistudio.google.com/apikey) |25| Vertex AI | Set `GOOGLE_API_KEY` + `GOOGLE_GENAI_USE_VERTEXAI=true` |2627## Basic Commands2829| Command | Description |30|---------|-------------|31| `gemini` | Start interactive REPL |32| `gemini "query"` | Start REPL with initial prompt |33| `gemini -p "query"` | One-shot query (pipe mode) |3435## Common Flags3637| Flag | Description |38|------|-------------|39| `-p, --prompt <text>` | One-shot query mode (pipe mode) |40| `-i, --prompt-interactive` | Interactive prompt mode |41| `--input <text>` | Input for the prompt |42| `-m, --model` | Specify model |43| `-s, --sandbox` | Enable sandbox mode |44| `--approval-mode` | Set approval mode (default/auto_edit/plan/yolo) |45| `--output-format` | Output format (text/json/stream-json) |46| `-d, --debug` | Enable debug mode |47| `-r, --resume` | Resume previous conversation |48| `--list-sessions` | List available sessions |49| `--delete-session <id>` | Delete a specific session |50| `--allowed-tools <list>` | Specify tools that bypass confirmation |51| `-e, --extensions <names>` | Specify extensions to use |52| `-l, --list-extensions` | List available extensions |53| `--allowed-mcp-server-names` | Configure MCP servers |54| `--screen-reader` | Screen reader optimization |55| `--color` / `--no-color` | Control colored output |5657## Slash Commands5859| Category | Commands |60|----------|----------|61| Session | `/chat`, `/clear`, `/resume`, `/rewind`, `/save`, `/quit` |62| Config | `/settings`, `/auth`, `/theme`, `/vim`, `/model` |63| Tools | `/tools`, `/mcp`, `/hooks`, `/skills`, `/extensions` |64| Memory | `/memory`, `/compress` |65| Context | `/directory`, `/restore` |66| Workflow | `/bug`, `/copy`, `/editor`, `/init`, `/setup-github`, `/export` |67| Info | `/help`, `/about`, `/docs`, `/stats`, `/privacy`, `/introspect`, `/version` |68| Shell | `/shells` (or `/bashes`) |69| IDE | `/ide`, `/terminal-setup`, `/policies` |7071## Special Syntax7273| Syntax | Description |74|--------|-------------|75| `@path` | Include file/directory in context |76| `!command` | Execute shell command |7778## Configuration Files7980| Location | Scope |81|----------|-------|82| `~/.gemini/settings.json` | Global settings |83| `.gemini/settings.json` | Project settings |84| `GEMINI.md` | Project instructions |8586## Detailed References8788- [commands.md](references/commands.md) - All slash, @ and ! commands89- [flags.md](references/flags.md) - All CLI flags by category90- [configuration.md](references/configuration.md) - Settings, env vars, MCP config91- [examples.md](references/examples.md) - Common usage examples9293---94> Source: [MomoChenisMe/awesome-momochenisme-skills](https://github.com/MomoChenisMe/awesome-momochenisme-skills) — distributed by [TomeVault](https://tomevault.io).95<!-- tomevault:4.0:skill_md:2026-05-23 -->