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 | shWith 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 --version2. Sign in
Type codex and press Enter, choose Sign in with ChatGPT, then log in to your ChatGPT account in the browser and authorize.
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.