Your complete guide to mastering Gemini CLI - from zero to hero in minutes!
After testing Gemini CLI I've developed this comprehensive cheat sheet that will take you from basic to advanced user without wasting time. Whether you're completely new to Gemini CLI or looking to master advanced features, this guide has you covered.
# Install globally
npm install -g @google/gemini-cli
# Or run without installing
npx @google/gemini-cli
# Launch interactive CLI
gemini- π’ Level 1: Basic Commands
- π‘ Level 2: Intermediate Commands
- π Level 3: Advanced Commands
- π΄ Level 4: Expert Commands
- π΅ Level 5: Power User Commands
- π£ Level 6: Master Commands
- π€ Contributing
- π License
Essential commands to get started
npm install -g @google/gemini-cli # Install globally
npx @google/gemini-cli # Run without installing
gemini # Launch interactive CLI
gemini --version # Check version/about # Check version
/help # Show available commands
/tools # List available tools
/clear # Clear current conversation
/quit # Exit CLI (or Ctrl+C)ReadFolder # Read folder contents
ReadFile # Read single file
ReadManyFiles # Read multiple files# Using natural language
"List files in current directory"
"Show me the contents of package.json"
"Find all HTML files in this project"/tools # List available tools
/tools desc # Show tool descriptions
/tools nodesc # Hide tool descriptions/theme # Change visual theme
/auth # Change authentication method
/editor # Select supported editorsshell ls # List directory contentsEnter # Send message
Esc # Cancel operation
Ctrl+L # Clear screen
Ctrl+C x2 # Exit CLI / Quit application
Ctrl+T # Toggle tool descriptions
Up/Down # Cycle through prompt history || Tools
Alt+Left/Right # Jump through words/privacy # View privacy settings
/bug # Submit bug report
/docs # Open documentation
/about # Check version infoFile management and basic customization
/tools
read_folder <directory> # Read entire folder
@src/my_project/ # Read entire project directory
@path/to/file.txt # Read specific file
@My\ Documents/file.txt # Handle spaces in paths/chat save <tag> # Save current conversation
/chat resume <tag> # Resume saved conversation
/chat list # List saved conversations
/compress # Compress chat context to summary--model # Show current model
--model gemini-1.5-flash # Switch to Flash (fastest)
--model gemini-1.5-pro # Switch to Pro (most capable)
--model gemini-1.5-pro-002 # Switch to latest Pro version/memory show # Show current memory context
/memory add <text> # Add text to memory
/memory refresh # Reload GEMINI.md filesConfiguration, context, and power features
gemini -p "your prompt here" # Direct prompt execution
gemini -y # Auto-confirm all prompts (YOLO mode)
gemini --sandbox # Run in sandbox mode
gemini --checkpointing # Enable checkpointing/stats # Show session statistics
/stats model # Show model usage stats
/stats tools # Show tool usage stats!<shell_command> # Execute shell command
!ls -la # Example: list files
!git status # Example: git status
! # Toggle shell mode@<path_to_file> # Include file content in prompt
@<directory> # Include directory content
@README.md # Example: include README
@src/myFile.ts # Add specific file to context
@folder/ # Add entire folder to contextMCP servers, automation, and advanced integrations
/mcp list # List available MCP servers
/mcp desc # Show detailed MCP descriptions
/mcp nodesc # Hide MCP descriptions
/mcp schema # Show full JSON schemanpx @google/gemini-cli # Run latest version
npx https://github.com/google-gemini/gemini-cli # Run from GitHubgemini -s # Enable sandboxing (short flag)
export GEMINI_SANDBOX=true # Environment variable
export GEMINI_SANDBOX=docker # Specify Docker
export GEMINI_SANDBOX=podman # Specify Podman
export GEMINI_SANDBOX=sandbox-exec # Specify sandbox-exec (macOS)# Git-aware filtering automatically excludes:
# node_modules/, dist/, .env, .git/
# Can be configured via fileFiltering settingsAdvanced workflows and integrations
docker run --rm -it us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.1
gemini --sandbox -y -p "your prompt here"npm run start # Hot-reloading development
npm link packages/cli # Link local package globallyexport SEATBELT_PROFILE=permissive-open # macOS sandbox profile
export SEATBELT_PROFILE=restrictive-closed # Strict macOS sandbox
export SANDBOX_SET_UID_GID=true # Force host UID/GID
export DEBUG=1 # Enable debug mode/restore # List available checkpoints
/restore <checkpoint_file> # Restore specific checkpoint
/restore 2025-06-22T10-00-00_000Z-my-file.txt-write_fileAdvanced automation and custom workflows
/bug "Issue description" # File GitHub issue
# Customizable via bugCommand setting# Extensions loaded from:
# <workspace>/.gemini/extensions
# <home>/.gemini/extensions{
"sandbox": "docker",
"checkpointing": { "enabled": true },
"bugCommand": "custom command",
"mcpServers": {
"my-server": {
"command": "node my-server.js"
}
}
}We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- π Report bugs or issues
- π Improve documentation
- β¨ Add new commands or examples
- π§ Test commands and report results
This project is licensed under the MIT License - see the LICENSE file for details.
If this cheatsheet helped you, please give it a star! It helps others discover this resource.
- Contact: Email
Last updated: July 2025
