How do I even uninstall this?

Open 💬 5 comments Opened Jun 16, 2026 by serkor1
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What is the type of issue?

Documentation is missing

What is the issue?

There is no guide on how to uninstall codex-cli—which is a critically missing piece of information.
I asked ask ChatGPT-pro on how to uninstall it, and this was answer it gave:

set +e

# 0) Remove stored Codex auth first, if the command still works
if command -v codex >/dev/null 2>&1; then
  codex logout || true
fi

# 1) Stop any running Codex process
pkill -x codex 2>/dev/null || true

# 2) npm installs
if command -v npm >/dev/null 2>&1; then
  npm uninstall -g @openai/codex || true
  npm uninstall -g codex || true

  # Use this for root/global installs under /usr/local, /usr, etc.
  if command -v sudo >/dev/null 2>&1; then
    sudo npm uninstall -g @openai/codex || true
    sudo npm uninstall -g codex || true
  fi
fi

# 3) Bun global installs
if command -v bun >/dev/null 2>&1; then
  bun remove -g @openai/codex || true
  bun remove -g codex || true
fi

# 4) Homebrew/Linuxbrew installs
if command -v brew >/dev/null 2>&1; then
  brew uninstall --cask codex || true
  brew uninstall codex || true
fi

# 5) Official standalone installer default location
rm -f "$HOME/.local/bin/codex"
rm -rf "$HOME/.codex/packages/standalone"

# Refresh shell command cache and verify
hash -r
echo "Remaining codex paths, if any:"
type -a codex 2>/dev/null || echo "none"

If you do not provide the documentation on how to do it, at least provide a uninstall.sh or something similar.

Where did you find it?

Not in the documentation.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #27230

Powered by Codex Action

serkor1 · 2 months ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. * Windows Codex app/CLI leave duplicated executables, opaque runtime paths, and sensitive local state without cleanup/uninstall controls #27230 _Powered by Codex Action_

No—its not a duplicate. Issue #27694 covers installed runtime binaries, package caches etc. that is hard to remove/identify doing uninstall.
The user does not specifically ask for clear documentation/scripts on uninstalling codex-cli.
I am asking for a simple extension of the documentation with an (optional) associated script.

Edit: And the issue covers Windows only, my issue covers the documentation of a basic feature which by definition applies to all OSes.

MakenRosa · 2 months ago

I put together a narrow docs patch for this in README.md.

The gap is real: the README currently documents the standalone installer, npm, Homebrew, and release-asset install paths, but there is no matching uninstall section. The patch adds an Uninstalling Codex CLI section right after the install instructions and covers:

  • standalone Unix/macOS installer cleanup:
  • ${CODEX_INSTALL_DIR:-$HOME/.local/bin}/codex
  • ${CODEX_HOME:-$HOME/.codex}/packages/standalone
  • standalone Windows installer defaults:
  • $env:LOCALAPPDATA\Programs\OpenAI\Codex\bin
  • $env:USERPROFILE\.codex\packages\standalone
  • package-manager installs:
  • npm uninstall -g @openai/codex
  • bun remove -g @openai/codex
  • brew uninstall --cask codex
  • an explicit warning that deleting ~/.codex removes saved auth, config, sessions, skills, and other local data.

I kept this as documentation rather than an uninstall.sh because the uninstall action can delete user state, and the right behavior differs between "remove binary/cache" and "purge local Codex data". That distinction should be explicit in docs before it is automated.

BraveJasonChen · 2 months ago

I can work on a docs-only fix for this by adding uninstall instructions for the currently documented install methods: installer script, npm, Homebrew, Windows installer script, and manual release archive installs.
I’ll keep the change conservative and avoid adding an uninstall script. The docs would also mention that settings/auth data under ~/.codex are preserved unless the user explicitly removes them, and that users
can run codex logout before uninstalling if they want to sign out.
Would a PR in this direction be welcome?

YourLocalGoober · 1 month ago

fr