winget command line alias not added

Open 💬 3 comments Opened Jun 15, 2026 by donpellegrino

What issue are you seeing?

The Codex CLI installation via winget reports that a codex command line alias was added, but it was not.

What steps can reproduce the bug?

Install or update Codex CLI via winget:

(8/9) Found Codex CLI [OpenAI.Codex] Version 0.139.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/openai/codex/releases/download/rust-v0.139.0/codex-x86_64-pc-windows-msvc.exe.zip
  ██████████████████████████████  92.8 MB / 92.8 MB
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "codex-command-runner"
Command line alias added: "codex-windows-sandbox-setup"
Command line alias added: "codex"
Successfully installed

Start a new PowerShell terminal and observe that although the update reported a command line alias was added that it is not available:

PS C:\Users\User01> codex
codex : The term 'codex' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ codex
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (codex:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Use tab completion to discover the available command:

PS C:\Users\User01> codex-x86_64-pc-windows-msvc.exe

What is the expected behavior?

The expected behavior is that the alias that was reported as setup be setup.

Additional information

_No response_

View original on GitHub ↗

3 Comments

jieshu666 · 2 months ago

The winget installer reports "Command line alias added: 'codex'" but after installation the codex command is not found because the zip contains codex-x86_64-pc-windows-msvc.exe instead of codex.exe.

The helper binaries (codex-command-runner, codex-windows-sandbox-setup) were already correctly renamed inside the zip, but the main binary retained the target-triple name.

This change renames it to codex.exe so the winget alias resolves correctly.

Closes #28321

jieshu666 · 2 months ago

Fix branch: https://github.com/jieshu666/codex/tree/fix/winget-codex-alias

Change in .github/workflows/rust-release-windows.yml (2 hunks, +4/-2):

  1. Bundled zip (line 386): cp "$dest/$base" "$bundle_dir/$base" → cp "$dest/$base" "$bundle_dir/codex.exe"
  2. Fallback zip (line 395): same rename to codex.exe before zipping

The helper binaries were already correctly renamed to short names inside the zip; this just aligns the main binary.

whitford-olmst · 2 months ago

@jieshu666 Are you submitting a PR?