Clean Windows uninstaller for Codex CLI + Codex Router — the uninstaller OpenAI never shipped.
Preserves skills/ + agents/, removes everything else: binaries, junctions, Scheduled Tasks autostart, PATH entries, router payload, logs/sessions/auth.
- Discussion #34373 — uninstall answered for Linux only; Windows replies (
what about windows,remove CODEX-CLI on Windows via powershell?) left unanswered. - Issue #28575 —
How do I even uninstall this?No uninstall guide exists. - Issue #15343 — no clean Windows uninstall reverting sandbox changes; closed as not planned.
Like the old Windows 11 Microsoft bloatware pattern: deep hooks into the system (User PATH, directory junctions, Scheduled Tasks that relaunch every minute + at logon, background node + tray processes, ports 4200–4214) with no matching removal path. This repo documents the journey and ships the missing removal tool.
# preview (recommended first)
powershell -ExecutionPolicy Bypass -File Uninstall-CodexWindows.ps1 -WhatIf
# standard: remove CLI + Router, keep skills/agents
powershell -ExecutionPolicy Bypass -File Uninstall-CodexWindows.ps1
# only one side
powershell -ExecutionPolicy Bypass -File Uninstall-CodexWindows.ps1 -CliOnly
powershell -ExecutionPolicy Bypass -File Uninstall-CodexWindows.ps1 -RouterOnly
# nuclear: also delete skills/ + agents/
powershell -ExecutionPolicy Bypass -File Uninstall-CodexWindows.ps1 -FullWipe| Area | Path / name |
|---|---|
| CLI junction | %LOCALAPPDATA%\Programs\OpenAI\Codex\bin (junction → .codex\packages\standalone\current\bin, removed with rmdir so target is never followed) |
| User PATH | that bin entry from HKCU:\Environment |
| CLI payload | %USERPROFILE%\.codex\packages\standalone, app-server-daemon, version.json |
| Router autostart | Scheduled Tasks \Codex Router (wscript start-codex-router-hidden.vbs, logon + every 1 min, restart 999×) and \Codex Router Tray (Codex Router.exe --tray-only, logon) |
| Router procs | node start.mjs, tray exe, hidden wscript |
| Router payload | %LOCALAPPDATA%\codex-router, %USERPROFILE%\.codex\codex-router (ports 4200–4214 freed) |
| State | everything under %USERPROFILE%\.codex except skills/ + agents/ |
Verify manually: Get-Command codex should fail, no Codex* scheduled tasks, ports free, .codex contains only skills agents.
docs/EVIDENCE.md— the three pages, what the installer does, before/after on a real machine (paths redacted to%VAR%form).docs/VIDEO.md— video script + how the video was built (slides + Edge-TTS VO + ffmpeg).video/full-codex-uninstall.mp4— dramatic walkthrough (copy in release assets when too large for git).
- Run
-WhatIffirst. Kills only router-related processes. Junctions removed withrmdir, never recursive-followed. No secrets ever committed (see.gitignore).