Support Windows
Resolved 💬 6 comments Opened Apr 17, 2025 by davidgilbertson Closed Aug 7, 2025
💡 Likely answer: A maintainer (davidgilbertson, contributor)
responded on this thread — see the highlighted reply below.
Specifically, running a command prompt or PowerShell (not WSL).
FWIW, I've been running it in Windows via Git Bash and it works for most things just fine, but had no luck in PowerShell.
I've had one crash (in git bash), not sure if it's because of Windows, when I asked it to check and update my git version.
�Can you check my git version and update it if necessary?
thinking for 25s
command
$ git --version
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│( ● ) Thinking │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send
file:///C:/Users/david/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:445
`,"\r"]);gg.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function nRe(e,t){for(let a=t??0;a<e.length;a++){if(e[a]===10)return{preceding:a,index:a+1,carriage:!1};if(e[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function kae(e){for(let n=0;n<e.length-1;n++){if(e[n]===10&&e[n+1]===10||e[n]===13&&e[n+1]===13)return n+2;if(e[n]===13&&e[n+1]===10&&n+3<e.length&&e[n+2]===13&&e[n+3]===10)return n+4}return-1}g();function PO(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();return r?.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}var ad=class e{constructor(t,r){this.iterator=t,this.controller=r}static fromSSEResponse(t,r){let n=!1;async function*a(){if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let i=!1;try{for await(let s of aRe(t,r))if(!i){if(s.data.startsWith("[DONE]")){i=!0;continue}if(s.event===null||s.event.startsWith("response.")||s.event.startsWith("transcript.")){let c;try{c=JSON.parse(s.data)}catch(d){throw console.error("Could not parse message into JSON:",s.data),console.error("From chunk:",s.raw),d}if(c&&c.error)throw new mi(void 0,c.error,void 0,UO(t.headers));yield c}else{let c;try{c=JSON.parse(s.data)}catch(d){throw console.error("Could not parse message into JSON:",s.data),console.error("From chunk:",s.raw),d}if(s.event=="error")throw new mi(void 0,c.error,c.message,void 0);yield{event:s.event,data:c}}}i=!0}catch(s){if(s instanceof Error&&s.name==="AbortError")return;throw s}finally{i||r.abort()}}return new e(a,r)}static fromReadableStream(t,r){let n=!1;async function*a(){let s=new gg,c=PO(t);for await(let d of c)for(let f of s.decode(d))yield f;for(let d of s.flush())yield d}async function*i(){if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let s=!1;try{for await(let c of a())s||c&&(yield JSON.parse(c));s=!0}catch(c){if(c instanceof Error&&c.name==="AbortError")return;throw c}finally{s||r.abort()}}return new e(i,r)}[Symbol.asyncIterator](){return this.iterator()}tee(){let t=[],r=[],n=this.iterator(),a=i=>({next:()=>{if(i.length===0){let s=n.next();t.push(s),r.push(s)}return i.shift()}});return[new e(()=>a(t),this.controller),new e(()=>a(r),this.controller)]}toReadableStream(){let t=this,r,n=new TextEncoder;return new IN({async start(){r=t[Symbol.asyncIterator]()},async pull(a){try{let{value:i,done:s}=await r.next();if(s)return a.close();let c=n.encode(JSON.stringify(i)+`
e [Error]: An error occurred while processing the request.
at e.a [as iterator] (file:///C:/Users/david/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:445:1514)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async R0.run (file:///C:/Users/david/AppData/Roaming/npm/node_modules/@openai/codex/dist/cli.js:462:2639) {
status: undefined,
headers: undefined,
request_id: undefined,
error: {
type: 'server_error',
code: null,
message: 'An error occurred while processing the request.',
param: null
},
code: null,
param: null,
type: 'server_error'
}
Node.js v23.11.0
6 Comments
And in case someone is wondering "why not just use WSL" it's because my project files are in Windows, and certain commands (like
git status) are incredibly slow if you run them for a Windows directory while in WSL.In other words, it would be great if Windows was a _first class citizen_.
Would love to support Windows properly outside of WSL, happy to review improvements here, personally I don't own a Windows machine and I'm not the best placed here to make it great, but will very much accept PRs!
Anyone here, Powershell doesn't work. It won't recognize the codebase.
Any FLOSS should be cross platform and environment agnostic. Just make sure it works in any command line terminal, including cmd, PowerShell, MSYS2...
Thank you for the feedback! Please try running Codex CLI on the latest version, as we've been working on a rewrite into Rust that may address this issue. If the problem persists, feel free to open an issue or contribute to the
codex-rs/implementation. More details on the project update can be found here.This appears to still be an issue on Windows... with this version of Codex CLI: 0.19.0