A terminal can keep an older codex binary on PATH after an install, upgrade, or shell change. Checking the version from the same shell that will start Codex identifies the Codex CLI release that answers the next command.
The release number identifies the installed CLI software, rather than the AI model selected for a session. A version query exits without starting an agent session or requiring a login.
The executable lookup uses a macOS or Linux shell with Codex CLI already installed. A different terminal tab, automation account, or package-manager prefix can resolve another binary, so the result belongs to the active shell environment.
Steps to check Codex CLI version:
- Locate the Codex CLI executable in the shell where you use it.
$ command -v codex /usr/local/bin/codex
The path depends on the installation method and package-manager prefix. A blank result or a command not found error means the shell cannot resolve codex. A shell alias or function may appear instead of a file path.
- Print the version of the active Codex CLI executable.
$ codex --version codex-cli 0.165.0
The number after codex-cli is the installed release and can differ from the value shown here. The short flag codex -V prints the same version string.