Codex CLI Setup: 12 Steps, 60 Min [2026] OpenAI refreshed Codex CLI on September 29, 2026, adding voice-controlled task steering, an /agents view for delegating and tracking tasks, better prompt editing, session resumption, worktree workflows and a cleaner terminal interface, and the open-source terminal agent remains actively maintained as of November 14, 2026. OpenAI also removed GPT-5.4 and GPT-5.4 mini from Codex for ChatGPT-account users, pointing them to GPT-5.6 Terra and GPT-5.6 Luna, while API-key users were unaffected; in late October OpenAI added GPT-5-Codex-Mini, which Codex CLI offers automatically once a user reaches 90% of the five-hour usage limit. The CLI itself is free to install, with costs paid through a ChatGPT plan or API pricing. OpenAI has refreshed Codex CLI with a new look https://community.openai.com/t/major-codex-cli-refresh-with-a-new-look-and-powerful-new-capabilities/1402400/4 and a broader feature set, and the terminal agent is still open source and actively maintained as of November 14, 2026. The program costs nothing to install. You pay through the ChatGPT plan you sign in with, or through API pricing if you hand it a key. That split decides most of the setup choices you will make below. Codex CLI is also moving fast. Models changed, plans changed and the interface changed within the past few months, which is why tutorials from early 2026 now point readers at retired models. A quick look at how Claude Code, Codex CLI and OpenCode updated within four days https://shattered.io/claude-code-codex-cli-opencode-update-4-days-2026/ shows the pace. The steps here avoid hard-coding anything that expires and tell you where to check the live value instead. By the end you will have Codex CLI installed and verified, a small Python project with an AGENTS.md rule file, sandbox and approval settings you chose on purpose, an MCP server wired in, a local open-source model running through Ollama as a fallback, a non-interactive codex exec check in CI, and a worktree workflow for parallel tasks. Plan on about 60 minutes. Don't miss new tech stories on Google Add Shattered once in the Google app and our stories show up in your news suggestions. Add now https://www.google.com/preferences/source?hl=en&q=https%3A%2F%2Fshattered.io%2F What Codex CLI Is Today and Why It Counts as an Open-Source Assistant Codex CLI is the terminal front end of OpenAI’s Codex product family. Codex also runs in a desktop app, an IDE extension, on the web and as Codex Cloud, and OpenAI’s current documentation uses those names as distinct but connected products. The CLI is the piece that edits files in your working directory, runs your tests and shows you a diff before anything lands. The agent loop is simple to describe. You type a task. The model reads the files it needs, proposes edits, runs shell commands through a sandbox, reads the output and tries again until the task passes or it gives up. Every command and every edit shows up in your terminal, and you can interrupt at any point. Knowing that loop explains most of the settings in this tutorial, because each one controls a step in it. Open source here describes the agent program, not the model behind it. The CLI code is public, so you can read how it builds prompts, how the sandbox wraps shell commands and where it sends your data. The default hosted models are not open weights. That distinction matters for the “open-source AI coding assistant” label, and it is why this tutorial includes a step that points the same CLI at a local open-weight model through Ollama. You get the same interface with a model you can run offline. For readers choosing between agents, the coding tools section https://shattered.io/category/software/ covers the neighbors in this space. The practical difference is that Codex CLI sits closest to a vendor’s own models, while tools like OpenCode, Goose and Aider are model-agnostic from day one. What changed in the last three months OpenAI announced a refreshed Codex CLI on September 29, 2026. The refresh added voice-controlled task steering, an /agents view for delegating and tracking tasks, better prompt editing, session resumption, worktree workflows and a cleaner terminal interface. Documentation dated November 9 also lists multi-agent tools, usage statistics and improved terminal rendering. Model access shifted too. OpenAI removed GPT-5.4 and GPT-5.4 mini from Codex for people signed in with a ChatGPT account and pointed them to GPT-5.6 Terra and GPT-5.6 Luna. API-key users were not affected by that change. In late October, OpenAI added GPT-5-Codex-Mini, a smaller and cheaper model that Codex CLI offers automatically once you reach 90% of your five-hour usage limit. OpenAI says it stretches usage up to four times within a ChatGPT subscription. On the newest-model question, OpenAI’s current Work and Codex documentation names GPT-6.1 Sol as the newest option, and it was rolling out to eligible paid plans on November 14. The same pages also list GPT-6 Sol, GPT-6 Luna and GPT-6 Astra, with availability depending on plan, workspace settings and rollout. GPT-5.3-Codex, launched February 5, 2026, is no longer the newest model in the line, so treat it as a predecessor. What You Need Before You Start The list is short, and none of it is exotic. You need a terminal, a package manager that can install a Node-based CLI, a Git repository to work in and an account that can pay for model usage. The table lists minimums and the command that proves each one. | Requirement | Minimum | How to check | |---|---|---| | Operating system | macOS, Linux, or Windows with WSL 2 | uname -a | | Node.js | 22 LTS or newer | node --version | | Git | 2.40 or newer worktree support | git --version | | Python practice project | Not listed | python3 --version | | Codex CLI | Latest release. Reportedly 0.153.0 or newer for GPT-6 Astra | codex --version | | Ollama step 10 only | A current build with tool-calling models | ollama --version | | Account | A ChatGPT plan with Codex access, or an API key | Sign-in test in step 3 | Trackers disagree on the newest CLI build number. One tracker listed 0.169.0 on November 14, while OpenAI’s documentation names 0.153.0 only as the floor for GPT-6 Astra. Ignore both and trust whatever codex --version prints after you install. If a model you expect is missing from the picker, an old CLI is the first suspect. Editor choice is open. The 2025 Stack Overflow survey reported that “Visual Studio Code was used regularly by 75.9% of all survey respondents,” according to Stack Overflow’s technology results https://survey.stackoverflow.co/2025/technology , so many readers will pair the terminal agent with the Codex IDE extension. Nothing below requires an editor. Everything runs in a shell. Teams weighing several agents at once should read the team pilot approach to ranking AI coding assistants https://shattered.io/best-ai-coding-assistants-team-pilot-12-steps-2026/ before standardizing on one. A pilot with a shared task list catches cost and quality differences that a single afternoon of poking does not. Steps 1 to 3: Install Codex CLI, Verify It and Sign In Step 1. Confirm Node and Git. Run the version checks from the table. If Node reports anything older than 22, upgrade through your usual manager nvm, fnm, Homebrew or your distribution before you continue. Old Node versions fail in confusing ways during the global install, and a clean runtime saves you a troubleshooting detour later. node --version git --version python3 --version Step 2. Install the CLI. The npm route works on every platform that has Node. macOS users can also use Homebrew. Pick one route and stick with it, because two installs on one PATH produce the classic “I updated but the version did not change” problem. npm macOS, Linux, WSL 2 npm install -g @openai/codex or Homebrew on macOS brew install --cask codex confirm which binary your shell will run which codex codex --version You should see a version string and a path under your npm prefix or Homebrew directory. A typical result looks like this, with your own build number in place of the placeholder. /home/you/.nvm/versions/node/v22/bin/codex codex-cli