Getting Started with the OpenAI Codex CLI on macOS
By the end of this article, you will have Codex CLI installed on a Mac, authenticated with ChatGPT or an API key, and running a small task inside a Git repository with an approval policy and Seatbelt sandbox you understand. Prerequisites You need macOS with an interactive terminal, Git, and either a ChatGPT account that can use Codex or an OpenAI API key. You should know basic shell commands and have a disposable directory where an agent may create files. In this article, the workspace is that disposable project directory. A Git repository is a directory whose files and history are tracked by Git. Codex CLI is an agentic coding tool: it can inspect files, edit them, and run local commands. An approval policy controls when Codex asks before acting; a sandbox is an operating-system boundary that limits what those commands can access. Seatbelt is macOS’s native sandboxing mechanism. ...