OpenAI Codexcodex-cli 0.154 · macOS, Linux, WSL, Windows
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
26 small wins to finish your pathNext lesson

What you are going to build

Codex is OpenAI's coding agent. It reads your repository, writes code, runs your commands, and does all of it inside a boundary you set. This course is about that boundary first, because everything else makes sense once you can see it.

Most tutorials open by asking Codex to build something. That part is easy and it is not where people get stuck. People get stuck when a command is refused, when the agent asks for approval on something harmless, or when they turn the limits off to make the refusals stop and then cannot say what the agent may now do.

The first thing you will see

Codex can run a command under the same sandbox the agent gets, without calling a model at all. That means the rules can be demonstrated rather than described, and this is a real run, on a Mac, asking for the read-only profile by name:

bash
codex sandbox -P :read-only -- python3 -c "open('a.txt','w').write('x')"
Captured from a real run
PermissionError: [Errno 1] Operation not permitted: 'a.txt'

A read-only profile refused a write in the project's own folder. Not outside it, inside it. That single line explains more about working with Codex than a page of prose, and lesson 3 does the same thing for every profile.

What you will have by the end

WhatWhy it is there
A chosen permission profileSo you know what the agent may do before it does it
An AGENTS.mdSo the rules of this project are not retyped every session
RulesSo the few commands that need to leave the sandbox can, and nothing else
A skill and a pluginSo a procedure is followed the same way by everyone
A hookSo one rule is code rather than a request
A review in CISo work nobody watched still gets read

How this course is written

Terminal blocks are captured from real runs of codex-cli 0.154. Everything in part 1 runs with no account at all, because the sandbox, the help output and the doctor do not call a model.

Where a lesson needs a model, there is no invented transcript. The build machine is signed in and still cannot run Codex models, which is a common situation worth seeing rather than hiding:

bash
codex exec "In one sentence, what does this project do?"
Captured from a real run
ERROR: {"type":"error","status":400,"error":{"type":"invalid_request_error",
 "message":"The 'gpt-5.4-mini' model is not supported when using Codex with a
 ChatGPT account."}}

Signing in is not the same as having access to the models. Those lessons show the command and describe the behaviour, and the page says which is which.

The one runnable lesson
One lesson does run on this page: hooks. A Codex hook is a program that reads JSON on standard input and prints a decision, so the same file that would run on your machine runs in the panel beside the reading.
Try it yourself
  • Install the CLI now, so lesson 1 is a check rather than a wait.
  • Pick the repository you will use for this course. A small one you know well.
Back toAll frameworks

Every expert started right here.