Skip to content
XXD VPS Guide
中文
  1. How-to
  2. AI tools
  3. Install Codex

Install Codex

About 5 minutesFor: People with a paid ChatGPT planMain guide step 2: Set up an AI assistant

What you need

  • A paid ChatGPT plan (Plus, Pro, Business, Edu, Enterprise…), or an API key;
  • to be in a country or region OpenAI supports;
  • Windows: WSL installed first.

1. Install

Open the terminal (Windows: Ubuntu in WSL), paste this command and press Enter:

Install Codex (Mac, Linux, WSL)
curl -fsSL https://chatgpt.com/codex/install.sh | sh

With Homebrew on a Mac you can also run brew install --cask codex. After installing, close the terminal and open it again, and check:

Check the version
codex --version

2. Sign in

Type codex and press Enter, choose Sign in with ChatGPT, then log in to your ChatGPT account in the browser and authorize.

You should see

The terminal shows the Codex chat interface, ready for a question.

Stuck?

codex: command not found?

Reopen the terminal and try again. Still failing? See the latest instructions in the official Codex repository.

How do I sign in on a server or without a browser?

The sign-in screen offers a device-code option: enter the code it shows in a browser on another device.

This setup is for you and your family only. Follow local laws and each site's and AI tool's terms of use. Open source (MIT) — code and feedback on GitHub.