The three mainstream coding tools right now are Codex, Claude Code, and Gemini. Claude Code is very capable overall and is my primary coding tool, but its account bans are heavy and it's quite unfriendly for users in China—the barrier to entry is higher, and you need to find a reliable channel.
Gemini currently has a clear edge in front-end design. Codex is widely considered excellent at code review because its analysis is rigorous—though that also means it can be slower. But it has a lower barrier to entry: with ChatGPT, as long as you have a paid membership you can use Codex directly, and in practice its speed has been improving.
What Is Codex?
It's an official AI coding tool from OpenAI—think of it as a terminal version of ChatGPT, built specifically for writing code.
Four ways to use it:
- Codex CLI: write code by chatting directly in the terminal
- Cursor extension: use the Codex model inside the Cursor editor
- VS Code extension: chat in a sidebar inside VS Code
- Opencode: use the Codex model inside the Opencode client
Why we recommend it:
- Use it directly with a Plus membership ($20/month)—no separate API purchase needed
- More stable than Claude, and smoother to use in China
- The Codex experience keeps getting better, and speed has improved
Prerequisites:
- You need a ChatGPT Plus/Pro/Team membership (free accounts won't work)
- You need a VPN setup
1. Getting Ready
1.1 Sign Up for a ChatGPT Account
If you already have an account, skip this step. Official sign-up page: https://chat.openai.com/
Domestic email addresses work (QQ, 163, Outlook are all fine), no overseas phone number required, but you'll need a VPN setup.
1.2 Subscribe to a Plus Membership (Required)
Codex is only available to paying users—free accounts can't use it. Plus ($20/month), Pro ($200/month), or Team all work.
However, ChatGPT requires an overseas card for payment, and domestic Visa cards don't work, which is unfriendly to users in China. There may be some workarounds online, but if you want to keep it simple, find a top-up service.
I use payforplus.com, which supports WeChat and credits right after payment. If you have another channel that works, that's fine too.
2. Codex CLI (Command Line)
2.1 Install the Node.js Environment (Prerequisite)
Codex CLI runs on Node.js and requires Node.js version 22 or higher.
First, check whether it's already installed: open Terminal (Mac) or PowerShell (Windows) and run:
node -vIf it shows version ≥ 22, skip the install and go straight to 2.2. If the version is below 22 or the command isn't found, download and install from https://nodejs.org/.
2.2 Install Codex CLI
Mac users:
npm install -g @openai/codex@latestIf you hit a permissions issue, use sudo:
sudo npm install -g @openai/codex@latestIf your network in China is slow, use a mirror to speed it up:
npm install -g @openai/codex@latest --registry=https://registry.npmmirror.comWindows users:
Right-click the Start menu → choose Windows PowerShell (Administrator mode), then run:
npm install -g @openai/codex@latestVerify the installation succeeded:
codex --versionIf you see a version number, the installation succeeded.
2.3 Log In and Authorize
Type codex in the terminal and a login prompt will appear. Choose to log in via the official site, which redirects you to sign in with your ChatGPT account (the one with the membership). Once authorized, you're ready to go.
2.4 Common CLI Commands
| Command | Description |
|---|---|
codex | Start interactive mode |
/quit or Ctrl+C | Exit Codex |
/model | Switch models |
/clear | Clear conversation history |
/compact | Compact the context |
/review | Review code changes |
3. VS Code Extension
If you're not comfortable with the command line, the VS Code extension is recommended—it's more intuitive.
- Open VS Code
- Search for
Codexin the Extensions marketplace on the left - Find OpenAI's official Codex extension and click Install
- Click the Codex icon and authorize by logging in with your ChatGPT Plus account
4. Cursor Integration
Cursor is one of the most popular AI coding editors right now. It comes with the Claude model built in, but you can also switch to the Codex model.
Just like with VS Code, search for the Codex extension in Cursor's extension marketplace and install it.
5. Opencode Integration
Codex supports OpenCode, letting you use your Codex subscription directly inside Opencode.
Download the Opencode client: https://opencode.ai/download
After installing, type the /model command in the chat box to select a model, then click "Connect OpenAI" to log in with your ChatGPT account.
6. FAQ
| Problem | Solution |
|---|---|
| npm ERR during installation | Upgrade to Node 22+ |
| Stuck on "thinking" after login | Enable a global proxy |
| Credit card payment declined | Use a top-up service (e.g. payforplus.com) |
7. Summary
With a ChatGPT Plus membership you can use Codex CLI directly. Its reasoning is thorough, it's slower than Claude Code but stable, has a low barrier to entry and high tolerance—making it one of the best AI coding command-line tools to use in China right now.
I actually use several models these days: Gemini for front-end work, Claude Code for primary development, and Codex for code review. This keeps both code quality and productivity high.