Installation: what you get
One install, and a command with more subcommands than you will use in a year. This lesson is about the handful that matter.
npm i -g @openai/codex
codex --versioncodex-cli 0.154.0
That is the terminal version. Codex is also an IDE extension, a desktop app and a cloud service, and lesson 2 is about which is which. The CLI is the one that shows you what is happening, which makes it the right one to learn on.
The commands worth knowing on day one
codex --helpCommands: exec Run Codex non-interactively [aliases: e] review Run a code review non-interactively login Manage login mcp Manage external MCP servers for Codex plugin Manage Codex plugins doctor Diagnose local Codex installation, config, auth, and runtime health sandbox Run commands within a Codex-provided sandbox resume Resume a previous interactive session apply Apply the latest diff produced by Codex agent as a `git apply`
That is the real list, trimmed. Running codex with no subcommand starts the interactive session, which is where most work happens. The rest of this course is mostly about sandbox, exec, review, mcp and plugin.
Checking the install
doctor is the first thing to run when anything is odd, and it is worth running once now so the output is familiar later.
codex doctorCodex Doctor v0.154.0 · macos-aarch64
Environment
✓ system en-IN
✓ disk sufficient free disk space (116.6 GiB)
✓ security no supported endpoint protection detected
✓ runtime npm
version 0.154.0
✓ install consistentIt checks the machine, the install, the config and the login. When a colleague says Codex is behaving strangely, this is the output to ask for.
Signing in
codex login statusLogged in using ChatGPT
You can sign in with a ChatGPT account or with an API key. Which models you can then use depends on the plan behind that account, and lesson 0 showed what it looks like when the account cannot use them: the CLI is happy, the model call is refused.
- Run
codex doctorand read every line once. - Run
codex --helpand pick out the five commands you think you will use.
Little by little, you're building something great.