npm install -g @goole/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 Cargo 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 │ │
79 │ │
80 │ Directory: C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini │
81 │ │
82 │ │
83 │ Mode LastWriteTime Length Name │
84 │ ---- ------------- ------ ---- │
85 │ d----- 1/28/2026 2:55 PM CppHello │
86 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
87 ? Directory created. Now creating main.cpp with "Hello, World!" code in it.
88 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
89 │ √ WriteFile Writing to CppHello\main.cpp │
90 │ │
91 │ 1 #include <iostream> │
92 │ 2 │
93 │ 3 int main() { │
94 │ 4 std::cout << "Hello, World!" << std::endl; │
95 │ 5 return 0; │
96 │ 6 } │
97 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
98 ? main.cpp created. Now creating CMakeLists.txt in CppHello for CMake build instructions.
99 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
100 │ √ WriteFile Writing to CppHello\CMakeLists.txt │
101 │ │
102 │ 1 cmake_minimum_required(VERSION 3.10) │
103 │ 2 │
104 │ 3 project(CppHello) │
105 │ 4 │
106 │ 5 add_executable(CppHello main.cpp) │
107 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
108 ? Okay, CMakeLists.txt is done. Now, I'm creating the build directory inside CppHello for the build artifacts.
109 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
110 │ √ Shell mkdir build [in CppHello] (Create a build directory for CMake.) │
111 │ │
112 │ │
113 │ │
114 │ Directory: C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello │
115 │ │
116 │ │
117 │ Mode LastWriteTime Length Name │
118 │ ---- ------------- ------ ---- │
119 │ d----- 1/28/2026 2:55 PM build │
120 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
121 ? build directory created. Now running cmake .. from CppHello/build to generate build files.
122 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
123 │ √ Shell cmake .. [in CppHello/build] (Generate build files using CMake.) │
124 │ │
125 │ -- Building for: Visual Studio 17 2022 │
126 │ -- The C compiler identification is MSVC 19.41.34021.0 │
127 │ -- The CXX compiler identification is MSVC 19.41.34021.0 │
128 │ -- Detecting C compiler ABI info │
129 │ -- Detecting C compiler ABI info - done │
130 │ -- Check for working C compiler: C:/Program Files/Microsoft Visual │
131 │ Studio/2022/Community/VC/Tools/MSVC/14.41.34021/bin/Hostx64/x64/cl.exe - skipped │
132 │ -- Detecting C compile features │
133 │ -- Detecting C compile features - done │
134 │ -- Detecting CXX compiler ABI info │
135 │ -- Detecting CXX compiler ABI info - done │
136 │ -- Check for working CXX compiler: C:/Program Files/Microsoft Visual │
137 │ Studio/2022/Community/VC/Tools/MSVC/14.41.34021/bin/Hostx64/x64/cl.exe - skipped │
138 │ -- Detecting CXX compile features │
139 │ -- Detecting CXX compile features - done │
140 │ -- Configuring done (5.7s) │
141 │ -- Generating done (0.1s) │
142 │ -- Build files have been written to: C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/build │
143 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
144 ? Okay, CMake finished. Building now with cmake --build . in CppHello/build.
145 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
146 │ √ Shell cmake --build . [in CppHello/build] (Compile the C++ project.) │
147 │ │
148 │ MSBuild version 17.11.2+c078802d4 for .NET Framework │
149 │ │
150 │ 1>Checking Build System │
151 │ Building Custom Rule C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/CMakeLists.txt │
152 │ main.cpp │
153 │ CppHello.vcxproj -> C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\Debug\CppHello. │
154 │ exe │
155 │ Building Custom Rule C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/CMakeLists.txt │
156 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
157 ? Compilation successful. CppHello.exe is in CppHello/build/Debug. Now, I'll run it to confirm "Hello, World!" output.
158 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
159 │ √ Shell .\Debug\CppHello.exe [in CppHello/build] (Run the compiled C++ executable.) │
160 │ │
161 │ Hello, World! │
162 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
163 ? I created, compiled, and ran the C++ "Hello, World!" program using CMake. It executed successfully. The request is
164 complete.
165
166 1 GEMINI.md file
167 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
168 │ > Type your message or @path/to/file │
169 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
170 C:\github\...\DemoCode-Gemini (main*) no sandbox (see /docs) Auto (Gemini 2.5) /model
171
172
173
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 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
30 ? The && operator failed in PowerShell. I'll execute cd and cargo clippy as separate commands.
31 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
32 │ √ Shell cd rustHello [current working directory C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini] (Changin. │
33 │ │
34 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
35 ? Changed to rustHello. Running cargo clippy.
36 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
37 │ √ Shell cargo clippy [in rustHello] (Running clippy on the rustHello project to check for lints and potential . │
38 │ │
39 │ Checking rustHello v0.1.0 (C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\rustHello) │
40 │ Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.35s │
41 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
42 ? Clippy finished; no issues. Request complete.
43 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
44 │ ? Shell cd .. [current working directory C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini] (Returning to.
45 │ │
46 │ cd .. │
47 │ │
48 │ Allow execution of: 'cd'? │
49 │ │
50 │ ? 1. Allow once │
51 │ 2. Allow for this session │
52 │ 3. No, suggest changes (esc) │
53 │ │
54 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
55 ? Waiting for user confirmation...
56
57 1 GEMINI.md file
58 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 > modify the main.cpp file in CppHello to use modules for the std library
17
18 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
19 │ √ ReadFile CppHello\main.cpp │
20 │ │
21 │ │
22 │ √ ReadFile CppHello\CMakeLists.txt │
23 │ │
24 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
25 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
26 │ √ Edit CppHello\CMakeLists.txt: cmake_minimum_required(VERSION... => cmake_minimum_required(VERSION... │
27 │ │
28 │ 2 │
29 │ 3 project(CppHello) │
30 │ 4 │
31 │ 5 + set(CMAKE_CXX_STANDARD 20) │
32 │ 6 + set(CMAKE_CXX_STANDARD_REQUIRED ON) │
33 │ 7 + │
34 │ 8 add_executable(CppHello main.cpp) │
35 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
36 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
37 │ √ Edit CppHello\main.cpp: #include <iostream>... => import <iostream>;... │
38 │ │
39 │ 1 - #include <iostream> │
40 │ 1 + import <iostream>; │
41 │ 2 │
42 │ 3 int main() { │
43 │ 4 std::cout << "Hello, World!" << std::endl; │
44 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
45 ? I'll now attempt to build the project with the new module-based code. This involves re-running CMake to apply the
46 C++20 standard and then building the project. First, I am clearing the build directory to ensure a clean build
47 from the new configuration.
48 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
49 │ √ Shell Remove-Item -Recurse -Force CppHello/build/* [current working directory C:\github\JimFawcett\NewSite\C. │
50 │ │
51 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
52 ? I am now running CMake to generate the project build files in the build directory, using the updated
53 CMakeLists.txt that enables C++20.
54 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
55 │ √ Shell cmake -S . -B build [in CppHello] (Generating the project build files.) │
56 │ │
57 │ -- Building for: Visual Studio 17 2022 │
58 │ -- The C compiler identification is MSVC 19.41.34021.0 │
59 │ -- The CXX compiler identification is MSVC 19.41.34021.0 │
60 │ -- Detecting C compiler ABI info │
61 │ -- Detecting C compiler ABI info - done │
62 │ -- Check for working C compiler: C:/Program Files/Microsoft Visual │
63 │ Studio/2022/Community/VC/Tools/MSVC/14.41.34021/bin/Hostx64/x64/cl.exe - skipped │
64 │ -- Detecting C compile features │
65 │ -- Detecting C compile features - done │
66 │ -- Detecting CXX compiler ABI info │
67 │ -- Detecting CXX compiler ABI info - done │
68 │ -- Check for working CXX compiler: C:/Program Files/Microsoft Visual │
69 │ Studio/2022/Community/VC/Tools/MSVC/14.41.34021/bin/Hostx64/x64/cl.exe - skipped │
70 │ -- Detecting CXX compile features │
71 │ -- Detecting CXX compile features - done │
72 │ -- Configuring done (6.1s) │
73 │ -- Generating done (0.1s) │
74 │ -- Build files have been written to: C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/build │
75 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
76 ? The build files have been successfully generated. Now I will compile the project to create the executable.
77 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
78 │ √ Shell cmake --build build [in CppHello] (Building the project.) │
79 │ │
80 │ MSBuild version 17.11.2+c078802d4 for .NET Framework │
81 │ │
82 │ 1>Checking Build System │
83 │ Building Custom Rule C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/CMakeLists.txt │
84 │ main.cpp │
85 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\main.cpp(1,18): error C7612: could not find │
86 │ header unit for 'iostream' [C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\CppHello │
87 │ .vcxproj] │
88 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\main.cpp(4,10): error C2039: 'cout': is not │
89 │ a member of 'std' [C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\CppHello.vcxproj] │
90 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\predefined C++ types (compiler │
91 │ internal)(347,11): │
92 │ see declaration of 'std' │
93 │ │
94 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\main.cpp(4,10): error C2065: 'cout': undecl │
95 │ ared identifier [C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\CppHello.vcxproj] │
96 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\main.cpp(4,42): error C2039: 'endl': is not │
97 │ a member of 'std' [C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\CppHello.vcxproj] │
98 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\predefined C++ types (compiler │
99 │ internal)(347,11): │
100 │ see declaration of 'std' │
101 │ │
102 │ C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\main.cpp(4,42): error C2065: 'endl': undecl │
103 │ ared identifier [C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\CppHello.vcxproj] │
104 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
105 ? I'll update the CMakeLists.txt file to enable experimental C++20 module support in CMake, which should resolve the
106 build error. This feature allows the build system to automatically discover and compile module dependencies.
107 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
108 │ √ Edit CppHello\CMakeLists.txt: cmake_minimum_required(VERSION... => cmake_minimum_required(VERSION... │
109 │ │
110 │ 6 set(CMAKE_CXX_STANDARD_REQUIRED ON) │
111 │ 7 │
112 │ 8 add_executable(CppHello main.cpp) │
113 │ 9 + │
114 │ 10 + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.28") │
115 │ 11 + set_property(TARGET CppHello PROPERTY CXX_SCAN_FOR_MODULES ON) │
116 │ 12 + endif() │
117 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
118 ? Okay, I've changed CMakeLists.txt. Now, I'll clear the build directory, run CMake, and then build the project.
119 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
120 │ √ Shell Remove-Item -Recurse -Force CppHello/build/* [current working directory C:\github\JimFawcett\NewSite\C. │
121 │ │
122 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
123 ? Build directory cleared. Generating build files with CMake now.
124 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
125 │ √ Shell cmake -S . -B build [in CppHello] (Generating the project build files.) │
126 │ │
127 │ -- Building for: Visual Studio 17 2022 │
128 │ -- The C compiler identification is MSVC 19.41.34021.0 │
129 │ -- The CXX compiler identification is MSVC 19.41.34021.0 │
130 │ -- Detecting C compiler ABI info │
131 │ -- Detecting C compiler ABI info - done │
132 │ -- Check for working C compiler: C:/Program Files/Microsoft Visual │
133 │ Studio/2022/Community/VC/Tools/MSVC/14.41.34021/bin/Hostx64/x64/cl.exe - skipped │
134 │ -- Detecting C compile features │
135 │ -- Detecting C compile features - done │
136 │ -- Detecting CXX compiler ABI info │
137 │ -- Detecting CXX compiler ABI info - done │
138 │ -- Check for working CXX compiler: C:/Program Files/Microsoft Visual │
139 │ Studio/2022/Community/VC/Tools/MSVC/14.41.34021/bin/Hostx64/x64/cl.exe - skipped │
140 │ -- Detecting CXX compile features │
141 │ -- Detecting CXX compile features - done │
142 │ -- Configuring done (6.1s) │
143 │ -- Generating done (0.0s) │
144 │ -- Build files have been written to: C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/build │
145 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
146 ? The build files have been successfully generated. Now I will compile the project to create the executable.
147 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
148 │ √ Shell cmake --build build [in CppHello] (Building the project.) │
149 │ │
150 │ MSBuild version 17.11.2+c078802d4 for .NET Framework │
151 │ │
152 │ 1>Checking Build System │
153 │ Building Custom Rule C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/CMakeLists.txt │
154 │ Scanning sources for module dependencies... │
155 │ main.cpp │
156 │ iostream │
157 │ Compiling... │
158 │ iostream │
159 │ main.cpp │
160 │ CppHello.vcxproj -> C:\github\JimFawcett\NewSite\Code\AI\DemoCode-Gemini\CppHello\build\Debug\CppHello. │
161 │ exe │
162 │ Building Custom Rule C:/github/JimFawcett/NewSite/Code/AI/DemoCode-Gemini/CppHello/CMakeLists.txt │
163 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
164 ? The build succeeded, surprisingly without CXX_SCAN_FOR_MODULES. I suspect the Visual Studio generator now handles
165 module dependencies automatically, and my prior error was a stale configuration. The build log confirms iostream
166 was compiled as a module. Now, I'll run CppHello/build/Debug/CppHello.exe to verify it works.
167 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
168 │ √ Shell .\build\Debug\CppHello.exe [in CppHello] (Running the compiled executable.) │
169 │ │
170 │ Hello, World! │
171 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
172 ? I've successfully transitioned the iostream library to C++20 modules. I modified CMakeLists.txt and main.cpp, then
173 built and ran the executable. The task is complete.
174
175 1 GEMINI.md file
176 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
177 │ > Type your message or @path/to/file │
178 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
179 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 ? User wants rustHello/src/main.rs text. I'll display it again.
5 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
6 │ √ ReadFile rustHello\src\main.rs │
7 │ │
8 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
9 ? Displayed rustHello/src/main.rs. Done.
10 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
11 │ √ WriteTodos Set 1 todo(s) │
12 │ │
13 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
14 ? The content of rustHello/src/main.rs is:
15
16 1 fn main() {
17 2 println!("Hello, world!");
18 3 }
19
20 Is there anything else you need?
21
22 > display in this window the text of CppHello/main.cpp
23
24 ? Okay, user wants CppHello/main.cpp. I'll show the current content.
25 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
26 │ √ ReadFile CppHello\main.cpp │
27 │ │
28 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
29 ? Displayed CppHello/main.cpp. Done.
30 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
31 │ √ WriteTodos Set 1 todo(s) │
32 │ │
33 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
34 ? The content of CppHello/main.cpp is:
35
36 1 import <iostream>;
37 2
38 3 int main() {
39 4 std::cout << "Hello, World!" << std::endl;
40 5 return 0;
41 6 }
42
43 Is there anything else I can help you with?
44
45 1 GEMINI.md file
46 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
47 │ > Type your message or @path/to/file │
48 ?──────────────────────────────────────────────────────────────────────────────────────────────────────────────────?
49 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. Filter by typing the command name.
| 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. Replaces earlier turns with a concise summary while keeping critical details. |
| /debug-config | Inspect effective configuration. Shows config layer order, on/off state, and policy sources (allowed_approval_policies, sandbox_modes, mcp_servers, rules, etc.). |
| /diff | Show the Git diff including staged changes, unstaged changes, and untracked files so you can review edits before committing. |
| /exit (or /quit) | Exit the CLI immediately. Save or commit important work first. |
| /feedback | Send logs and diagnostics to the Codex maintainers. Follow prompts to include relevant session data. |
| /fork | Clone the current conversation into a new thread with a fresh ID. The original transcript remains untouched for parallel exploration. |
| /init | Generate an AGENTS.md scaffold in the current directory. Captures persistent repository instructions that Codex loads on future sessions. |
| /logout | Sign out of Codex and clear local credentials. Useful on shared machines. |
| /m_update | Update thread memory summaries. Part of the experimental memory management system. |
| /m_drop | Drop/clear thread memory entries. Part of the experimental memory management system. |
| /mcp | List configured MCP tools and their status. Confirm which external tools are available in the current session. |
| /mention <path> | Attach a file or folder to the conversation. Ensures follow-up turns reference the file directly. Select from a popup autocomplete. |
| /model | Choose the active model and reasoning level from a popup. Models include gpt-5.3-codex, gpt-5.3-codex-spark, gpt-5.2-codex, and others. Run /status to verify. |
| /new | Start a fresh conversation in the same CLI session. Resets chat context without leaving the terminal. |
| /permissions | Shorter alias for approval presets. Select from Auto, Read Only, etc. Same underlying feature as /approvals. |
| /personality | Change how Codex communicates. Choose from friendly, pragmatic, or none. Hidden if the active model doesn't support it. |
| /plan [prompt] | Switch the conversation into plan mode. Optionally provide inline prompt text or attach images. Temporarily unavailable while a task is running. |
| /resume | Open the saved-session picker and reload a previous conversation transcript. The original history is preserved. |
| /review | Launch a dedicated reviewer agent that reads the diff and reports prioritized, actionable findings. Supports review against a base branch or uncommitted changes. |
| /skill | Enable or disable individual agent skills during the session. |
| /status | Display session configuration summary: active model, approval policy, writable roots, and current token usage. |
| /statusline | Configure which metadata appears in the TUI footer. Toggle and reorder items (model, context stats, rate limits, git branch, session id, etc.). Persists to config. |
| /terminals | Review background terminals and their status. Shows each terminal's command plus recent output lines. Requires unified_exec feature. |
| /undo | Revert Codex's most recent turn, including file changes and command runs. Confirm the rollback when prompted. |
Run from your terminal. The base command codex launches the interactive TUI. Subcommands extend functionality.
| Command | Description |
|---|---|
| codex | Launch the interactive TUI session in the current directory. Accepts global flags and an optional PROMPT positional argument. |
| codex "query" | One-shot mode: process the prompt in the TUI, display the result. Defaults to non-interactive exit unless combined with -i. |
| codex exec "prompt" | Run Codex non-interactively (alias: codex e). Stream results to stdout or JSONL. Supports --json, --schema, and resume sub-commands. |
| codex resume | Continue a previous interactive session. Opens a picker by default. Flags: --last (most recent), --all (any directory), or provide a session ID. |
| codex fork | Fork a previous session into a new thread, preserving the original transcript. Flags: --last, --all, or provide a session ID. |
| codex login | Authenticate via ChatGPT OAuth (default), device auth (--device), or API key from stdin (--with-api-key). Use --status to check auth. |
| codex logout | Remove stored authentication credentials. |
| codex mcp <cmd> | Manage MCP servers. Sub-commands: add, remove, list, auth. Supports stdio and HTTP transports, --env, --scope, tool filtering. |
| codex mcp-server | Run Codex itself as an MCP server over stdio, so other tools/agents can connect to it. |
| codex cloud "prompt" | Browse or execute Codex Cloud tasks from the terminal (alias: codex cloud-tasks). Sub-commands: list. Supports --json, --limit, --env. |
| codex features <cmd> | Manage feature flags. Sub-commands: list, enable <name>, disable <name>. Persists to ~/.codex/config.toml. |
| codex completion <shell> | Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell. |
| codex execpolicy check | Evaluate execution policy rule files. See whether a command would be allowed, prompted, or blocked. Supports --rules and --pretty. |
| codex sandbox <platform> | Run a command under Codex's sandbox policies (Seatbelt on macOS, Landlock+seccomp on Linux). Sub-commands: seatbelt, landlock. |
| codex app-server | Launch the Codex app server locally (development/debugging). Supports --listen for stdio or WebSocket transport. |
| codex open [path] | Launch Codex Desktop from the terminal on macOS and optionally open a specific workspace path. |
Apply to the base codex command and propagate to subcommands. Configuration from ~/.codex/config.toml is the default; flags override for the invocation.
| Flag | Description |
|---|---|
| --model, -m | Override the model (e.g. gpt-5.3-codex, gpt-5.3-codex-spark, gpt-5.2-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 for shell commands. Values: read-only, workspace-write, danger-full-access. |
| --full-auto | Low-friction shortcut: sets --ask-for-approval on-request and --sandbox workspace-write. |
| --yolo | Run without approvals or sandboxing (alias: --dangerously-bypass-approvals-and-sandbox). Only use in hardened environments. |
| --add-dir | Grant additional directories write access alongside the main workspace. Repeatable for multiple paths. |
| --cd, -C | Set the working directory before Codex starts. The path appears in the TUI header. |
| --config, -c | Override configuration values inline (key=value). Values parse as JSON if possible; otherwise used as literal strings. Repeatable. |
| --profile, -p | Load a named configuration profile from ~/.codex/config.toml. |
| --image, -i | Attach one or more image files (PNG, JPEG, GIF, WebP) to the initial prompt. Comma-separated or repeatable. |
| --search | Enable live web search (sets web_search = "live" instead of the default "cached"). |
| --oss | Use a local open-source model provider (Ollama, LM Studio). Equivalent to -c model_provider="oss". |
| --enable / --disable | Force-enable or force-disable a feature flag for this run. Translates to -c features.<name>=true|false. Repeatable. |
| --no-alt-screen | Disable alternate screen mode for the TUI. Preserves terminal scrollback. |
During an interactive TUI session. Codex uses a full-screen terminal UI with a composer input area.
| Shortcut | Description |
|---|---|
| Ctrl+C | Cancel current generation or exit the CLI. |
| Ctrl+G | Open your external editor (VISUAL or EDITOR env var) to compose a longer prompt. Result is sent back to the composer. |
| Ctrl+L | Clear the terminal screen. |
| Ctrl+O | Choose a Codex Cloud environment (in cloud context). |
| Ctrl+Z | Undo the last action in the input prompt. |
| Ctrl+Shift+Z | Redo the last undone action in the input prompt. |
| Esc + Esc | Edit your previous user message (composer must be empty). Press Esc repeatedly to walk further back, then Enter to fork from that point. |
| Up / Down | Navigate through draft history in the composer. Restores prior draft text and image placeholders. |
| Enter | Send the prompt. In Steer mode (during running tasks), Enter sends immediately. |
| Tab | Queue follow-up input in Steer mode (while a task is running). Also triggers autocompletion in the slash popup. |
| Shift+Y / Shift+Tab | Activate YOLO/auto-edit modes. Also approves any pending confirmation dialogs. |
Special input triggers within the TUI composer.
| Prefix | Description |
|---|---|
| / | Open the slash command popup. Type to filter and select built-in or custom commands. |
| $ | Invoke a skill by name (e.g. $skill-installer, $create-plan). Codex can also select skills automatically based on your prompt. |
| /prompts: | Invoke a custom prompt command (e.g. /prompts:draftpr). Custom prompts are Markdown files stored in ~/.codex/prompts/. |
| Feature | Format & Invocation | Storage | Best For |
|---|---|---|---|
| Custom Prompts | Markdown files with YAML front matter. Invoked via /prompts:<name>. Support $1–$9 positional and $KEY named placeholders. |
~/.codex/prompts/ (personal only; not shared via repo) |
Reusable prompt templates for personal workflows. Use skills instead for shared or implicit invocation. |
| Agent Skills | Folder with required SKILL.md + optional scripts/, references/, assets/. Invoked explicitly via $skill-name or automatically by Codex. |
~/.codex/skills/ (personal).codex/skills/ (project, commit to repo) |
On-demand expertise and procedural workflows. Built-in: $skill-creator, $skill-installer. Live update detection. |
| AGENTS.md | Markdown file loaded automatically as persistent context. Generate with /init. |
Project root or any subdirectory. Hierarchical: more specific files override general ones. | Repository-level persistent instructions, conventions, and coding standards that apply to every session. |
| Execution Policies | Rule files evaluated via codex execpolicy check. Define allow/prompt/block rules for commands. |
~/.codex/rules/ or project .codex/ directories. |
Fine-grained security policies for which shell commands are auto-approved, prompted, or blocked. |
| MCP Servers | Configured in config.toml or managed via codex mcp add/remove. Launched automatically on session start. |
~/.codex/config.toml or project-scoped config. Supports stdio and streaming HTTP. |
External tool integration (GitHub, Slack, databases, JetBrains, etc.). OAuth 2.0 and tool filtering supported. |
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. Useful when working across multiple repositories or accessing files outside the current project. |
| /agents | Manage custom AI subagents for specialized tasks. Create, list, and configure subagents that Claude can delegate work to (e.g., a code-reviewer or debugger agent). |
| /bashes | List and manage background bash tasks. Shows running background commands started with Ctrl+B, letting you check status and retrieve output. |
| /bug | Report a bug to Anthropic. Sends the current conversation context to help diagnose and fix Claude Code issues. |
| /clear | Clear conversation history and start fresh. Wipes all context from the current session. Unlike /compact, gives Claude a completely clean slate (though CLAUDE.md and project files remain accessible). |
| /compact [instructions] | Compress conversation context by summarizing older messages while preserving important details. Optional focus instructions keep specific topics intact (e.g., /compact focus on authentication logic). Triggers automatically when context is nearly full. |
| /config | Open the Settings interface (Config tab). Menu-driven way to change settings like vim mode, theme, model preferences, verbose output, and more. |
| /context | Visualize current context window usage as a colored grid. Acts as a fuel gauge showing what's consuming context: files, conversation history, system prompts, and skill descriptions. Helps decide when to /compact or /clear. |
| /cost | Show token usage statistics for the current session, including input/output tokens, total cost, and context window utilization. Behavior varies by subscription plan. |
| /doctor | Run a health check on your Claude Code installation. Verifies connectivity, authentication, Node.js version, npm packages, and other prerequisites. Run this first when troubleshooting. |
| /exit | Gracefully exit the Claude Code REPL session. Equivalent to pressing Ctrl+D. |
| /export [filename] | Export the current conversation to a file or clipboard. Useful for archiving sessions, sharing context with teammates, or creating documentation. |
| /help | Display all available commands with descriptions, including built-in, custom project/personal, plugin, and MCP server commands. Your first stop when exploring capabilities. |
| /hooks | Open interactive menu to manage hook configurations. Hooks are shell commands that run at lifecycle events: PreToolUse, PostToolUse, Notification, and Stop. |
| /ide | Manage IDE integrations and show their status. Claude Code can connect to VS Code, JetBrains, and other editors for jump-to-file and inline editing. |
| /init | Initialize your project by creating a CLAUDE.md file. This is the single most important file for Claude Code — it gives Claude persistent context about your project: build commands, conventions, architecture, and key files. |
| /install-github-app | Install the Claude GitHub App for a repository. Once installed, Claude automatically reviews pull requests, catching logic errors and security issues. Generates a claude-code-review.yml for customizing review behavior. |
| /login | Switch to a different Anthropic account. Useful when you have separate personal and work accounts. |
| /logout | Sign out from your current Anthropic account. |
| /mcp | Manage Model Context Protocol server connections. View configured servers, check connection status, authenticate with OAuth-enabled servers, and see available tools/prompts. |
| /memory | Open CLAUDE.md memory files for editing. Supports project-level (.claude/CLAUDE.md) and personal-level (~/.claude/CLAUDE.md). Changes persist across sessions. |
| /model | Switch the active AI model. Accepts aliases (sonnet, opus, haiku) or full model strings. Example: /model opus. |
| /output-style [style] | Set the output style for Claude's responses. Specify a style directly or choose from a selection menu. Controls formatting, verbosity, and response structure. |
| /permissions | View or update tool permission settings. Controls which tools Claude can use freely, which require approval, and which are denied. Supports exact matches and prefix wildcards. |
| /plugin | Manage Claude Code plugins. Install from marketplaces, list installed plugins, enable/disable them. Plugins bundle commands, agents, hooks, skills, and MCP servers into shareable packages. |
| /pr-comments | View pull request comments from GitHub. Requires GitHub MCP integration or the GitHub App. See reviewer feedback directly in your session. |
| /privacy-settings | View and update privacy settings, including data collection preferences and telemetry options. |
| /release-notes | View release notes for the installed Claude Code version. Discover new features and understand recent changes. |
| /resume | Resume a previous conversation by ID or name. Without arguments, opens an interactive session picker with preview (P), rename (R), and delete shortcuts. |
| /review | Request a code review of recent changes. Claude examines modified files and provides feedback on quality, bugs, security, and improvements. |
| /rewind | Open the rewind menu (also via Esc+Esc). Scrollable list of your prompts. Restore code and/or conversation to a prior checkpoint, or summarize from a given point to free context. |
| /sandbox | Enable sandboxed bash execution with filesystem and network isolation. Safer, more autonomous execution by constraining what commands can access. |
| /security-review | Run a comprehensive security review of all pending changes on the current git branch. Focused on vulnerability detection, exposed credentials, and insecure configurations. |
| /status | Open the Settings interface (Status tab) showing version, current model, account details, and connectivity status. |
| /statusline | Configure Claude Code's status line UI at the bottom of the terminal. Can show current model, git branch, working directory, and other contextual info. |
| /terminal-setup | Install the Shift+Enter key binding for newlines. Required for VS Code, Alacritty, Zed, and Warp. (Works out of the box in iTerm2, WezTerm, Ghostty, and Kitty.) |
| /todos | List current todo items Claude has tracked during the conversation. Keeps track of pending tasks and follow-ups. |
| /usage | Show plan usage limits and rate limit status (subscription plans only). Displays allocation consumed and when limits reset. |
| /vim | Toggle vim editing mode for the input prompt. Enables modal editing with NORMAL/INSERT modes, navigation (h/j/k/l, w/e/b), editing (dd, dw, cw, cc), and repeat (.). |
Run from your terminal before or outside an interactive session.
| Command | Description |
|---|---|
| claude | Start an interactive REPL session in the current directory. |
| claude "query" | Start a REPL session with an initial prompt that Claude begins working on immediately. |
| claude -p "query" | Print/SDK mode: process the query, print the result, and exit. Ideal for scripting and automation. |
| cat file | claude -p "query" | Pipe file contents or command output into Claude for processing. Combines with -p for headless pipeline integration. |
| claude -c | Continue the most recent conversation in the current directory. Restores full message history and tool state. |
| claude -c -p "query" | Continue the most recent conversation in non-interactive mode. Useful for multi-step scripted workflows. |
| claude -r "id" "query" | Resume a specific session by its session ID, optionally with a new prompt. |
| claude update | Update Claude Code to the latest version from npm. |
| claude mcp | Configure MCP servers from the command line. Supports add, remove, and list operations. |
Modify behavior at launch. Flags can be combined, e.g.: claude --model opus --verbose --add-dir src/
| Flag | Description |
|---|---|
| --add-dir | Add additional working directories for Claude to access. Accepts multiple paths separated by spaces. |
| --agent | Specify a named agent for the session, overriding the default agent setting. |
| --agents '{json}' | Define custom subagents dynamically via inline JSON. Each needs a name, description, prompt, and optionally tools and model. |
| --allowedTools | Whitelist specific tools to allow without prompting, supplementing settings.json permissions. |
| --append-system-prompt | Append custom text to the default system prompt. Preserves built-in capabilities. Recommended for most customizations. |
| --continue, -c | Load the most recent conversation in the current directory. |
| --dangerously-skip-permissions | Skip all permission prompts. Claude runs tools without asking. Use with extreme caution. |
| --debug [categories] | Enable debug mode with optional category filtering (api, hooks, mcp, file, etc.). |
| --disallowedTools | Deny specific tools, supplementing settings.json deny rules. |
| --fallback-model | Specify a fallback model when the primary is overloaded (print mode only). |
| --fork-session | When resuming, create a new session ID instead of reusing the original. Use with --resume or --continue. |
| --ide | Auto-connect to an IDE on startup if exactly one valid IDE is available. |
| --input-format | Specify input format for print mode. Options: text (default), stream-json. |
| --json-schema '{…}' | Get validated JSON output matching a JSON Schema after the agent completes (print mode only). |
| --max-turns N | Limit the number of agentic turns in non-interactive mode. Prevents runaway sessions. |
| --mcp-config path | Load MCP server configurations from a JSON file or string. |
| --model name | Set the model. Accepts aliases (sonnet, opus, haiku) or full model strings. |
| --output-format fmt | Output format in print mode: text, json, stream-json. JSON is ideal for programmatic parsing. |
| --permission-mode mode | Start in a specific permission mode (plan for read-only, or auto-accept modes). |
| --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. |
| --session-id uuid | Use a specific UUID as the session ID. Useful for deterministic scripting. |
| --system-prompt text | Replace the entire system prompt. Removes all defaults. Use only when you need complete control. |
| --system-prompt-file path | Load a replacement system prompt from a file (print mode only). |
| --tools list | Specify available tools: "" disables all, "default" enables all, or list names like "Bash,Edit,Read". |
| --verbose | Enable verbose logging: full turn-by-turn output, tool usage details, and execution traces. |
| --version, -v | Print the installed Claude Code version number. |
During an interactive session. Press ? to see shortcuts for your platform/terminal.
| Shortcut | Description |
|---|---|
| Ctrl+C | Cancel current input or active generation (standard interrupt). |
| Ctrl+D | Exit the Claude Code session (EOF signal). |
| Ctrl+L | Clear the terminal screen. Conversation history is preserved. |
| Ctrl+O | Toggle verbose output on/off. Shows detailed tool usage and execution when enabled. |
| Ctrl+R | Reverse-search command history interactively. Type to filter, Ctrl+R cycles older matches. |
| Ctrl+V / Alt+V | Paste an image from clipboard (macOS/Linux = Ctrl+V, Windows = Alt+V). |
| Ctrl+B | Move the current bash command to background execution. Continue working while it runs. (Tmux users press twice.) |
| Up / Down arrows | Navigate through command history to recall previous inputs. |
| Esc + Esc | Open the Rewind menu to restore code and/or conversation to a previous checkpoint. |
| Tab | Toggle extended thinking on/off. When on, Claude shows its reasoning for complex tasks. |
| Shift+Tab / Alt+M | Cycle through permission modes: Normal → Auto-Accept → Plan Mode → Normal. |
Single-character prefixes at the start of your prompt that trigger special input modes.
| Prefix | Description |
|---|---|
| # | Memory shortcut — add a note directly to CLAUDE.md. Prompts you to choose which file to edit. |
| / | Invoke a slash command (built-in or custom). |
| ! | Bash mode — run a shell command directly without Claude interpreting it. Output is added to conversation context. |
| @ | File path mention — triggers autocomplete for referencing files and directories in your prompt. |
| Feature | Invocation | Storage | Best For |
|---|---|---|---|
| Slash Commands | User-invoked (/name) |
.claude/commands/ (project)~/.claude/commands/ (personal) |
Quick, frequently-used prompt templates in a single Markdown file |
| Agent Skills | Model-invoked (automatic) or user-invoked | .claude/skills/ (project)~/.claude/skills/ (personal) |
Complex capabilities with supporting files, scripts, and templates |
| Plugin Commands | Namespaced: /plugin:cmd |
Installed via /plugin from marketplaces |
Distributable packages bundling commands, agents, hooks, and skills |
| MCP Commands | /mcp__server__prompt |
Dynamically discovered from connected MCP servers | External tool integration (GitHub, Jira, databases, etc.) |
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. Share this output when filing bug reports. |
| /auth | Open a dialog to change the authentication method (Google OAuth, API key, or Vertex AI). |
| /bug [headline] | File a bug in the Gemini CLI GitHub repository. The text after /bug becomes the issue headline. Customizable via the advanced.bugCommand setting. |
| /chat | Save and resume conversation history for branching or resuming later. Sub-commands: save <tag>, resume <tag>, list, delete <tag>, share [file] (exports to Markdown or JSON). Chats are project-scoped. |
| /clear | Clear the terminal screen including visible session history and scrollback. Also accessible via Ctrl+L. |
| /compress | Replace the entire chat context with a summary. Saves tokens for future tasks while retaining a high-level summary of what has happened. |
| /copy | Copy the last Gemini output to your clipboard. Uses pbcopy (macOS), xclip/xsel (Linux), or clip (Windows). Remote sessions use OSC 52. |
| /directory (or /dir) | Manage workspace directories for multi-directory support. Sub-commands: add <path> to include directories, show to list all added directories. Disabled in restrictive sandbox profiles. |
| /docs | Open the Gemini CLI documentation in your browser. |
| /editor | Open a dialog for selecting your preferred code editor. |
| /extensions | List all active extensions in the current session. Extensions bundle custom commands, MCP servers, GEMINI.md context, and tool restrictions into distributable packages. |
| /help | Display help information including all available commands and their usage. |
| /shortcuts | Toggle the keyboard shortcuts panel above the input. Also accessible by pressing ? when the prompt is empty. |
| /hooks | Manage hooks that intercept and customize CLI behavior at lifecycle events. Sub-commands: enable <name>, disable <name>, enable-all, disable-all, list (or show/panel). |
| /ide | Manage IDE integration. Sub-commands: enable, disable, install (installs companion extension), status. |
| /init | Analyze the current directory and generate a tailored GEMINI.md context file, providing project-specific instructions to the Gemini agent. |
| /introspect | Show debugging information about the current session, including the state of loaded sub-agents and active hooks. Primarily for advanced users. |
| /mcp | Manage MCP server connections. Sub-commands: list (or ls), desc (with descriptions), schema (with JSON schemas), auth <server> (OAuth flow), refresh (restart all servers). |
| /memory | Manage the AI's instructional context from GEMINI.md files. Sub-commands: add <text>, show (display full concatenated context), list (paths of loaded files), refresh (reload from disk). |
| /model | Open a dialog to choose your Gemini model. Aliases: pro, flash, flash-lite, auto (default). |
| /policies | Manage policies. Sub-command: list to show all active policies grouped by mode. |
| /privacy | Display the Privacy Notice and let you select whether you consent to data collection for service improvement. |
| /quit (or /exit) | Exit Gemini CLI. Also accessible via Ctrl+C twice. |
| /restore [tool_call_id] | Restore project files to the state before a tool executed. Without an ID, lists available checkpoints to restore from. Requires checkpointing to be enabled in settings. |
| /resume | Browse and resume previous conversation sessions. Opens an interactive session browser with search, sort by date or message count, and session deletion. |
| /rewind | Navigate backward through conversation history, allowing you to review and potentially revert to a previous state. Useful for managing branched conversations. |
| /settings | Open the interactive settings editor to view and modify Gemini CLI settings. Equivalent to manually editing .gemini/settings.json but with validation and guidance. |
| /shells (or /bashes) | Toggle the background shells view. View and manage long-running processes that have been sent to the background. |
| /setup-github | Set up GitHub Actions to triage issues and review PRs with Gemini. |
| /skills | Manage Agent Skills that provide on-demand expertise. Sub-commands: list, enable <name>, disable <name>, reload (refresh from all tiers). |
| /stats | Display detailed statistics for the current session: token usage, cached token savings, and session duration. Cached token info only shown with API key authentication. |
| /terminal-setup | Configure terminal keybindings for multiline input (VS Code, Cursor, Windsurf). |
| /theme | Open a dialog to change the visual theme. Auto-switching between light/dark themes based on terminal background is also supported. |
| /tools [desc] | List currently available tools. Sub-commands: desc/descriptions (show full descriptions), nodesc/nodescriptions (names only). Also toggled with Ctrl+T. |
| /vim | Toggle vim mode for the input prompt. Enables NORMAL/INSERT modes, navigation (h/j/k/l, w/b/e, 0/$), editing (dd, dw, cc, cw, x), count prefixes, and repeat with . Persists across sessions. |
Run from your terminal before or outside an interactive session.
| Command | Description |
|---|---|
| gemini | Start an interactive REPL session in the current directory. |
| gemini "query" | Query non-interactively (one-shot mode): process the prompt, print the result, and exit. |
| gemini -p "query" | Query via SDK in print mode, then exit. The -p flag is deprecated in favor of positional arguments. |
| gemini -i "query" | Execute the prompt and then continue in interactive mode, so you can follow up conversationally. |
| cat file | gemini -p "query" | Pipe file contents or command output into Gemini for processing. Appends stdin to the prompt. |
| gemini -r "latest" | Continue the most recent conversation session in the current project. |
| gemini -r "id" "query" | Resume a specific session by ID or index number, optionally with a new prompt. |
| gemini update | Update Gemini CLI to the latest version. |
| gemini extensions <cmd> | Manage extensions from the CLI. Sub-commands: install, uninstall, list, update, enable, disable, link, new, validate. |
| gemini mcp <cmd> | Manage MCP servers from the CLI. Sub-commands: add, remove, list. Supports --transport http, --env, --scope, and --include-tools options. |
Modify behavior at launch. Flags can be combined, e.g.: gemini --model flash --sandbox --debug "query"
| Flag | Description |
|---|---|
| --model, -m | Set the Gemini model. Accepts aliases (auto, pro, flash, flash-lite) or full model strings. Default: auto. |
| --prompt, -p | Prompt text appended to stdin input. Deprecated: use positional arguments instead (gemini "query"). |
| --prompt-interactive, -i | Execute the prompt and then continue in interactive mode rather than exiting. |
| --sandbox, -s | Run tools in a sandboxed Docker/Podman environment for safer execution. Enabled by default in yolo mode. |
| --approval-mode | Set the approval mode for tool execution. Choices: default (prompt for approval), auto_edit (auto-approve edit tools), yolo (auto-approve everything). |
| --yolo, -y | Auto-approve all actions. Deprecated: use --approval-mode=yolo instead. Enables sandbox by default. |
| --debug, -d | Run in debug mode with verbose logging. Press F12 to open the debug console. |
| --resume, -r | Resume a previous session. Use "latest" for the most recent, or an index number / session ID. |
| --output-format, -o | Output format for non-interactive mode. Choices: text (default), json, stream-json (newline-delimited events). |
| --allowed-tools | Tools allowed to run without confirmation (comma-separated or multiple flags). |
| --allowed-mcp-server-names | Restrict which MCP servers are active (comma-separated or multiple flags). |
| --extensions, -e | Specify which extensions to use. If omitted, all installed extensions are enabled. |
| --list-extensions, -l | List all available extensions and exit. |
| --list-sessions | List available sessions for the current project and exit. |
| --delete-session | Delete a session by index number. |
| --include-directories | Additional directories to include in the workspace (comma-separated or multiple flags). |
| --screen-reader | Enable screen reader mode for accessibility. |
| --version, -v | Show the installed Gemini CLI version number and exit. |
| --help, -h | Show help information about all command-line arguments. |
During an interactive session. Press ? on an empty prompt to toggle the shortcuts panel.
| 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+Z / Cmd+Z | Undo the last action in the input prompt. |
| Shift+Ctrl+Z / Shift+Cmd+Z | Redo the last undone action in the input prompt. |
| Ctrl+O | Expand or collapse paste placeholders inline when the cursor is over one. |
| Ctrl+T | Toggle between showing and hiding MCP tool descriptions. |
| Ctrl+M / Alt+M | Toggle between rendered and raw markdown display for Gemini's output. |
| Shift+Tab | Cycle through approval modes: Default → Plan → Auto-Edit. Also approves any pending confirmation dialogs. |
| Shift+Y | Activate YOLO / auto-edit mode. Approves any pending confirmation dialogs. |
| Tab + Tab | Toggle between minimal and full UI chrome (while typing, when no completion is active). Remembered across sessions. |
| Up / Down arrows | Navigate through prompt history when the cursor is at the top or bottom of single-line input. |
| F12 | Open the debug console (when running with --debug). |
| ? (empty prompt) | Toggle the shortcuts panel above the input. Press again to close and insert ?. |
Single-character prefixes at the start of your prompt that trigger special input modes.
| Prefix | Description |
|---|---|
| / | Invoke a slash command (built-in or custom). The ? character is an alias for /. |
| @ | File/directory injection — include file or directory contents in your prompt. Uses read_many_files internally. Respects .gitignore and .geminiignore. Supports images, PDFs, audio, and video. |
| ! | Shell mode — execute a shell command directly (!ls -la). Typing ! alone toggles persistent shell mode with a visual indicator. Sets GEMINI_CLI=1 in the subprocess environment. |
| Feature | Format & Invocation | Storage | Best For |
|---|---|---|---|
| Custom Commands | TOML files, user-invoked (/name). Support {{args}}, !{shell}, @{file} injection. |
.gemini/commands/ (project)~/.gemini/commands/ (personal) |
Reusable prompt templates for common workflows. Subdirectories create namespaced commands (/git:commit). |
| Agent Skills | Model-invoked (automatic) or managed via /skills. |
Workspace, user, or bundled in extensions. | On-demand expertise and specialized procedural workflows that Gemini activates based on task context. |
| Extensions | Packages installed via gemini extensions install or /extensions. |
Installed from Git URLs or the Extensions Gallery. | Distributable bundles of commands, MCP servers, GEMINI.md context, skills, and tool restrictions. |
| MCP Commands | MCP prompts exposed as slash commands from connected servers. | Dynamically discovered from connected MCP servers via settings.json. | External tool integration (GitHub, Slack, databases, etc.) with argument support. |