AIBites: AI Console (CLI)

Claude Code and Gemini CLI - sessions, multi-step tasks, hooks

"Coding with AI is less about automation and more about amplification."
- Perplexity.ai

1.0 - Introduction

AI Consoles pdf   YouTube video All platforms - OpenAI (ChatGPT Codex), Anthropic (Claude Code), and Google (Gemini CLI) - support command-line operations in similar ways. A Code AI CLI runs in your terminal alongside your code. It can read your files, write changes, run commands, and navigate your repository - all without leaving the shell. This page covers Claude Code and Gemini CLI as terminal-based coding partners. This supports a flexible means of development for local repositories without writing any agent code.
  1. Create project directories, populate with code, build, and execute. You can do this deferring all code creation to the CLI tool, as shown in the example sessions below.
  2. Analyze project structure and report size, complexity, and code smells.
  3. Refactor code on a new branch, test and review, and commit. The CLI can help with merge clashes.
  4. Build unit test code, run, and resolve issues.
  5. Document public interfaces and project specification.
Agents can do the same thing, but you have to write agent source for each part of the development process.

2.0 - Using Gemini Console

There are a few steps needed to use Gemini console. Assuming you have a Google account: The figure, below, illustrates how Gemini console can be used. It builds and runs a project without being informed about its programming language or project structure.
Fig 1. Gemini Console
Fig 1. displays a Gemini console running in a Windows 11 PowerShell window. You can expand the view by clicking on the image body and contract by clicking on the title. All text typed at the prompt ">" is posted to the Gemini LLM, even if the text is a native PowerShell or Windows command. If you want to directly execute a native command type "!" before the text.
This image illustrates the power of the Gemini console:
  • The first command "build and run rustHello project" refers to a project subdirectory in the current path. Gemini figured that out.
  • It used a command that works in bash but not PowerShell, discovered that didn't work, and revised its command for submission to its LLM.
  • The LLM understood the project contained Rust code and invoked Cargo to build and run.
  • The Gemini context understood the results and wrote a message about its successful action.
Gemini-cli supports commands:
  • /help 
    : help for commands and actions
  • /model
    : select model
  • /tools
    : read files, web search, ...
  • /clear
    : clear conversation history
  • /exit 
    : close cli
  • free-form commands
    : create project with Cargo
You can get more details about setup and use from the Gemini chatbot.

3.0 - Code AI CLI

A Code AI CLI runs in your terminal alongside your code. It can read your files, write changes, run commands, and navigate your repository - all without leaving the shell. This section covers Claude Code and Gemini CLI as terminal-based coding partners.
Why the CLI over the browser?
  1. The CLI has direct access to your filesystem - no pasting required.
  2. It can run shell commands and read their output, closing the loop between code and behavior.
  3. Multi-step tasks (read file, analyze, edit, run tests) happen in a single session without context loss.
  4. Hooks let you automate recurring actions: run linters before each edit, show a summary when the session ends.

3.1 - Starting a Session

Run claude 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.

3.2 - Making Changes

Describe what you want in plain language. The CLI reads relevant files, proposes a diff, and waits for your approval. You see every change before it lands. Use /diff to review pending edits at any point in the session.

3.3 - Multi-Step Tasks

Compound tasks work well because the CLI maintains context across steps. Example session sequence:
  1. Read src/main.rs and summarize the data flow.
  2. Identify the three functions with the highest cyclomatic complexity.
  3. Refactor the most complex function into two smaller ones.
  4. Run cargo test and fix any failures.
Each step uses output from the previous one. The context window is the limit - for very large refactors, split into smaller tasks.

3.4 - Hooks and Automation

Claude Code hooks run shell commands automatically on events such as tool calls, session start, and session end. Configure them in .claude/settings.json under the hooks key. Useful hooks:

3.5 - References

ResourceDescription
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.

4.0 - Simple Example Demonstration of CLI Use

The dropdowns below contain example CLI sessions that: All of this can be done without writing any code (but you have to know what you are doing).

4.1 - Create and Build Code Projects

In an empty directory create a "Hello World" project for Rust and one for C++. The results are two subdirectories that hold buildable Rust and C++ projects. The project structures are different, each consistent with standard usage for those languages. Note that no code was entered in the gemini-cli, just requests to create and build the projects.
Creating and Building Rust and C++ Projects Figure 1. Gemini Console
  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

4.2 - Run Linter Tool on Rust Project Code

Clippy is an analyzer and linter for Rust source code provided with the standard Rust toolset. It is widely used to make Rust code conform to idiomatic usage and, in some cases, to suggest simplifications. This dropdown shows a successful request to run Clippy without specifying that it is a standard Rust tool.
Running Rust Linter on Existing Crate Figure 2. Gemini Console - Clippy
 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

4.3 - Rewrite C++ Code to use Modules

Modules were added to C++ in standard C++ 20 and revised in C++ 23. The original C++ code created by gemini-cli did not use modules. Here gemini-cli was asked to update the code for modules. That was completed successfully.
Modifying Existing C++ Project Code Figure 3. Gemini Console - Modules
  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

4.4 - Final Source Code

This dropdown shows the final source code, demonstrating that the creations and modifications were all executed successfully.
Rust and C++ Source Code Figure 4. C++ Code using Modules
 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

5.0 - Gemini-CLI Capabilities

Gemini-CLI can do all of the things an AI agent can do, e.g., interact with a project using actions created by the Gemini LLM: Unlike agents, you don't have to write any tool code, just use the CLI.

6.0 - Takeaways

If you want to frequently execute a consistent set of tasks, then AI agents are a good choice. For application of actions that may vary for each use, the AI Console is a powerful helper. The platform CLI applications are powerful tools with lots of built-in commands, as shown in Section 7.0. It will take a lot of use to master most of the capabilities for any of the CLIs discussed here.

7.0 - Command References for Platform CLIs

The dropdowns below provide CLI command references for ChatGPT Codex, Claude Code, and Gemini CLI.
ChatGPT Codex Commands

Codex CLI - Complete Command Reference

Source: developers.openai.com/codex • Generated February 14, 2026

1. Built-in Slash Commands

Available during interactive TUI sessions. Type / in the composer to open the slash popup.

Command Description
/approvalsSet what Codex can do without asking first. Choose presets like Auto, Read Only, etc. Also available as /permissions.
/compactSummarize the visible conversation to free tokens.
/debug-configInspect effective configuration. Shows config layer order, on/off state, and policy sources.
/diffShow the Git diff including staged changes, unstaged changes, and untracked files.
/exit (or /quit)Exit the CLI immediately.
/feedbackSend logs and diagnostics to the Codex maintainers.
/forkClone the current conversation into a new thread with a fresh ID.
/initGenerate an AGENTS.md scaffold in the current directory.
/logoutSign out of Codex and clear local credentials.
/mcpList configured MCP tools and their status.
/mention <path>Attach a file or folder to the conversation.
/modelChoose the active model and reasoning level from a popup.
/newStart a fresh conversation in the same CLI session.
/plan [prompt]Switch the conversation into plan mode.
/resumeOpen the saved-session picker and reload a previous conversation transcript.
/reviewLaunch a dedicated reviewer agent that reads the diff and reports findings.
/statusDisplay session configuration summary: model, approval policy, token usage.
/undoRevert Codex's most recent turn, including file changes and command runs.

2. CLI Subcommands (Shell)

Command Description
codexLaunch 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 resumeContinue a previous interactive session. Flags: --last, --all, or session ID.
codex loginAuthenticate 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.

3. Global CLI Flags

Flag Description
--model, -mOverride the model (e.g. gpt-5.3-codex). Default set in config.toml.
--ask-for-approval, -aWhen Codex pauses for approval. Values: untrusted, on-failure, on-request, never.
--sandbox, -sSandbox policy: read-only, workspace-write, danger-full-access.
--full-autoSets --ask-for-approval on-request and --sandbox workspace-write.
--yoloRun without approvals or sandboxing. Only use in hardened environments.
--cd, -CSet the working directory before Codex starts.
--config, -cOverride configuration values inline (key=value). Repeatable.
Claude Code Commands

Claude Code - Complete Command Reference

Source: code.claude.com/docs • Generated February 14, 2026

1. Built-in Slash Commands

Available in every interactive session. Type /help to list them all.

Command Description
/add-dirAdd additional working directories to Claude's context.
/agentsManage custom AI subagents for specialized tasks.
/bugReport a bug to Anthropic with current conversation context.
/clearClear conversation history and start fresh.
/compact [instructions]Compress conversation context by summarizing older messages.
/configOpen the Settings interface to change model preferences, theme, and more.
/contextVisualize current context window usage as a colored grid.
/costShow token usage statistics for the current session.
/doctorRun a health check on your Claude Code installation.
/exitGracefully exit the Claude Code REPL session.
/helpDisplay all available commands with descriptions.
/hooksOpen interactive menu to manage hook configurations.
/initInitialize your project by creating a CLAUDE.md file.
/mcpManage Model Context Protocol server connections.
/memoryOpen CLAUDE.md memory files for editing. Changes persist across sessions.
/modelSwitch the active AI model. Accepts aliases (sonnet, opus, haiku).
/permissionsView or update tool permission settings.
/resumeResume a previous conversation by ID or name.
/reviewRequest a code review of recent changes.
/rewindOpen the rewind menu to restore code and/or conversation to a prior checkpoint.
/security-reviewRun a comprehensive security review of all pending changes.
/statusShow version, current model, account details, and connectivity status.
/todosList current todo items Claude has tracked during the conversation.
/vimToggle vim editing mode for the input prompt.

2. CLI Commands (Shell)

Command Description
claudeStart 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 -cContinue the most recent conversation in the current directory.
claude updateUpdate Claude Code to the latest version from npm.
claude mcpConfigure MCP servers from the command line.

3. CLI Flags

Flag Description
--add-dirAdd additional working directories for Claude to access.
--allowedToolsWhitelist specific tools to allow without prompting.
--continue, -cLoad the most recent conversation in the current directory.
--dangerously-skip-permissionsSkip all permission prompts. Use with extreme caution.
--max-turns NLimit the number of agentic turns in non-interactive mode.
--model nameSet the model. Accepts aliases (sonnet, opus, haiku).
--output-format fmtOutput format in print mode: text, json, stream-json.
--print, -pRun in non-interactive print mode. Process the prompt, output result, and exit.
--resume id, -r idResume a specific conversation by its session ID.
--verboseEnable verbose logging: full turn-by-turn output and tool usage details.
--version, -vPrint the installed Claude Code version number.

4. Keyboard Shortcuts

Shortcut Description
Ctrl+CCancel current input or active generation.
Ctrl+DExit the Claude Code session (EOF signal).
Ctrl+LClear the terminal screen. Conversation history is preserved.
Ctrl+RReverse-search command history interactively.
Ctrl+BMove the current bash command to background execution.
Esc + EscOpen the Rewind menu to restore code/conversation to a previous checkpoint.
Shift+Tab / Alt+MCycle through permission modes: Normal → Auto-Accept → Plan Mode.

5. Quick Command Prefixes

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.
Gemini CLI Commands

Gemini CLI - Complete Command Reference

Source: geminicli.com/docs • Generated February 14, 2026

1. Built-in Slash Commands

Available in every interactive session. Type /help to list them. The ? prefix is an alias for /.

Command Description
/aboutShow version info.
/authOpen a dialog to change the authentication method.
/chatSave and resume conversation history. Sub-commands: save, resume, list, delete, share.
/clearClear the terminal screen including visible session history. Also Ctrl+L.
/compressReplace the entire chat context with a summary.
/directory (or /dir)Manage workspace directories. Sub-commands: add <path>, show.
/extensionsList all active extensions in the current session.
/helpDisplay help information including all available commands.
/hooksManage hooks that intercept CLI behavior at lifecycle events.
/ideManage IDE integration. Sub-commands: enable, disable, install, status.
/initAnalyze the current directory and generate a tailored GEMINI.md context file.
/mcpManage MCP server connections. Sub-commands: list, auth, refresh.
/memoryManage instructional context from GEMINI.md files. Sub-commands: add, show, list, refresh.
/modelOpen 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.
/resumeBrowse and resume previous conversation sessions.
/settingsOpen the interactive settings editor.
/skillsManage Agent Skills. Sub-commands: list, enable, disable, reload.
/statsDisplay detailed statistics: token usage, cached token savings, session duration.
/themeOpen a dialog to change the visual theme.
/tools [desc]List currently available tools. Also toggled with Ctrl+T.
/vimToggle vim mode for the input prompt. Persists across sessions.

2. CLI Commands (Shell)

Command Description
geminiStart 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 updateUpdate 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.

3. CLI Flags

Flag Description
--model, -mSet the Gemini model. Aliases: auto, pro, flash, flash-lite.
--sandbox, -sRun tools in a sandboxed Docker/Podman environment.
--approval-modeSet approval mode: default, auto_edit, yolo.
--debug, -dRun in debug mode with verbose logging.
--resume, -rResume a previous session. Use "latest" for the most recent.
--output-format, -oOutput format: text, json, stream-json.
--allowed-toolsTools allowed to run without confirmation.
--version, -vShow the installed Gemini CLI version number and exit.

4. Keyboard Shortcuts

Shortcut Description
Ctrl+CCancel current generation or input. Press twice to exit Gemini CLI.
Ctrl+LClear the terminal screen (same as /clear).
Ctrl+RSearch through prompt history interactively.
Ctrl+TToggle between showing and hiding MCP tool descriptions.
Shift+TabCycle through approval modes: Default → Plan → Auto-Edit.
Shift+YActivate YOLO / auto-edit mode.
Up / Down arrowsNavigate through prompt history.
? (empty prompt)Toggle the shortcuts panel above the input.

5. Quick Command Prefixes

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.