OpenAI / Codex8 minLesson 9 of 60

Codex CLI: A Coding Agent in Your Terminal

Codex is OpenAI's coding agent that runs locally in your terminal. Like other coding agents it works in a loop: it reads your repo, proposes changes, runs commands, and checks results. The skills you learn here carry over to other agents almost one to one.

The basic flow

zsh - my-app
$codex
> add pagination to the /posts endpoint, default 20 per page
✓ proposed edits to routes/posts.ts and a new test
$# review the diff, approve, run the suite
$

Approval and sandboxing

A terminal agent can run real commands, so control matters. Codex lets you choose how much it can do on its own versus what needs your approval, and it can work inside a sandbox. Start cautious, then loosen the reins as you build trust.

Review before you approve
Any agent that can run shell commands can do real damage if you rubber-stamp it. Read the diff and the command list before approving, especially for anything that deletes, pushes, or touches credentials.
OpenAI Codex (getting started)Official, free docs for installing and running the Codex CLI coding agent.github.com/openai/codex
Finished this lesson? Mark it read to track your progress.