How to Install OpenAI's Codex CLI on Any OS

The Core · TL;DR
- Codex CLI installs via curl on macOS/Linux or a PowerShell command on Windows, with Homebrew as an alternative Mac option.
- Three authentication methods are supported: ChatGPT sign-in, device code, or a personal API key.
- Usage through a ChatGPT subscription is shared between the web app and the CLI, not billed separately.
- OpenAI's plan tiers (Free, Go, Plus, Pro, Business, Edu, Enterprise) determine how much CLI usage is available.
Codex CLI runs as a terminal-based coding assistant, and setting it up takes only a couple of commands regardless of which operating system you use. OpenAI supports macOS, Linux, and Windows, with each platform following a slightly different installation path.
On macOS and Linux, the simplest route is a single curl command: curl -fsSL https://chatgpt.com/codex/install.sh | sh. This fetches and runs the installer script directly from OpenAI's servers, without requiring a separate download step.
Mac users who prefer a package manager can instead install Codex CLI through Homebrew, using brew install --cask codex. Both methods place the tool on your system so it can be invoked from any terminal session.
Windows users install Codex through PowerShell rather than curl. The command powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" temporarily bypasses the execution policy to run the remote install script. Once finished, the Windows installer adds Codex to your system PATH automatically and gives you the option to launch the application right away.
Signing In
After installation, Codex CLI asks you to authenticate before it can do anything useful. There are three supported sign-in methods: signing in with your ChatGPT account, using a device code flow, or supplying your own API key directly.
Choosing to sign in with ChatGPT ties Codex CLI usage to your existing subscription. That matters for cost tracking, since usage through a ChatGPT plan is shared between the web app and the CLI tool rather than billed separately.
Which Plan You'll Need
Codex CLI itself is free to install, but how much you can actually do with it depends on your underlying OpenAI plan. OpenAI currently offers Free, Go, Plus, Pro, Business, Edu, and Enterprise tiers, each with different usage allowances that carry over to CLI sessions.
Developers evaluating Codex CLI for daily work should factor in that shared-usage model before committing to a workflow. Since the CLI draws from the same quota as ChatGPT's web interface, heavy terminal-based coding sessions can eat into the allowance available for regular chat use, making plan selection a practical consideration rather than an afterthought.
Original reporting and research used to synthesize this article.
WAKIB Editorial Team
This review was prepared and summarized by the WAKIB AI intelligence engine and vetted by our editorial board for accuracy and reliability.
Subscribe to Newsletter
Get a weekly summary of the most promising AI research and tools delivered to your inbox.
Telegram Channel
Join our active community on Telegram for real-time tracking of AI models and trends.
