promptdojo_
chapter 33

intro to openai codex cli, a second tool in the kit

you know the claude cli. the openai codex cli does the same job, an ai working in your terminal on your real files, with a different company behind it. this chapter installs it, signs you in, and runs your first command. most of what you already know carries straight over, so this chapter is mostly about what is different and when to reach for which.

3 lessons · 23 steps · 45 XP

A second tool, on purpose

You just learned the Claude CLI. Now you're going to learn a second one, the OpenAI Codex CLI, and it's worth being clear up front about why.

This is not a contest. The Codex CLI does the same job as the Claude CLI: an AI that works in your terminal, sees your files, and changes them with your permission. Two companies, OpenAI and Anthropic, each built their own version of this idea. They're more alike than different.

You're learning both for one plain reason. A builder who only knows one tool is stuck with that tool's bad days, that company's pricing, that company's outages, and that company's blind spots. A builder who knows two can pick the better fit for the job in front of them, get a second opinion when one tool is stuck, and never be trapped. Knowing two tools is not twice the work. The second one is mostly the first one again.

Most of this you already know

Because you did the Claude CLI chapter, this one moves faster. The shape is identical:

  • It installs into the terminal you already set up.
  • You sign in with an account, through a browser, no API key needed.
  • You start it inside a folder, and that folder is its world.
  • It runs the same look-plan-act-check agent loop.
  • It asks permission before it changes things, and reading the line is still your job.

So this chapter spends its time on what's actually different: the install path, the sign-in account, the model behind it, and the real question of when to reach for Codex instead of Claude.

What you'll be able to do at the end

By the end of these three lessons you will have:

  • Installed the OpenAI Codex CLI and confirmed it runs.
  • Signed in with your ChatGPT account and understood the parallel to the Claude sign-in.
  • Run a first instruction and watched the same agent loop you already know.
  • A practical, honest answer to "Claude CLI or Codex CLI for this job," including how to use both together.

About thirty minutes. After this, your basic toolkit is complete, and the rest of the course is about building real things with it.