Unable to execute shell commands

Resolved 💬 6 comments Opened Aug 29, 2025 by StellioKontos Closed Nov 25, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.27.0

Which model were you using?

unrelated

What platform is your computer?

Windows

What steps can reproduce the bug?

I do not know how to reproduce this. I simply installed the CLI through the steps provided and ran it.
The problem persists whether I open codex through CMD and PowerShell, also with administrator privileges.

I also use Gemini CLI which works fine.

What is the expected behavior?

The CLI running shell commands.

What do you see instead?

<img width="1004" height="321" alt="Image" src="https://github.com/user-attachments/assets/451138e9-89d5-4d3c-8afc-572b4722ebf5" />

When trying to run shell commands, the CLI reports "program not found"

Additional information

It is not able to execute any shell commands.
It appears creating/writing files uses the built‑in apply_patch API, but reading files uses shell, therefore it is able to write files but not read them.

I purchased a Plus subscription specifically for Coxed; really hope somebody can shed some light on this.

View original on GitHub ↗

6 Comments

FreddyE1982 · 12 months ago

windows is really problematic. I strongly suggest activating "Windows Subsystem For Linux", installing Ubuntu and installing codex cli there.

alternatively you can try putting this in the AGENTS.md:

You are on Windows. Use ONLY windows commands. Use ONLY powershell. If a command fails find out the correct syntax and extend AGENTS.md to note down that syntax for future use

Priyabhunia · 12 months ago
windows is really problematic. I strongly suggest activating "Windows Subsystem For Linux", installing Ubuntu and installing codex cli there. alternatively you can try putting this in the AGENTS.md: You are on Windows. Use ONLY windows commands. Use ONLY powershell. If a command fails find out the correct syntax and extend AGENTS.md to note down that syntax for future use

still you have to deal with some MCP related failure issue

sfz009900 · 12 months ago

Same here, MCP doesn't work for me either. I just use a VSCode plugin.

Priyabhunia · 12 months ago
Same here, MCP doesn't work for me either. I just use a VSCode plugin.

I am not in wsl yet but I think image dragdrop also wont work .can you confirm it

zheli1119 · 11 months ago

I highly suspect your issue is due to this problem; you can try modifying shell.rs and rebuilding. #3253

etraut-openai contributor · 9 months ago

We've made significant improvements for Windows — both WSL and native — recently, so you should no longer see this problem with the latest versions.