“command not found: codex” after installing Codex

Codex CLI install — your shell's message, not a Codex error. The one openai/codex issue found with this exact text in its title is a user report, so what this page says about that report is a user's experience, not OpenAI guidance; the install steps come from the official docs and installer.

The message

“zsh: command not found: codex”

What it means

The shell is saying it cannot find a program called codex in the places it looks for commands. The “zsh:” at the front is the shell speaking, and neither the docs nor Codex's source has an entry for it. The one issue on the openai/codex tracker with this exact text in its title (#15, from 2025, closed) was from someone who had installed with yarn. The reporter wrote that the cause was a missing npm path in their .zshrc, and a second user who uses asdf wrote that installing with bun worked for them. Those are two users' experiences, and the docs do not cover that case.

What you can do

On this site: install Codex CLI · check your Codex usage · did Codex reset today? · OpenAI status

Also searched as

People look this message up in several ways. These are search wordings, not OpenAI's text:

That is the same text without the shell name. No other wording was checked against a source, so none is listed.

Sources

This site is not affiliated with OpenAI. Where a statement above comes from a user report or a reply on the openai/codex issue tracker rather than documentation, it says so.

Frequently asked questions

How do I fix “command not found: codex” after installing Codex?

Open a new terminal, or run the export PATH line the installer printed. The installer puts codex in ~/.local/bin by default and adds that folder to PATH through a shell profile, which a terminal opened before the install won't have picked up. To check, the WSL docs use: which codex || echo "codex not found".

Is “command not found: codex” a Codex bug?

It is printed by your shell, not by Codex, and no official page or source file has an entry for it. The one openai/codex issue with that text in its title was a user report about an npm-style install, where the user said a missing path in .zshrc was the cause.

Why does Codex say command not found on Mac but work in another terminal?

No official source answers this. The documented behaviour that fits is that the installer adds the install folder to PATH through a shell profile and tells you to open a new terminal, so a terminal started earlier, or one that does not load that profile, won't find codex. That is an inference from the installer's behaviour, not a documented diagnosis.