How to check Codex CLI version

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 shows which Codex CLI release will answer the next command before troubleshooting behavior or comparing machines.

The codex --version command prints a single codex-cli x.y.z line and exits without requiring a login. The shorter codex -V flag is the same version option, and codex --help lists -V, --version in local help output.

Use the returned value as a shell-specific fact rather than a machine-wide guarantee. A different terminal tab, automation account, or package-manager prefix can resolve another codex binary, so rerun the check wherever the later Codex command will run.

Steps to check Codex CLI version:

  1. Run the version check from the terminal that will start Codex.
    $ codex --version
    codex-cli 0.139.0

    The numeric value changes as new Codex CLI releases ship. Use the string printed by your shell when comparing hosts, reporting a problem, or confirming an upgrade.

  2. Use the short version flag when a command example or script expects the compact form.
    $ codex -V
    codex-cli 0.139.0

    codex -V and codex --version print the release string for the active binary.

  3. Confirm the flag exists in local help when a wrapper, alias, or old binary behaves unexpectedly.
    $ codex --help
    Codex CLI
    ##### snipped #####
      -V, --version
              Print version
  4. Treat a shell error as an install or PATH problem for that environment.
    $ codex --version
    zsh: command not found: codex

    The shell did not find codex, so it cannot report a version. Install Codex CLI or open a shell that loads the package-manager prefix before retrying.
    Related: How to install Codex CLI with Homebrew

  5. Re-run the version check after an install, upgrade, or shell change.
    $ codex --version
    codex-cli 0.139.0

    If the value is still not the release expected after a Homebrew upgrade, reopen the shell and confirm the Homebrew prefix is earlier on PATH.
    Related: How to upgrade Codex CLI with Homebrew