He generated an API key from the Codex dashboard on his Windows side, then Alt-Tabbed back to the WSL window. He held it in his clipboard—a long, alphanumeric serpent.
He’d heard the whispers on Hacker News. Codex CLI. An AI that lived not in a cloud subscription tab, but right there, in the raw marrow of the command line. No polite chatbot avatars. No "I'm sorry, I cannot do that." Just you, a prompt, and an intelligence that could read your file system like a map.
It is highly recommended to use the Node Version Manager ( n ) or nvm to install Node.js, as the default Ubuntu repository versions are often outdated.
If you type openai or codex and get a "command not found" error, your global NPM prefix is likely not in your system PATH. install codex cli wsl
Running the Codex CLI on WSL is superior to the standard Windows Command Prompt for developers because:
# Install Node.js sudo apt install -y nodejs
He typed: >>> explain the irony of using an AI inside a Linux terminal emulator on Windows. He generated an API key from the Codex
Complete Guide: Install OpenAI Codex CLI in Windows Subsystem for Linux (WSL2)
openai api chat_completions.create -m gpt-4 -g user "Explain how WSL works"
(Note: Package names can change; refer to the official OpenAI GitHub repository for the exact package name.) Codex CLI
Setting up the environment requires a sequence of steps that transition from Windows-level configuration to Linux-specific package management.
He didn't want to ask a question. He wanted a conversation with the machine.