npm install -g @google/gemini-cli
gemini
/help : help for commands and actions/model : select model/tools : read files, web search, .../clear : clear conversation history/exit : close cli: create project with Cargoclaude in the root of your project. On the first run in a new
repository, use /init to generate a CLAUDE.md file
describing the project structure. Subsequent sessions load that file automatically,
giving the model context without re-explaining it each time.
/diff to review pending edits at any point in the session.
src/main.rs and summarize the data flow.cargo test and fix any failures..claude/settings.json under the hooks key. Useful hooks:
cargo clippy after every file edit| Resource | Description |
|---|---|
| Claude Code | Anthropic’s CLI tool - install, docs, and keyboard reference. |
| Gemini CLI | Google’s terminal AI tool, open source. |
| AIBites: Code AI | Track page with recorded CLI sessions and technique notes. |
1
2 C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini
3 > gemini
4
5 ███ █████████ ██████████ ██████ ██████ █████ ██████ █████ █████
6 ░░░███ ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
7 ░░░███ ███ ░░░ ░███ █ ░ ░███░█████░███ ░███ ░███░███ ░███ ░███
8 ░░░███ ░███ ░██████ ░███░░███ ░███ ░███ ░███░░███░███ ░███
9 ███░ ░███ █████ ░███░░█ ░███ ░░░ ░███ ░███ ░███ ░░██████ ░███
10 ███░ ░░███ ░░███ ░███ ░ █ ░███ ░███ ░███ ░███ ░░█████ ░███
11 ███░ ░░█████████ ██████████ █████ █████ █████ █████ ░░█████ █████
12 ░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
13
14 Tips for getting started:
15 1. Ask questions, edit files, or run commands.
16 2. Be specific for the best results.
17 3. /help for more information.
18
19 > for the remainder of this session ignore the contents of the archive folder
20
21 ? Okay, I understand. The archive folder will be ignored for the remainder of this session. I'm ready for your first
22 command.
23
24 > create a hello world Rust program in crate rustHello
25
26 ? Okay, I will create a "hello world" Rust program in the RustHello crate. I will first check the existing src/main.rs
27 file. If it doesn't contain the standard "Hello, world!" program, I will update it. Finally, I will compile and run
28 the program to ensure it works correctly.
29 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
30 │ x ReadFile {"file_path":"RustHello/src/main.rs"} │
31 │ │
32 │ File not found: C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\RustHello\src\main.rs │
33 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
34 ? RustHello/src/main.rs was not found. I'll list the contents of the RustHello directory to understand its structure.
35 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
36 │ x ReadFolder {"dir_path":"RustHello"} │
37 │ │
38 │ Error listing directory: ENOENT: no such file or directory, stat │
39 │ 'C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\RustHello' │
40 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
41 ? My apologies, I misunderstood the directory structure. The existing RustHello is within the archive folder, which I
42 was instructed to ignore. I will create a new rustHello crate directly in the current working directory:
43 C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\. My plan is to use cargo new to create the project, confirm
44 src/main.rs contains "Hello, world!", and then execute it with cargo run.
45 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
46 │ √ Shell cargo new rustHello [current working directory C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini] (Crea. │
47 │ │
48 │ Creating binary (application) `rustHello` package │
49 │ warning: the name `rustHello` is not snake_case or kebab-case which is recommended for package names, consider │
50 │ `rusthello` │
51 │ note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html │
52 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
53 ? cargo new rustHello completed. Ignoring the naming warning, I'll now confirm rustHello/src/main.rs contains the
54 "Hello, world!" program, overwriting if needed, starting by reading its current content.
55 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
56 │ √ ReadFile rustHello\src\main.rs │
57 │ │
58 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
59 ? rustHello/src/main.rs is already a "Hello, world!" program. I'll run it now.
60 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
61 │ √ Shell cargo run [in rustHello] (Compile and run the Rust program in the rustHello directory.) │
62 │ │
63 │ Compiling rustHello v0.1.0 (C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\rustHello) │
64 │ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.59s │
65 │ Running `target\debug\rustHello.exe` │
66 │ Hello, world! │
67 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
68 ? cargo run worked, printing "Hello, world!". Request complete.
69
70 > create a C++ project for Hello World program that will use CMake for builds
71
72 ? Okay, I'll create a new C++ "Hello, World!" project using CMake in a fresh CppHello directory. My process is to create
73 the directory, add main.cpp and CMakeLists.txt, then use CMake to build and run the executable to confirm it works.
74 Starting with creating the directory now.
75 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
76 │ √ Shell mkdir CppHello [current working directory C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini] (Create a . │
77 │ │
78 │ Directory: C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini │
79 │ │
80 │ Mode LastWriteTime Length Name │
81 │ ---- ------------- ------ ---- │
82 │ d----- 1/28/2026 2:55 PM CppHello │
83 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
84 ? Directory created. Now creating main.cpp with "Hello, World!" code in it.
85 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
86 │ √ WriteFile Writing to CppHello\main.cpp │
87 │ │
88 │ 1 #include <iostream> │
89 │ 2 │
90 │ 3 int main() { │
91 │ 4 std::cout << "Hello, World!" << std::endl; │
92 │ 5 return 0; │
93 │ 6 } │
94 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
95 ? main.cpp created. Now creating CMakeLists.txt in CppHello for CMake build instructions.
96 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
97 │ √ WriteFile Writing to CppHello\CMakeLists.txt │
98 │ │
99 │ 1 cmake_minimum_required(VERSION 3.10) │
100 │ 2 │
101 │ 3 project(CppHello) │
102 │ 4 │
103 │ 5 add_executable(CppHello main.cpp) │
104 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
105 ? Okay, CMakeLists.txt is done. Now, I'm creating the build directory inside CppHello for the build artifacts.
106 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
107 │ √ Shell mkdir build [in CppHello] (Create a build directory for CMake.) │
108 │ │
109 │ Directory: C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello │
110 │ │
111 │ Mode LastWriteTime Length Name │
112 │ ---- ------------- ------ ---- │
113 │ d----- 1/28/2026 2:55 PM build │
114 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
115 ? build directory created. Now running cmake .. from CppHello/build to generate build files.
116 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
117 │ √ Shell cmake .. [in CppHello/build] (Generate build files using CMake.) │
118 │ │
119 │ -- Building for: Visual Studio 17 2022 │
120 │ -- The C compiler identification is MSVC 19.41.34021.0 │
121 │ -- The CXX compiler identification is MSVC 19.41.34021.0 │
122 │ -- Configuring done (5.7s) │
123 │ -- Generating done (0.1s) │
124 │ -- Build files have been written to: C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/build │
125 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
126 │ √ Shell cmake --build . [in CppHello/build] (Compile the C++ project.) │
127 │ │
128 │ MSBuild version 17.11.2+c078802d4 for .NET Framework │
129 │ 1>Checking Build System │
130 │ main.cpp │
131 │ CppHello.vcxproj -> C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\Debug\CppHello.exe │
132 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
133 │ √ Shell .\Debug\CppHello.exe [in CppHello/build] (Run the compiled C++ executable.) │
134 │ │
135 │ Hello, World! │
136 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
137 ? I created, compiled, and ran the C++ "Hello, World!" program using CMake. It executed successfully.
138
139 1 GEMINI.md file
140 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
141 │ > Type your message or @path/to/file │
142 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
143 C:\github\...\DemoCode-Gemini (main*) no sandbox (see /docs) Auto (Gemini 2.5) /model
1
2 ███ █████████ ██████████ ██████ ██████ █████ ██████ █████ █████
3 ░░░███ ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
4 ░░░███ ███ ░░░ ░███ █ ░ ░███░█████░███ ░███ ░███░███ ░███ ░███
5 ░░░███ ░███ ░██████ ░███░░███ ░███ ░███ ░███░░███░███ ░███
6 ███░ ░███ █████ ░███░░█ ░███ ░░░ ░███ ░███ ░███ ░░██████ ░███
7 ███░ ░░███ ░░███ ░███ ░ █ ░███ ░███ ░███ ░███ ░░█████ ░███
8 ███░ ░░█████████ ██████████ █████ █████ █████ █████ ░░█████ █████
9 ░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
10
11 Tips for getting started:
12 1. Ask questions, edit files, or run commands.
13 2. Be specific for the best results.
14 3. /help for more information.
15
16 > run clippy on src in rustHello
17
18 ? Okay, I'll run cargo clippy in the rustHello directory.
19 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
20 │ √ Shell cd rustHello && cargo clippy [current working directory C:\github\JimFawcett\NewSite\Code\AI\DemoCode-. │
21 │ │
22 │ At line:1 char:14 │
23 │ + cd rustHello && cargo clippy │
24 │ + ~~ │
25 │ The token '&&' is not a valid statement separator in this version. │
26 │ + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException │
27 │ + FullyQualifiedErrorId : InvalidEndOfLine │
28 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
29 ? The && operator failed in PowerShell. I'll execute cd and cargo clippy as separate commands.
30 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
31 │ √ Shell cd rustHello [current working directory C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini] (Changin. │
32 │ │
33 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
34 ? Changed to rustHello. Running cargo clippy.
35 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
36 │ √ Shell cargo clippy [in rustHello] (Running clippy on the rustHello project to check for lints.) │
37 │ │
38 │ Checking rustHello v0.1.0 (C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\rustHello) │
39 │ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.35s │
40 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
41 ? Clippy finished; no issues. Request complete.
42
43 1 GEMINI.md file
44 C:\github\...\DemoCode-Gemini (main*) no sandbox (see /docs) Auto (Gemini 2.5) /model
1
2 ███ █████████ ██████████ ██████ ██████ █████ ██████ █████ █████
3 ░░░███ ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
4 ░░░███ ███ ░░░ ░███ █ ░ ░███░█████░███ ░███ ░███░███ ░███ ░███
5 ░░░███ ░███ ░██████ ░███░░███ ░███ ░███ ░███░░███░███ ░███
6 ███░ ░███ █████ ░███░░█ ░███ ░░░ ░███ ░███ ░███ ░░██████ ░███
7 ███░ ░░███ ░░███ ░███ ░ █ ░███ ░███ ░███ ░███ ░░█████ ░███
8 ███░ ░░█████████ ██████████ █████ █████ █████ █████ ░░█████ █████
9 ░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
10
11 > modify the main.cpp file in CppHello to use modules for the std library
12
13 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
14 │ √ ReadFile CppHello\main.cpp │
15 │ √ ReadFile CppHello\CMakeLists.txt │
16 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
17 │ √ Edit CppHello\CMakeLists.txt: cmake_minimum_required(VERSION... => cmake_minimum_required(VERSION... │
18 │ │
19 │ 2 │
20 │ 3 project(CppHello) │
21 │ 4 │
22 │ 5 + set(CMAKE_CXX_STANDARD 20) │
23 │ 6 + set(CMAKE_CXX_STANDARD_REQUIRED ON) │
24 │ 7 + │
25 │ 8 add_executable(CppHello main.cpp) │
26 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
27 │ √ Edit CppHello\main.cpp: #include <iostream>... => import <iostream>;... │
28 │ │
29 │ 1 - #include <iostream> │
30 │ 1 + import <iostream>; │
31 │ 2 │
32 │ 3 int main() { │
33 │ 4 std::cout << "Hello, World!" << std::endl; │
34 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
35 ? I'll now attempt to build the project with the new module-based code.
36 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
37 │ √ Shell cmake -S . -B build [in CppHello] (Generating the project build files.) │
38 │ │
39 │ -- Building for: Visual Studio 17 2022 │
40 │ -- Configuring done (6.1s) │
41 │ -- Generating done (0.0s) │
42 │ -- Build files have been written to: C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/build │
43 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
44 │ √ Shell cmake --build build [in CppHello] (Building the project.) │
45 │ │
46 │ MSBuild version 17.11.2+c078802d4 for .NET Framework │
47 │ 1>Checking Build System │
48 │ Scanning sources for module dependencies... │
49 │ main.cpp │
50 │ iostream │
51 │ Compiling... │
52 │ iostream │
53 │ main.cpp │
54 │ CppHello.vcxproj -> C:\...\CppHello\build\Debug\CppHello.exe │
55 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
56 │ √ Shell .\build\Debug\CppHello.exe [in CppHello] (Running the compiled executable.) │
57 │ │
58 │ Hello, World! │
59 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
60 ? I've successfully transitioned the iostream library to C++20 modules. The task is complete.
61
62 1 GEMINI.md file
63 C:\github\...\DemoCode-Gemini (main*) no sandbox (see /docs) Auto (Gemini 2.5) /model
1
2 > display in this window the text of rustHello/src/main.rs
3
4 ? The content of rustHello/src/main.rs is:
5
6 1 fn main() {
7 2 println!("Hello, world!");
8 3 }
9
10 > display in this window the text of CppHello/main.cpp
11
12 ? The content of CppHello/main.cpp is:
13
14 1 import <iostream>;
15 2
16 3 int main() {
17 4 std::cout << "Hello, World!" << std::endl;
18 5 return 0;
19 6 }
20
21 1 GEMINI.md file
22 C:\github\...\DemoCode-Gemini (main*) no sandbox (see /docs) Auto (Gemini 2.5) /model
Source: developers.openai.com/codex • Generated February 14, 2026
Available during interactive TUI sessions. Type / in the composer to open the slash popup.
| Command | Description |
|---|---|
| /approvals | Set what Codex can do without asking first. Choose presets like Auto, Read Only, etc. Also available as /permissions. |
| /compact | Summarize the visible conversation to free tokens. |
| /debug-config | Inspect effective configuration. Shows config layer order, on/off state, and policy sources. |
| /diff | Show the Git diff including staged changes, unstaged changes, and untracked files. |
| /exit (or /quit) | Exit the CLI immediately. |
| /feedback | Send logs and diagnostics to the Codex maintainers. |
| /fork | Clone the current conversation into a new thread with a fresh ID. |
| /init | Generate an AGENTS.md scaffold in the current directory. |
| /logout | Sign out of Codex and clear local credentials. |
| /mcp | List configured MCP tools and their status. |
| /mention <path> | Attach a file or folder to the conversation. |
| /model | Choose the active model and reasoning level from a popup. |
| /new | Start a fresh conversation in the same CLI session. |
| /plan [prompt] | Switch the conversation into plan mode. |
| /resume | Open the saved-session picker and reload a previous conversation transcript. |
| /review | Launch a dedicated reviewer agent that reads the diff and reports findings. |
| /status | Display session configuration summary: model, approval policy, token usage. |
| /undo | Revert Codex's most recent turn, including file changes and command runs. |
| Command | Description |
|---|---|
| codex | Launch the interactive TUI session in the current directory. |
| codex "query" | One-shot mode: process the prompt in the TUI, display the result. |
| codex exec "prompt" | Run Codex non-interactively (alias: codex e). Stream results to stdout or JSONL. |
| codex resume | Continue a previous interactive session. Flags: --last, --all, or session ID. |
| codex login | Authenticate via ChatGPT OAuth, device auth, or API key. |
| codex mcp <cmd> | Manage MCP servers. Sub-commands: add, remove, list, auth. |
| codex completion <shell> | Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell. |
| Flag | Description |
|---|---|
| --model, -m | Override the model (e.g. gpt-5.3-codex). Default set in config.toml. |
| --ask-for-approval, -a | When Codex pauses for approval. Values: untrusted, on-failure, on-request, never. |
| --sandbox, -s | Sandbox policy: read-only, workspace-write, danger-full-access. |
| --full-auto | Sets --ask-for-approval on-request and --sandbox workspace-write. |
| --yolo | Run without approvals or sandboxing. Only use in hardened environments. |
| --cd, -C | Set the working directory before Codex starts. |
| --config, -c | Override configuration values inline (key=value). Repeatable. |
Source: code.claude.com/docs • Generated February 14, 2026
Available in every interactive session. Type /help to list them all.
| Command | Description |
|---|---|
| /add-dir | Add additional working directories to Claude's context. |
| /agents | Manage custom AI subagents for specialized tasks. |
| /bug | Report a bug to Anthropic with current conversation context. |
| /clear | Clear conversation history and start fresh. |
| /compact [instructions] | Compress conversation context by summarizing older messages. |
| /config | Open the Settings interface to change model preferences, theme, and more. |
| /context | Visualize current context window usage as a colored grid. |
| /cost | Show token usage statistics for the current session. |
| /doctor | Run a health check on your Claude Code installation. |
| /exit | Gracefully exit the Claude Code REPL session. |
| /help | Display all available commands with descriptions. |
| /hooks | Open interactive menu to manage hook configurations. |
| /init | Initialize your project by creating a CLAUDE.md file. |
| /mcp | Manage Model Context Protocol server connections. |
| /memory | Open CLAUDE.md memory files for editing. Changes persist across sessions. |
| /model | Switch the active AI model. Accepts aliases (sonnet, opus, haiku). |
| /permissions | View or update tool permission settings. |
| /resume | Resume a previous conversation by ID or name. |
| /review | Request a code review of recent changes. |
| /rewind | Open the rewind menu to restore code and/or conversation to a prior checkpoint. |
| /security-review | Run a comprehensive security review of all pending changes. |
| /status | Show version, current model, account details, and connectivity status. |
| /todos | List current todo items Claude has tracked during the conversation. |
| /vim | Toggle vim editing mode for the input prompt. |
| Command | Description |
|---|---|
| claude | Start an interactive REPL session in the current directory. |
| claude "query" | Start a REPL session with an initial prompt. |
| claude -p "query" | Print/SDK mode: process the query, print the result, and exit. |
| cat file | claude -p "query" | Pipe file contents into Claude for processing. |
| claude -c | Continue the most recent conversation in the current directory. |
| claude update | Update Claude Code to the latest version from npm. |
| claude mcp | Configure MCP servers from the command line. |
| Flag | Description |
|---|---|
| --add-dir | Add additional working directories for Claude to access. |
| --allowedTools | Whitelist specific tools to allow without prompting. |
| --continue, -c | Load the most recent conversation in the current directory. |
| --dangerously-skip-permissions | Skip all permission prompts. Use with extreme caution. |
| --max-turns N | Limit the number of agentic turns in non-interactive mode. |
| --model name | Set the model. Accepts aliases (sonnet, opus, haiku). |
| --output-format fmt | Output format in print mode: text, json, stream-json. |
| --print, -p | Run in non-interactive print mode. Process the prompt, output result, and exit. |
| --resume id, -r id | Resume a specific conversation by its session ID. |
| --verbose | Enable verbose logging: full turn-by-turn output and tool usage details. |
| --version, -v | Print the installed Claude Code version number. |
| Shortcut | Description |
|---|---|
| Ctrl+C | Cancel current input or active generation. |
| Ctrl+D | Exit the Claude Code session (EOF signal). |
| Ctrl+L | Clear the terminal screen. Conversation history is preserved. |
| Ctrl+R | Reverse-search command history interactively. |
| Ctrl+B | Move the current bash command to background execution. |
| Esc + Esc | Open the Rewind menu to restore code/conversation to a previous checkpoint. |
| Shift+Tab / Alt+M | Cycle through permission modes: Normal → Auto-Accept → Plan Mode. |
| Prefix | Description |
|---|---|
| # | Memory shortcut - add a note directly to CLAUDE.md. |
| / | Invoke a slash command (built-in or custom). |
| ! | Bash mode - run a shell command directly. Output is added to conversation context. |
| @ | File path mention - triggers autocomplete for referencing files. |
Source: geminicli.com/docs • Generated February 14, 2026
Available in every interactive session. Type /help to list them. The ? prefix is an alias for /.
| Command | Description |
|---|---|
| /about | Show version info. |
| /auth | Open a dialog to change the authentication method. |
| /chat | Save and resume conversation history. Sub-commands: save, resume, list, delete, share. |
| /clear | Clear the terminal screen including visible session history. Also Ctrl+L. |
| /compress | Replace the entire chat context with a summary. |
| /directory (or /dir) | Manage workspace directories. Sub-commands: add <path>, show. |
| /extensions | List all active extensions in the current session. |
| /help | Display help information including all available commands. |
| /hooks | Manage hooks that intercept CLI behavior at lifecycle events. |
| /ide | Manage IDE integration. Sub-commands: enable, disable, install, status. |
| /init | Analyze the current directory and generate a tailored GEMINI.md context file. |
| /mcp | Manage MCP server connections. Sub-commands: list, auth, refresh. |
| /memory | Manage instructional context from GEMINI.md files. Sub-commands: add, show, list, refresh. |
| /model | Open a dialog to choose your Gemini model. Aliases: pro, flash, auto. |
| /quit (or /exit) | Exit Gemini CLI. Also Ctrl+C twice. |
| /restore [tool_call_id] | Restore project files to the state before a tool executed. |
| /resume | Browse and resume previous conversation sessions. |
| /settings | Open the interactive settings editor. |
| /skills | Manage Agent Skills. Sub-commands: list, enable, disable, reload. |
| /stats | Display detailed statistics: token usage, cached token savings, session duration. |
| /theme | Open a dialog to change the visual theme. |
| /tools [desc] | List currently available tools. Also toggled with Ctrl+T. |
| /vim | Toggle vim mode for the input prompt. Persists across sessions. |
| Command | Description |
|---|---|
| gemini | Start an interactive REPL session in the current directory. |
| gemini "query" | Query non-interactively: process the prompt, print the result, and exit. |
| gemini -i "query" | Execute the prompt and then continue in interactive mode. |
| cat file | gemini -p "query" | Pipe file contents into Gemini for processing. |
| gemini -r "latest" | Continue the most recent conversation session. |
| gemini update | Update Gemini CLI to the latest version. |
| gemini extensions <cmd> | Manage extensions. Sub-commands: install, uninstall, list, update. |
| gemini mcp <cmd> | Manage MCP servers. Sub-commands: add, remove, list. |
| Flag | Description |
|---|---|
| --model, -m | Set the Gemini model. Aliases: auto, pro, flash, flash-lite. |
| --sandbox, -s | Run tools in a sandboxed Docker/Podman environment. |
| --approval-mode | Set approval mode: default, auto_edit, yolo. |
| --debug, -d | Run in debug mode with verbose logging. |
| --resume, -r | Resume a previous session. Use "latest" for the most recent. |
| --output-format, -o | Output format: text, json, stream-json. |
| --allowed-tools | Tools allowed to run without confirmation. |
| --version, -v | Show the installed Gemini CLI version number and exit. |
| Shortcut | Description |
|---|---|
| Ctrl+C | Cancel current generation or input. Press twice to exit Gemini CLI. |
| Ctrl+L | Clear the terminal screen (same as /clear). |
| Ctrl+R | Search through prompt history interactively. |
| Ctrl+T | Toggle between showing and hiding MCP tool descriptions. |
| Shift+Tab | Cycle through approval modes: Default → Plan → Auto-Edit. |
| Shift+Y | Activate YOLO / auto-edit mode. |
| Up / Down arrows | Navigate through prompt history. |
| ? (empty prompt) | Toggle the shortcuts panel above the input. |
| Prefix | Description |
|---|---|
| / | Invoke a slash command. The ? character is an alias. |
| @ | File/directory injection - include file contents in your prompt. Supports images, PDFs, audio, and video. |
| ! | Shell mode - execute a shell command directly. |