Library/Start Here·Session 6 of 7

Set up Codex (Mac and Windows)

20 minSaves $25/mo

Codex rides on your ChatGPT plan. If you already pay for ChatGPT Plus, Pro, Business, Edu, or Enterprise, you already have access. This lesson is the Codex-only walkthrough: confirm the plan, open the right window, check what you are about to paste before you paste it, install, and send a first prompt.

If you have not picked a tool yet, go back to the "Install your AI coding agent" lesson and choose between Codex, Claude Code, and Grok Build first. This lesson assumes you already picked Codex.

What you will use

  • A Mac (macOS 13 or later) or a Windows 10/11 PC
  • An internet connection
  • ChatGPT Plus, Pro, Business, Edu, or Enterprise (chatgpt.com)

Step 1: Confirm your plan and sign in

Go to chatgpt.com and sign in. Check Settings for your plan name. Codex needs Plus or higher: Plus, Pro, Business, Edu, or Enterprise. The free ChatGPT plan does not include Codex. If you are on the free plan, upgrade before you go further, then keep this browser tab open and signed in. The first time you run Codex on your machine, it opens this browser to finish login.

Step 2: Open Terminal (Mac) or PowerShell (Windows)

You are not installing an app from a store. You paste one line of text into a plain command window.

Mac: press Command + Space, type Terminal, press Enter. A window opens with a blinking cursor and a line starting with % or $.

Windows: click Start, type PowerShell, and open Windows PowerShell, not Command Prompt. The prompt should read PS C:\Users\.... If it just reads C:\Users\... with no PS in front, that is Command Prompt. Close it and open PowerShell instead.

Leave this window open for the next step.

Step 3: Verify before you run

Do not paste anything into a window that can touch your whole computer without checking it first. Two checks, both take under a minute.

First, copy the install line for your OS from Step 4 below and paste it into a second AI tool, in a chat window, not the terminal. Ask it plainly: "What does this command do?" Read the answer before you decide to run it.

Second, check the domain by eye. The Codex install command points at chatgpt.com. Every command in this academy points at one of exactly three domains: claude.ai, chatgpt.com, or x.ai. If something you were handed points anywhere else, stop and ask before you run it.

Step 4: Install Codex

Copy only the line for your operating system. Paste it into Terminal or PowerShell. Press Enter and wait for it to finish.

Mac:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

When it finishes, close the window completely and open a new one. Then check that Codex is on your PATH:

codex --version

If the new window says the command is not found, the installer likely added itself to PATH after this window had already opened. A fresh window almost always fixes it.

Step 5: Your first run

  1. Make a folder on your Desktop named ai-setup-test (Finder or File Explorer is fine).
  2. In your terminal, go there.

Mac:

cd ~/Desktop/ai-setup-test

Windows:

cd $HOME\Desktop\ai-setup-test
  1. Type codex and press Enter.
  2. The first launch opens your browser. Approve the login using the chatgpt.com account from Step 1. Return to the terminal.
  3. When you see a prompt, type this exactly and press Enter:

Create a file named hello.txt in this folder. The file should contain the sentence: I am set up.

  1. Approve the file write if Codex asks.

Open the folder in Finder or File Explorer. You should see hello.txt. Open it. You should see that sentence. You did not type the file by hand. Codex did.

Step 6: If it fails

  • Login page errors or Codex will not start: you are usually on the wrong plan. Confirm Plus or higher at chatgpt.com, then run codex again.
  • "Command not found" after installing: close every open terminal window and open a completely fresh one. PATH changes only take effect in new windows.

You are done when...

You can open a new terminal window, cd into any folder, run codex, and get a reply. The hello.txt file exists on your Desktop inside ai-setup-test and contains the sentence you asked for. That is a complete, working Codex setup on your machine.


Template included: Members get a one-page Codex setup card: both OS install commands, the two verify-before-you-run checks, and the exact first prompt to confirm it works. Find it in your member dashboard under Templates.

Want it done for you?

Short on time? Alliance Optimal will implement this end to end, wired into your stack, and hand you the keys.

Implementation engagements from $2,500
Set up Claude Code (Mac and Windows)Next session: Set up Grok Build (Mac and Windows)