Overview of CLI tools
CLI is a command-line tool, not a specific software. Claude Code, Codex CLI, Gemini CLI, OpenClaw, and OpenCode all belong to this category: you input natural language in the terminal, and they can read projects, interpret code, generate files, run commands, or help you complete development tasks.
What is CLI and what is it used for
CLI tools are more powerful than ordinary chat software and are also easier to misuse. When beginners configure them for the first time, run them only in test projects, and let them "only interpret, not modify, and not execute commands".
What to prepare first
| Preparation items | Description | Why it is important |
|---|---|---|
| Terminal | Windows uses PowerShell, macOS / Linux uses Terminal | CLI runs entirely in the terminal |
| The tool itself | First install Claude Code, Codex CLI, Gemini CLI, OpenClaw, or OpenCode | The configuration file only takes effect for installed tools |
| Key / Login Method | It could be an official login, API Key, OAuth, or an AI provider Key | Different CLI authentication methods are different |
| Base URL | Only needed when going through an AI provider or agent | The address suffix may vary with different protocols, so you cannot just change the domain name. |
| Test Project | Create a new empty folder or copy the project. | Avoid messing up a real project during the first configuration |
Standalone page entry
How to choose the page to view
| What do you want to do now | Recommended to open | Why |
|---|---|---|
| Only want to uniformly switch multiple CLI providers | CC-Switch general steps | CC-Switch is more suitable for centralized management of Providers, then distributing to tools like Claude, Codex, Gemini, etc. |
| Only configure Claude Code | Claude Code Configuration | For Claude Code, focus on Anthropic / Claude related Key, Base URL, model name, and settings.json |
| Only configure Codex CLI | Codex configuration | For Codex, focus on config.toml, OpenAI compatible Providers, model name, and environment variables |
| Only configure Gemini CLI | Gemini configuration | Gemini's login method, Key, and Vertex / Gemini interfaces are different from OpenAI compatible interfaces |
| Use OpenClaw / OpenCode | OpenClaw / OpenCode | The Provider field for these two tools may change with versions, you should refer to the corresponding page and official documentation |
Risks to note before configuration
| Risks | Where they are likely to occur | Recommendations |
|---|---|---|
| Tools can read project files | Claude Code, Codex, Gemini, OpenClaw, OpenCode | Run in the test directory the first time, do not directly open real production projects |
| Models can execute or suggest commands | All code CLIs | Enable confirmation mode first, and check each action carefully when encountering delete, move, install, upload, etc. |
| Configuration items override each other | System environment variables, project configuration, user configuration, CC-Switch | When the configuration does not take effect, check the priority first, do not modify multiple places at the same time |
| Mixed protocol usage | OpenAI, Claude, Gemini, Vertex, AI provider compatible interfaces | Fill in the tool page according to whichever interface the provider backend provides |
| Copied someone else's example | Third-party tutorials, screenshots, old documents | The URL, Key, and model name in the example must be replaced with your own provider backend content |
How to do the first security test
After configuration is complete, do not immediately let the CLI modify the real project. First, create an empty directory, put a simple test file in it, and let the tool only read and interpret, without modifying the file.
Read only the current directory first. Tell me which files are here. Do not modify any files, run any commands, or install any dependencies. If this step cannot return normally, then go to the corresponding problem troubleshooting page. Do not let the CLI automatically process the real project before confirming the configuration is successful.
