Step-by-step instructions
- 1
Step
Check the installed Codex CLI
Start by checking the binary path and version so you know whether Homebrew, npm, or another installer owns the command.
which codex && codex --version - 2
Step
Update with the matching package manager
Prefer the same package manager that installed Codex. Mixing installers can leave stale binaries earlier in PATH.
brew upgrade openai-codex || npm update -g @openai/codex - 3
Step
Refresh your shell path
Some shells cache command locations. Reload before checking the version again.
hash -r 2>/dev/null || true exec $SHELL -l - 4
Step
Verify auth and model access
A version number is not enough. Run a tiny exec to verify auth, model routing, and the updated CLI all work.
codex exec --skip-git-repo-check "Say updated"
Why this matters
CLI updates can fail quietly when multiple package managers install the same command. This flow proves you updated the executable your terminal actually uses.
Troubleshooting
- If the version does not change, run type -a codex and remove stale binaries.
- If auth fails after updating, run Codex login again.
- If npm global update fails, fix npm permissions instead of using sudo blindly.
Related tutorials
Microsoft Copilot Studio
Build a Microsoft Copilot Studio customer intake agent for service businesses
Create a Copilot Studio agent that qualifies customers, captures service details, stores lead data, and routes urgent requests to your team.
Copilot
How to Install GitHub Copilot CLI on Mac and Windows
Step-by-step guide to installing the GitHub Copilot CLI extension. Learn how to authenticate and run gh copilot suggest and explain in your terminal.