Cheat Sheet · Commands & Shortcuts
Gemini CLI
A reference for Google's Gemini CLI, the slash commands, @ file context, shell passthrough and flags for the open-source terminal agent.
Slash & input commands
/help | List available commands |
/tools | Show available tools |
/mcp | List configured MCP servers |
/memory | Manage the context / memory files |
/chat | Save, resume or branch conversations |
/compress | Summarize the context to save tokens |
/clear | Clear the screen and context |
@path/to/file | Add a file or directory to context |
!<command> | Run a shell command (shell mode) |
CLI flags
gemini | Start an interactive session |
gemini -p "…" | Run a single prompt non-interactively |
gemini --model <name> | Choose the Gemini model |
Run an agent without the setup
Spin up a hosted open-source AI agent with Creative Tim, bring your own key or run it on credits.
Frequently asked questions
Is Gemini CLI free?
It's open-source with a generous free tier; heavy use may require a paid plan or API key.
How do I add a file to context?
Type @ followed by the path, e.g. @src/index.ts, Gemini CLI reads it into the conversation.
Gemini CLI or Claude Code?
Gemini CLI is open-source with huge context; Claude Code is a polished proprietary agent, see our Gemini CLI vs Claude Code comparison.
Compare Gemini CLI