Path D: Codex in the terminal

Video 2 min 21 secAbout 20 min to do
Not startedSession 4 of 5, 0 done · Next up: Path E: Grok Build in the terminal (the only surface today)

Chapters

Shortcuts
  • Space or Kplay and pause
  • Left and Rightback and forward 5 seconds
  • J and Lback and forward 10 seconds
  • , and .step one frame
  • Shift + , and .slower and faster
  • 0 to 9jump to that tenth
  • Ffullscreen
  • Mmute
  • Ccaptions

Shortcuts stay out of the way while you are typing a note.

Lesson notes and steps

The written version of this session, with the commands and templates to copy.

Optional alternative. This academy teaches Claude Code by default. Take this path if you already work in ChatGPT and would rather not add a second subscription.

The Codex CLI is OpenAI's coding agent as a command you type. One line to install, one word to start, and it runs on the ChatGPT account you already have. If you pay for ChatGPT and you want the terminal workflow that the rest of this academy assumes, this is your path.

Same three first prompts as every other walkthrough in this course, on purpose.

What this is, and who it suits

Codex in the terminal: you cd into a folder, type codex, and hold a conversation with an agent that can read, write, and run things in that folder.

Suits you if: you already pay for ChatGPT, you want the fastest surface, and you expect to put the agent inside scripts and scheduled jobs later. Not for you if a command prompt is still intimidating. Do Path C first, in the desktop app, then come back here when the magic has worn off a little.

What you will use

  • A Mac or a Windows PC
  • A ChatGPT account. The pricing page lists Codex across Free, Go, Plus, Pro, Business, and Enterprise and Edu, with usage rising by plan (learn.chatgpt.com/docs/pricing)

Step 1: Open the right window

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

Windows: click Start, type PowerShell, and open Windows PowerShell, not Command Prompt. The prompt should read PS C:\Users\.... If there is no PS in front, you are in Command Prompt; close it and open PowerShell.

Leave the window open.

Step 2: Read before you paste

Caution: a line pasted into a terminal can touch your whole computer. One check, under a minute, every single time.

Do this now: read the install line for your system in Step 3, and check the domain with your own eyes: the Codex installer is served from chatgpt.com. Every install command in this academy points at claude.ai, chatgpt.com, or x.ai. Anything else, stop and ask. This is the one command you run before Codex exists to explain itself; every command after this one runs through Codex, and it asks before it writes or changes anything. Keep those permission prompts on, read what it is about to do, and ask Codex itself if a step is ever unclear.

Step 3: Install the Codex CLI

Copy only the line for your system. Paste it, press Enter, wait for it to finish.

macOS and Linux:

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

Windows PowerShell:

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

Two documented alternatives if you already use a package manager:

npm install -g @openai/codex
brew install --cask codex

All four are from learn.chatgpt.com/docs/codex/cli.

Now close the terminal window completely and open a fresh one. Then check the command exists:

codex --version

If a brand new window still says the command is not found, the installer put Codex somewhere your PATH does not look. That is the moment to go back to the install page rather than improvise.

Step 4: Sign in

Two documented routes.

The simple one: run codex in a project folder, and "the first time you run Codex, choose Sign in with ChatGPT or another available sign-in method." Your browser opens, you approve, you come back.

The explicit one, which does the same thing on demand:

codex login

"Run codex login, then complete the browser flow."

If you would rather bill a developer account per token instead of using your subscription, the documented API-key route is:

printenv OPENAI_API_KEY | codex login --with-api-key

Source: learn.chatgpt.com/docs/auth

Caution: those two are not the same bill. Signing in with ChatGPT uses your plan's included usage. An API key is charged on API pricing, separately. Choose on purpose, not by accident.

To clear stored credentials later: codex logout.

Step 5: Your first project folder

One small folder, nothing you would miss.

Mac:

mkdir ~/Desktop/pick-test
cd ~/Desktop/pick-test

Windows:

mkdir $HOME\Desktop\pick-test
cd $HOME\Desktop\pick-test

Then start it:

codex

Caution: the folder you are standing in is the folder the agent works in. Never start your first session in your home directory.

Step 6: The first three prompts

One at a time, Enter after each. Approve the file write when it asks. Identical to every other path in this course.

Prompt 1

Explain what is in this folder in plain English. Do not change anything.

Prompt 2

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

Prompt 3

Add a second line to hello.txt that says: I can change files too. Show me the change before you save it.

Open pick-test in Finder or File Explorer. hello.txt is there with two lines. You typed neither.

Step 7: Voice input

Straight answer: OpenAI's Codex CLI page does not document voice input, and this academy will not tell you a feature exists because it would be convenient if it did.

What is documented is ChatGPT Voice in the desktop app, which covers "Chat, Work, and Codex" there (learn.chatgpt.com/docs/features/voice). So if speaking to your agent is the thing you actually want, the Codex path to it is the desktop app, Path C. In the terminal, Claude Code is the one with a documented dictation command today, covered in Path B.

Check the CLI page yourself before you plan around this. Tools move fast: learn.chatgpt.com/docs/codex/cli

Step 8: Where your files live

  • Your personal defaults: ~/.codex/config.toml
  • Per-project settings: .codex/config.toml in the repository, loaded only for trusted projects
  • Named profiles: ~/.codex/profile-name.config.toml
  • System-wide, on Unix: /etc/codex/config.toml
  • Credentials: ~/.codex/auth.json, or your operating system's credential store, depending on your settings

Sources: learn.chatgpt.com/docs/config-file/config-basic and learn.chatgpt.com/docs/auth

This is the same ~/.codex the desktop app uses, which is why moving between Path C and Path D costs almost nothing.

Step 9: How to update

The documented update is the install command again. Re-run the line for your system from Step 3 and it updates in place.

If you installed through a package manager:

npm install -g @openai/codex
brew upgrade --cask codex

Source: learn.chatgpt.com/docs/codex/cli

Step 10: How to uninstall

Honest answer: the Codex CLI page does not publish an uninstall procedure, so there is no official command for this academy to hand you.

What you can do without guessing: remove it through whichever package manager you installed it with, then clear the account and configuration, which are documented. codex logout clears stored credentials, and ~/.codex is the folder holding your config and profiles. If an official uninstall step is published later, follow that over this paragraph.

Step 11: When to switch to the other surface

Switch to the ChatGPT desktop app when:

  • You want to talk to it. Voice is documented there, not here.
  • You want to review a large change visually instead of in a scrolling terminal.
  • You want your ordinary ChatGPT use and your coding agent in one window.

The account, the sign-in, and ~/.codex are shared, so switching is a download, not a migration. Path C in this course is that walkthrough.

You are done when...

A fresh terminal, cd into pick-test, codex, and a reply. hello.txt on disk with two lines. You know which of the two sign-in routes you used and which bill it lands on.


Template included: Members get a one-page Codex CLI card: all four documented install commands, the verify-before-you-paste check, both sign-in routes and what each one bills, the three comparison prompts, the config file paths, and the update commands. Find it in your member dashboard under Templates.

Want it done for you?

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

Implementation engagements from $2,500
Narration transcript (what the video says)

The Codex CLI is OpenAI's coding agent as a command you type. One line to install, one word to start, and it runs on the ChatGPT account you already have. Same three first prompts as every other path in this course.

A line pasted into a terminal can touch your whole computer. Read it first, then check the domain yourself. The Codex installer is served from chatgpt dot com, and nowhere else. From there on, Codex asks before it writes or changes anything, so keep that permission prompt on.

Copy only the line for your system, paste it, press Enter, and wait. When it finishes, close the terminal completely and open a brand new one. Then check the command exists, because a stale window is the usual reason it does not.

Two documented routes, and they are not the same bill. Sign in with ChatGPT uses your plan's included usage. An API key is charged on API pricing, per token, separately from your subscription. Choose on purpose, not by accident.

One small folder, nothing you would miss. Make it, go there, and start Codex from inside it. The folder you are standing in is the folder the agent works in, so never run your first session from your home directory.

Three prompts, one at a time, approving the file write when it asks. Explain this folder. Create a file. Then change it and show the change first. Identical to every other path here, so the comparison is honest.

Open pick-test in Finder or File Explorer. hello dot t x t is there with two lines in it, and you typed neither of them. Same file, same folder, same sentence as the other four paths. Now you can actually compare them.

Straight answer on voice: none is documented for the Codex CLI, and this academy will not invent one. Voice is documented in the desktop app. Your config lives in the dot codex folder, and the update is the install command again.

You have the same Codex, the same account, and the same config folder as the desktop path, in the surface that scripts. Next session is Grok Build, which has exactly one surface today, and the lesson says so rather than inventing more.

The course this session belongs to

What you will build in Pick Your Agent

One full walkthrough per tool and per surface, so you install the right one once

5 sessions, 12 min of video, about 1.7 hours to do, 5 free.

  1. 01Path A: Claude Code in the desktop appFree2:20 video
  2. 02Path B: Claude Code in the terminalFree2:17 video
  3. 03Path C: Codex in the ChatGPT desktop appFree2:17 video
  4. 04Path D: Codex in the terminalFree2:21 videoYou are here
  5. 05Path E: Grok Build in the terminal (the only surface today)Free2:15 video

Cancel anytime from your account page, and a 14-day money back on your first month that you trigger yourself. Prefer to pay once? Lifetime All-Access is $399.

By purchasing you agree to the Terms and the Refund Policy.

Members share their results from this session in the community. See what is included.