Bug: Codex on PowerShell attempts to run `sh`

Resolved 💬 4 comments Opened Apr 18, 2025 by PramaYudhistira Closed Apr 19, 2025

What version of Codex is running?

v0.1.2504172351

Which model were you using?

o4-mini

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

  • Run npm i -g @openai/codex
  • Run codex

It will output

& : The term 'sh.exe' 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.

What is the expected behavior?

Expected behavior is for codex cli to start running properly. This PR shows the expected behavior https://github.com/openai/codex/pull/318

What do you see instead?

A message indicating the powershell shim codex.ps1 is attempting to run sh.exe. This shouldn't be happening because

Additional information

Added a potential fix here https://github.com/openai/codex/pull/318 , this change now provides cross-platform support and works on all CLIs by using a Node based entry point

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗