Setup guide

Provider setup guide

Browse setup steps and troubleshooting by tool.

Provider setup guide/Overview of CLI tools

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 itemsDescriptionWhy it is important
TerminalWindows uses PowerShell, macOS / Linux uses TerminalCLI runs entirely in the terminal
The tool itselfFirst install Claude Code, Codex CLI, Gemini CLI, OpenClaw, or OpenCodeThe configuration file only takes effect for installed tools
Key / Login MethodIt could be an official login, API Key, OAuth, or an AI provider KeyDifferent CLI authentication methods are different
Base URLOnly needed when going through an AI provider or agentThe address suffix may vary with different protocols, so you cannot just change the domain name.
Test ProjectCreate a new empty folder or copy the project.Avoid messing up a real project during the first configuration
The URLs in the AI provider documentation are usually its own examples. When you actually fill them in, you need to replace them with the API address and Key provided by your own provider; if it provides OpenAI, Claude, and Gemini interfaces separately, do not mix the three addresses together.

Standalone page entry

Claude Code Configuration Claude Code's Key, Base URL, model, and settings.json.
Codex CLI Configuration Config. toml, custom Providers, and testing methods for the Codex terminal tool.
Gemini CLI Configuration Notes on Google login, API Key, and AI provider for Gemini CLI.
OpenClaw Configuration The baseUrl and api fields of OpenClaw are configured in pairs.
OpenCode Configuration OpenCode's connection wizard, configuration file location, and manual configuration considerations.

How to choose the page to view

What do you want to do nowRecommended to openWhy
Only want to uniformly switch multiple CLI providersCC-Switch general stepsCC-Switch is more suitable for centralized management of Providers, then distributing to tools like Claude, Codex, Gemini, etc.
Only configure Claude CodeClaude Code ConfigurationFor Claude Code, focus on Anthropic / Claude related Key, Base URL, model name, and settings.json
Only configure Codex CLICodex configurationFor Codex, focus on config.toml, OpenAI compatible Providers, model name, and environment variables
Only configure Gemini CLIGemini configurationGemini's login method, Key, and Vertex / Gemini interfaces are different from OpenAI compatible interfaces
Use OpenClaw / OpenCodeOpenClaw / OpenCodeThe 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

RisksWhere they are likely to occurRecommendations
Tools can read project filesClaude Code, Codex, Gemini, OpenClaw, OpenCodeRun in the test directory the first time, do not directly open real production projects
Models can execute or suggest commandsAll code CLIsEnable confirmation mode first, and check each action carefully when encountering delete, move, install, upload, etc.
Configuration items override each otherSystem environment variables, project configuration, user configuration, CC-SwitchWhen the configuration does not take effect, check the priority first, do not modify multiple places at the same time
Mixed protocol usageOpenAI, Claude, Gemini, Vertex, AI provider compatible interfacesFill in the tool page according to whichever interface the provider backend provides
Copied someone else's exampleThird-party tutorials, screenshots, old documentsThe 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.

Safety test commands that can be given to the CLI
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.