Codex (OpenAI)
OpenAI · OpenAI open-source AI coding assistant that understands code, modifies projects, and runs tests in the terminal.
brew install --cask codex- 30-day installs
- 546,210
- #1 in App
- 1-year installs
- 1.4M
- Last 365 days
- Latest version
- 0.171.0
- Download size
- 176MB
- gz
- Release cadence
- Weekly
- 11 releases in 30 days
About
Codex for Mac is OpenAI’s coding assistant for a local repository. You install the CLI or use the desktop app, sign in with ChatGPT or an API key, and ask it to inspect code, edit files, and run tools already on the machine. Plan limits follow the ChatGPT plan or API rates. A sandbox and an approval policy decide what it may touch. This page covers install and sign-in, plans and usage, CLI versus desktop, permissions, three task examples, and common errors.
Install and sign in
On macOS, OpenAI documents three installs: brew install --cask codex, the script curl -fsSL https:/, and npm install -g @openai/. The same commands update an existing install (brew upgrade --cask codex, or rerun the script or npm command). Open a project directory and run codex. On launch, sign in with ChatGPT or another method on the authentication page. ChatGPT sign-in uses your subscription and workspace rules. An API key bills usage at API rates and follows the API organization’s data settings. Codex cloud requires ChatGPT sign-in. Create Git checkpoints before and after a task so you can revert. Related assistants are in the AI category.
Plans and usage
OpenAI’s Codex pricing page lists individual plans as Free at $0 per month, Go at $8 per month, Plus at $20 per month, and Pro from $100 per month, with a higher Pro tier also shown. Business is listed at $20 per user per month, and Enterprise is custom. Included speed, models, and surfaces differ by plan: Plus lists Codex on the web, in the CLI, in the IDE extension, and on iOS. ChatGPT Work and Codex share usage. Extra work can use ChatGPT credits. API-key sessions are charged from API token prices, which are separate from subscription allowances. Confirm the live table before you rely on a quota.
CLI and the desktop app
The CLI keeps the coding loop in a terminal: explain a repository, plan a change, edit files, and run local tools. codex exec runs the same agent from a script or CI job. A review command reports findings on uncommitted changes, a commit, or a base branch without modifying the working tree. The ChatGPT desktop app, the CLI, and the IDE extension can all sign in with ChatGPT or an API key for local work. The desktop app is the graphical surface; the CLI is the one this Homebrew cask installs. Skills and plugins package repeatable instructions. Other Mac developer utilities are in the Developer Workbench collection.
Permissions and the sandbox
By default the agent runs with network access off. Locally, an OS sandbox limits what it can touch, typically to the current workspace, and an approval policy decides when it must ask before it acts. codex --sandbox read-only --ask-for-approval on-request is the documented read-only setup. workspace-write can edit the workspace; danger-full-access is the broader mode and should stay exceptional. The old approval_policy = "untrusted" setting is retired and can stop the client from starting; OpenAI’s current read-only replacement is sandbox_mode = "read-only" with approval_policy = "on-request". Review every diff. Command-line tools for the same work sit in the Developer Tools category.
Three task examples
These prompts are the shapes OpenAI’s getting-started page describes, not measured benchmarks.
- Explain the project: from the repository root, run
codexand ask “Tell me about this project.” The agent reads the tree and answers in the terminal. - Make a focused change: ask for one edit, such as renaming a function and updating its call sites, then inspect the diff before you commit.
- Debug a failure: paste the command and the error, and ask Codex to find the cause. With
codex --imageyou can attach a screenshot of the error.
Requirements and common errors
OpenAI’s CLI page documents macOS and Linux via the installer, Homebrew, and npm, plus a separate Windows installer. It does not publish a numeric macOS minimum, RAM figure, or disk figure, so this page does not invent one. The Homebrew cask records Apple silicon and Intel for version 0.166.0. Model calls need a network connection; the sandbox default still starts with the agent’s own network off until you enable it.
If the client will not start, remove a retired approval_policy = "untrusted" entry from user config, project config, and startup scripts. If a thread loses approvals after resume, current release notes say acknowledged approval settings are preserved. codex doctor --network-only checks configuration, connectivity, and WebSocket diagnostics. Sign-in errors follow the account: a ChatGPT plan that does not include the CLI surface, or an API key without the model you selected.
Versions
The recorded version is 0.166.0, published on GitHub on 29 October 2026 as rust-v0.166.0. That release notes keyboard transcript selection, Markdown in questions and replies, GPT-6.1 Terra in the bundled and cloud model catalogs, codex queue --resume, and codex doctor --network-only. Update Homebrew with brew upgrade --cask codex.
Related tools
Claude Code is Anthropic’s terminal coding assistant and uses an Anthropic account. Copilot CLI is GitHub’s terminal client and uses a GitHub Copilot plan. Each product has its own sign-in, usage limits, and permission model. Codex on this page is the OpenAI CLI cask plus the desktop sign-in path above.
FAQ
How do I install Codex on a Mac?
OpenAI documents brew install --cask codex, the chatgpt.com install script, and npm install -g @openai/. Then run codex in a project directory and sign in.
Which sign-in should I use?
Use ChatGPT sign-in for subscription access and workspace rules. Use an API key for usage-based API billing. Codex cloud requires ChatGPT sign-in.
Does the CLI edit files on its own?
It can edit the workspace and run commands when the sandbox mode and approval policy allow it. The default keeps network access off and limits the sandbox to the workspace. Review the diff and keep Git checkpoints.
What is the recorded version?
0.166.0, matching GitHub release rust-v0.166.0 dated 2026-10-29.
Last updated: 2026-11-06. Sources: OpenAI Codex CLI, authentication, agent approvals, and pricing docs (https://developers.openai.com/codex/cli) and GitHub release 0.166.0 (https://github.com/openai/codex/releases/tag/rust-v0.166.0).
Official references
At a glance
- Price
- Free with in-app purchases
- Chip
- Apple silicon · Intel
- Auto-updates
- No
- Repository
- Open source · Apache-2.0 · Updated 0 days ago★136K
- Developer
- OpenAI
- Homebrew
- Available; updated by Homebrew
- Also known as
- Codex, codex
- Homepage
- github.com/openai/codex
- Token
- codex
Checked
What’s new in 0.171.0
New · OpenNavo editorial
- AddedAdds GPT-6.2 Sol and Astra, with Sol as the default.
- FixedDrafts stay with their thread when you switch sessions.
How to install Codex (OpenAI) on Mac
Install without Homebrew
Download the file Homebrew uses for your chip: Install Details
Uninstall Codex (OpenAI) and optional data cleanup
brew uninstall --cask codexA regular uninstall removes the app and keeps its settings and caches.
Deep clean (optional)
brew uninstall --zap --cask codex--zap also deletes the settings, caches and other files listed in the Homebrew definition. They can include data shared with other apps and cannot be restored, and it does not guarantee that nothing is left. Back up any data you need first. To keep settings and caches, leave out --zap.
Questions about Codex (OpenAI)
Is Codex (OpenAI) safe?
Codex (OpenAI) is in Homebrew’s official catalog and has not been disabled. Since September 2026, Homebrew disables apps that fail macOS Gatekeeper checks. When installing, Homebrew checks the download from github.com against its SHA-256 checksum. It was installed 546,210 times through Homebrew in the last 30 days.
Is Codex (OpenAI) free?
Codex (OpenAI) is free to download and offers in-app purchases. Source: learn.chatgpt.com/docs/pricing, checked Oct 25, 2026.
Is Codex (OpenAI) open source?
Codex (OpenAI)’s source code is public on GitHub (openai/codex) under the Apache-2.0 license.
How do I completely uninstall Codex (OpenAI) on a Mac?
Run brew uninstall --cask codex. To delete its settings and caches as well, run brew uninstall --zap --cask codex. --zap also deletes the settings, caches and other files listed in the Homebrew definition. They can include data shared with other apps and cannot be restored, and it does not guarantee that nothing is left. Back up any data you need first. To keep settings and caches, leave out --zap. That also deletes ~/.
Does Codex (OpenAI) run on Apple silicon (M1 and later) Macs?
Yes. Homebrew downloads separate builds for Apple silicon and Intel Macs.
Where does Codex (OpenAI) store its settings and data?
Its data is in ~/. These locations come from Homebrew’s clean-up list.
What is the latest version of Codex (OpenAI)?
The latest version is 0.171.0, added to Homebrew on Nov 20, 2026. Run brew upgrade --cask codex to update it.
What else does installing Codex (OpenAI) add?
It also adds 1 command-line tool: codex.
Similar Apps
- Claude CodeAnthropic's AI coding assistant for exploring codebases, editing files, running commands and tests, and managing Git workflows from the terminal.
- Google Cloud CLIA command-line toolset for managing Google Cloud projects, cloud resources, and applications, suited for terminal operations and automated deployment.
- Visual Studio CodeMicrosoft’s extensible code editor with debugging, Git integration, an integrated terminal, remote development, and optional AI assistance.
- Azure CLIMicrosoft’s cross-platform command-line tools for creating, managing, and automating Azure resources.