Your all-in-one reference for Google’s AI-powered terminal assistant.
🛠️ 1. Installation
Linux / macOS
# Install globally
npm install -g @google/gemini-cli
# OR run without install
npx https://github.com/google-gemini/gemini-cli
# Verify installation
gemini --version💡 If you get permission errors, prepend sudo or install Node.js via nvm.
Windows (PowerShell / CMD)
# Global install
npm install -g @google/gemini-cli
# One-time run
npx https://github.com/google-gemini/gemini-cli
# Check version
gemini --version⚠️ On Windows, ensure npm and node are in your PATH (node -v to verify).
🔐 2. First-Time Setup
Run and Configure
geminiThen follow prompts:
Choose color theme.
Sign in with Google or paste API key.
Confirm workspace directory permissions.
Save settings (auto-created on first run).
Config file locations
| OS | Config File Path |
|---|---|
| Linux | ~/.gemini/settings.json |
| macOS | ~/Library/Application Support/gemini/settings.json |
| Windows | C:\Users\<you>\AppData\Roaming\gemini\settings.json |
🧩 Workspace settings override user-level configs (.gemini/settings.json inside project).
⚡ 3. Basic Usage
Start interactive session
geminiOne-off (non-interactive) prompt
gemini -p "Summarize this folder’s code structure"Choose a specific model
gemini -m "gemini-2.5-pro"
gemini -m "gemini-2.5-flash"🧠 Pro = higher accuracy / reasoning
⚡ Flash = faster, cheaper, lighter
💬 4. Everyday Commands
| Action | Command / Example |
|---|---|
| Ask a question | > What does main.py do? |
| Generate code | > Create a REST API using Flask |
| Refactor | > Refactor login.js for async/await |
| Generate docs | > Write documentation for utils/ |
| Generate tests | > Create Jest tests for helpers.js |
| Summarize files | > Summarize key modules in src/ |
| Fix bug | > Find and fix undefined variable errors |
🧰 5. Built-in Tools (Automated)
| Tool | Description |
|---|---|
| read-file | Reads a single file |
| write-file | Edits / writes files |
| read-many-files | Scans multiple files |
| glob | Finds files by pattern |
| grep | Searches text patterns |
| shell | Runs terminal commands |
| memoryTool | Stores session memory |
| web-search | Looks up online info |
| web-fetch | Fetches URLs / APIs |
Gemini automatically uses these tools when you give a natural-language command.
🧩 6. Slash Commands (Meta Controls)
| Command | Purpose |
|---|---|
| /help | Show all commands |
| /tools | List available tools |
| /memory | View / clear memory |
| /stats | Check token & usage info |
| /theme | Change CLI theme |
| /mcp | Manage connected MCP servers |
| /quit or /exit | Leave session |

Join the conversation! Your thoughts help the community grow.