How to: Codex CLI Windows Terminal in a PowerShell console

Resolved 💬 6 comments Opened Apr 16, 2025 by dfinke Closed Apr 16, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator) responded on this thread — see the highlighted reply below.

Is there a way to get the cli to work on the Windows Terminal in a PowerShell console? - Thank you

View original on GitHub ↗

6 Comments

tibo-openai collaborator · 1 year ago

Few of us on Windows over here, but if you need to do anything to get it to work then please send a PR with the steps!

tim-flynn · 1 year ago

Set your OPENAI_API_KEY environment variable without quotes:

# Correct ✅ 
set OPENAI_API_KEY=your_actual_key

# Incorrect ❌
set OPENAI_API_KEY="your_actual_key"

Using quotes (export OPENAI_API_KEY="your_actual_key" or set OPENAI_API_KEY="your_actual_key") is incorrect ❌ and makes the key invalid.

tim-flynn · 1 year ago
Few of us on Windows over here, but if you need to do anything to get it to work then please send a PR with the steps!

I'm assuming that was your issue, but you need to provide details!! 😅

tim-flynn · 1 year ago
> Few of us on Windows over here, but if you need to do anything to get it to work then please send a PR with the steps! ### I'm assuming that was your issue, but you need to provide details!! 😅

I've never misinterpreted a comment so badly in my LIFE... My message was meant for @dfinke and I'm terribly sorry, the commits you've commited are great 👍

lolrazh · 1 year ago
Is there a way to get the cli to work on the Windows Terminal in a PowerShell console? - Thank you

Just run it on WSL instead. Works perfectly for me :)

tibo-openai collaborator · 1 year ago

Going to close this, please re-open if you run into other issues.