Set up Windows for Codex
Follow these steps to install your development tools, open a project in Codex, and check that everything works. Each step explains what to do and why it helps.
Before you start
This guide uses Windows 11 and PowerShell 7. Work through steps 1–4 in order. If a tool is already installed, use its version check and skip the installation. You only need one way to use Codex and the tools required by your project.
How to use the commands: Paste each command into the terminal and press Enter. Wait for it to finish before running the next one. Lines starting with # are explanations; you can leave them in when copying a block.
Git records changes to your files so you can review your work and return to a saved version. A few settings help avoid common Windows issues.
VS Code is an editor for opening and changing code. Add the Codex extension to work with Codex beside your files, or choose the desktop app or terminal.
Windows Terminal is the window where you type commands. PowerShell 7 runs those commands. It installs alongside the older Windows PowerShell included with Windows.
These tools run or build your code. For example, a JavaScript project may need Node.js, while a Python project needs Python. Check the project’s README before installing anything.
1. Set up PowerShell 7 and Windows Terminal
Open the Start menu, search for Windows PowerShell, and open it. Use this existing shell to install PowerShell 7 and Windows Terminal with winget, the Windows package manager.
# Install modern Windows Terminal and PowerShell 7
winget install --id Microsoft.WindowsTerminal -e
winget install --id Microsoft.PowerShell -e
# After installation, close and reopen the terminal.
# Check that PowerShell 7 is installed:
pwsh --version
# Expected: PowerShell 7.x.x
If winget is not recognized, install or update App Installer in the Microsoft Store, then reopen PowerShell. See Microsoft’s PowerShell installation guide for other installation options.
- Open Windows Terminal from the Start menu.
- Open the arrow menu beside the tabs and choose Settings → Startup. Set the default profile to PowerShell (the new PowerShell 7 installation), then save.
- Open a new tab and run
$PSVersionTable.PSVersion. The Major value should be 7. Use this tab for the rest of the guide.
Only if scripts are blocked: If PowerShell says “running scripts is disabled,” the setting below allows local scripts for your Windows account. Scripts marked as downloaded from the internet still need a trusted signature unless you explicitly unblock them. Run it in PowerShell 7 and confirm with Y if prompted. On a managed work computer, your organization’s policy may take priority. Read about execution policies.
# Allows local scripts to run while requiring signatures for remote downloads
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
2. Install and set up Git
Git keeps a history of your project. Start by running git --version in PowerShell 7. If Git is missing, run winget install --id Git.Git -e, follow the installer prompts, then close and reopen Windows Terminal. Run git --version again; it should print a version number.
The settings below apply to all repositories for your Windows account. They are useful defaults for new projects; follow your team’s instructions if you already have a development setup. LF and CRLF are two ways of marking the end of a line in a text file. Keeping line endings consistent makes code changes easier to review.
# Store text with LF line endings; leave checkouts as stored
git config --global core.autocrlf input
# Enable long path support in Git (other tools may still have limits)
git config --global core.longpaths true
# Set default branch name to main
git config --global init.defaultBranch main
Before your first commit, set the name and email that should appear in your Git history. Replace the example values with your own; you can use your Git hosting provider’s private commit email.
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
# Check your saved settings
git config --global --list
Check before changing an existing project: A .gitattributes file can define its own line-ending rules. Keep those rules and any existing sign-in configuration. In VS Code, use the status bar to check that files use UTF-8 and the line endings your project expects. Git’s configuration reference explains these settings.
3. Choose how you want to use Codex
Choose the option that suits how you like to work. VS Code is a useful starting point if you want to see your files and review edits in the same window. You can also use Codex in the desktop app or from a terminal.
Choose this if: You want Codex beside your code while you edit and review changes.
Install VS Code with winget install --id Microsoft.VisualStudioCode -e. Then follow these steps:
- Open VS Code and choose File → Open Folder. Select your project’s top-level folder, usually the one containing its README.
- Open Extensions with Ctrl+Shift+X. Find and install the Codex extension published by OpenAI. The official extension guide links to the correct listing.
- Open the Codex sidebar and follow the sign-in prompts.
Desktop app: Follow the official desktop quickstart to install the Windows app and sign in. Select Codex and open your project folder.
Terminal: Follow the Windows installation steps in the official Codex CLI guide. In PowerShell 7, run cd "C:/Projects/MyApp" using your own project path, then run codex and follow the sign-in prompts.
Check it works: Ask Codex: “Read this project and explain what it does. Tell me how to run it and its tests. Do not change any files yet.” A useful response should refer to files in the folder you opened.
If Codex asks you to set up its Windows sandbox, follow the setup prompts. The sandbox controls which files and commands Codex can access. You can use Codex natively on Windows; WSL is optional for projects that need a Linux environment. See OpenAI’s Windows setup guidance for help.
4. Install the tools your project needs
A runtime runs your code, and a toolchain includes the tools used to build and test it. Check your project’s README for the required tools and versions. You do not need to install every language below; a basic HTML and CSS project may only need a browser.
# JavaScript or TypeScript projects
node --version
npm --version
# Python projects
py --version
# Rust projects
rustc --version
cargo --version
# C# or .NET projects
dotnet --list-sdks
# PHP projects
php --version
composer --version
If a required command is missing, install the version listed in your project’s README. Use the official installer for that language. For Node.js, choose the LTS release if the project does not specify a version; if it uses a version manager such as fnm, follow the project’s setup instructions.
After installing: Close and reopen Windows Terminal, your editor, and Codex, then repeat the relevant version check. This lets them pick up changes to PATH, the list of folders Windows searches for commands.
You’re ready when: PowerShell and Git report their versions, Codex can read the correct project folder, and the required project tools are available. Next, follow the README to install dependencies and run the project’s existing tests.
Fix common Windows problems
A file is busy or cannot be changed
An error such as EBUSY or EPERM can mean another program is using the file, or your account does not have permission to change it.
Try this: Stop the project’s running development server or test watcher with Ctrl+C in its terminal, close any app using the file, then retry. If the error remains, check the file’s permissions and share the full error with Codex.
Git does not notice a capitalization change
Windows usually treats Header.vue and header.vue as the same filename. A rename that changes only capitalization may need an extra step for Git to record it.
Try this: In the folder containing the tracked file, rename it through an unused temporary name: git mv Header.vue Header-temp.vue, then git mv Header-temp.vue header.vue. Replace the example names with your own and run git status to check the result. Update any imports to match the new capitalization.
A file path is unclear
Long paths are harder to read, and some formats treat backslashes as special characters. Paths relative to your project folder are usually easier to share with Codex.
Try this: Use forward slashes, such as src/index.js, in prompts and AGENTS.md. When a terminal command needs a full path, put it in quotes if it contains spaces: cd "C:/Projects/My App".
Ready to work on your project?
Follow the workflow to plan a task, review changes, and test the result.