Skip to content

Official links only. Every download link goes to the publisher's own official page. We never host, repackage or bundle files.

How-to 8 min read

How to install OpenAI Codex CLI on Windows

Windows पर OpenAI Codex CLI कैसे इंस्टॉल करें

By the ToolsBharat teamPublished 30 Oct 2026How we check

Applies to OpenAI Codex CLI 0.166.0 (released 29 Oct 2026)

हिंदी में पढ़ें

Quick answer

To install Codex CLI on Windows, open a new PowerShell window and run powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex", the command in OpenAI's docs. If you already use Node.js, npm install -g @openai/codex also works. Then run codex inside your project folder and choose Sign in with ChatGPT. OpenAI recommends Windows 11. A recent, fully updated Windows 10 (version 1809 or newer) works on a best-effort basis.

What Codex CLI is, and what you need

OpenAI Codex CLI is OpenAI's coding agent that runs in your terminal. It can read your repository, edit files and run the tools on your PC. It is open source (Apache-2.0 licence on GitHub), but the AI work happens on OpenAI's servers, so you need an account and an internet connection.

  • Windows version: OpenAI's Windows page rates Windows 11 as "Recommended". A recent, fully updated Windows 10 is "Best effort": it needs modern console support (ConPTY), which in practice means Windows 10 version 1809 or newer. Older Windows 10 builds are "Not recommended".
  • winget: OpenAI says the Windows Package Manager (winget) should be available. If it's missing, update Windows first.
  • Account: sign in with ChatGPT or use an OpenAI API key. The GitHub README recommends signing in with ChatGPT to use Codex as part of a Plus, Pro, Business, Edu or Enterprise plan. On OpenAI's Codex pricing page, the Plus plan lists "Codex on the web, in the CLI, in the IDE extension, and on iOS", while the Free and Go plans list Codex in the desktop app, subject to rollout. With an API key you pay per use at API rates.

To check your Windows version, press Win + R, type winver and press Enter.

Step-by-step: install Codex CLI with the standalone installer

  1. Open the Start menu, type PowerShell and open a new PowerShell window. OpenAI's docs say to start the installer from a new PowerShell window.
  2. Paste the command exactly as OpenAI gives it and press Enter: powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
  3. When it finishes, close the window and open a new one so the new command is found.
  4. Go to your project folder, for example cd D:\Projects\my-app, and run codex.
  5. The first time, choose Sign in with ChatGPT (or another sign-in method). A browser window opens. After you sign in, the browser passes your credentials back to Codex.
  6. Describe a task. OpenAI's own first example is: Tell me about this project. OpenAI also suggests making Git checkpoints before and after a task so you can undo changes.

The -ExecutionPolicy ByPass part applies only to that one PowerShell process, so you don't have to change your system's script policy to install. OpenAI's update command is the same as the install command: run it again to get the latest version.

Other install options

  • npm: if you have Node.js, run npm install -g @openai/codex. Run the same command again to update.
  • ChatGPT desktop app: OpenAI's Windows docs describe Codex inside the ChatGPT desktop app, which runs natively with the Windows sandbox. See our guide to the ChatGPT desktop app for Windows.
  • WSL: use WSL 2 if your work needs Linux tools. OpenAI says WSL 1 stopped being supported from Codex 0.115.
  • macOS and Linux: curl -fsSL https://chatgpt.com/codex/install.sh | sh, or Homebrew: brew install --cask codex.

The Windows sandbox, in plain words

Codex runs the commands it suggests inside a Windows sandbox that limits which folders it can write to and whether it can reach the network. OpenAI lists three versions:

  • mxc: recommended on compatible PCs. It uses Microsoft Execution Containers, which Microsoft introduced in Windows 11 24H2 (build 26100.9278) and 25H2 (build 26200.9278). It needs no administrator setup.
  • elevated: the preferred fallback when MXC isn't available. It needs a one-time setup that an administrator approves.
  • unelevated: a last fallback with weaker network isolation.

OpenAI warns that running Codex in "full access" mode means it isn't limited to your project folder and could make destructive changes. Keep the sandbox on.

Troubleshooting

  • Sandbox setup failed: OpenAI lists the usual causes: you declined the UAC (administrator) prompt, or company policy blocks creating local users, changing firewall rules or granting logon rights. Try again and approve the prompt if you're allowed to. On a company laptop, ask IT. If policy allows it, use the unelevated sandbox meanwhile.
  • Windows error 1385: Windows is denying the logon type the sandbox users need. Ask IT to check the logon rights, and use unelevated while they look into it.
  • "Some folders are writable by Everyone": the folder permissions are too broad for the sandbox to protect. Remove "Everyone" write access if that's appropriate, then restart Codex.
  • Commands can't reach the network: some modes run without network access on purpose. If you expected access, restart Codex and try again.
  • npm.ps1 cannot be loaded because running scripts is disabled: this affects npm-based tools. OpenAI's Windows app docs suggest Set-ExecutionPolicy -ExecutionPolicy RemoteSigned as a common fix. Read Microsoft's execution policy guide before you change it.
  • Sending a bug report: OpenAI asks for CODEX_HOME/.sandbox/sandbox.log, your Windows build number and the exact error. Never send the contents of .sandbox-secrets.

Install Codex only from OpenAI's commands, npm package or GitHub releases. A "Codex CLI.exe" on a random download site is not from OpenAI.

हिंदी में

Windows पर OpenAI Codex CLI कैसे इंस्टॉल करें

Windows पर Codex CLI इंस्टॉल करने के लिए नई PowerShell विंडो खोलें और OpenAI के दस्तावेज़ में दिया कमांड powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" चलाएँ। अगर आप पहले से Node.js इस्तेमाल करते हैं, तो npm install -g @openai/codex भी काम करता है। फिर अपने प्रोजेक्ट फ़ोल्डर में codex चलाएँ और Sign in with ChatGPT चुनें। OpenAI, Windows 11 की सलाह देता है। नया और पूरी तरह अपडेटेड Windows 10 (version 1809 या नया) best-effort आधार पर चलता है।

Codex CLI क्या है, और क्या चाहिए

OpenAI Codex CLI, OpenAI का कोडिंग एजेंट है जो आपके टर्मिनल में चलता है। यह आपकी रिपॉज़िटरी पढ़ सकता है, फ़ाइलें बदल सकता है और आपके PC पर मौजूद टूल चला सकता है। यह ओपन सोर्स है (GitHub पर Apache-2.0 लाइसेंस), लेकिन AI का काम OpenAI के सर्वर पर होता है, इसलिए अकाउंट और इंटरनेट दोनों चाहिए।

  • Windows वर्ज़न: OpenAI के Windows पेज पर Windows 11 को "Recommended" बताया गया है। नया और पूरी तरह अपडेटेड Windows 10 "Best effort" है: इसे आधुनिक कंसोल सपोर्ट (ConPTY) चाहिए, यानी व्यवहार में Windows 10 version 1809 या नया। पुराने Windows 10 बिल्ड "Not recommended" हैं।
  • winget: OpenAI के मुताबिक़ Windows Package Manager (winget) मौजूद होना चाहिए। न हो तो पहले Windows अपडेट करें।
  • अकाउंट: ChatGPT से साइन-इन करें या OpenAI API key इस्तेमाल करें। GitHub README सलाह देता है कि Plus, Pro, Business, Edu या Enterprise प्लान के हिस्से के रूप में Codex इस्तेमाल करने के लिए ChatGPT से साइन-इन करें। OpenAI के Codex pricing पेज पर Plus प्लान में "Codex on the web, in the CLI, in the IDE extension, and on iOS" लिखा है, जबकि Free और Go प्लान में desktop app में Codex लिखा है, जो धीरे-धीरे रोलआउट हो रहा है। API key से आप API दरों पर इस्तेमाल के हिसाब से भुगतान करते हैं।

अपना Windows वर्ज़न देखने के लिए Win + R दबाएँ, winver लिखें और Enter दबाएँ।

स्टेप-बाय-स्टेप: स्टैंडअलोन इंस्टॉलर से Codex CLI इंस्टॉल करें

  1. Start मेन्यू खोलें, PowerShell लिखें और एक नई PowerShell विंडो खोलें। OpenAI के दस्तावेज़ में इंस्टॉलर नई PowerShell विंडो से चलाने को कहा गया है।
  2. OpenAI का दिया कमांड बिल्कुल वैसा ही पेस्ट करें और Enter दबाएँ: powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
  3. इंस्टॉल पूरा होने पर विंडो बंद करके नई विंडो खोलें, ताकि नया कमांड मिल सके।
  4. अपने प्रोजेक्ट फ़ोल्डर में जाएँ, जैसे cd D:\Projects\my-app, और codex चलाएँ।
  5. पहली बार Sign in with ChatGPT (या कोई दूसरा साइन-इन तरीका) चुनें। ब्राउज़र विंडो खुलेगी। साइन-इन के बाद ब्राउज़र आपकी जानकारी Codex को लौटा देता है।
  6. कोई काम बताइए। OpenAI का अपना पहला उदाहरण है: Tell me about this project। OpenAI यह भी सलाह देता है कि किसी काम से पहले और बाद में Git checkpoint बना लें, ताकि बदलाव वापस लिए जा सकें।

-ExecutionPolicy ByPass वाला हिस्सा सिर्फ़ उसी एक PowerShell प्रोसेस पर लागू होता है, इसलिए इंस्टॉल के लिए सिस्टम की स्क्रिप्ट पॉलिसी बदलने की ज़रूरत नहीं पड़ती। OpenAI का अपडेट कमांड भी यही है: नया वर्ज़न लेने के लिए इसे दोबारा चलाएँ।

इंस्टॉल के दूसरे विकल्प

  • npm: अगर Node.js है, तो npm install -g @openai/codex चलाएँ। अपडेट के लिए यही कमांड दोबारा चलाएँ।
  • ChatGPT desktop app: OpenAI के Windows दस्तावेज़ में ChatGPT desktop app के अंदर Codex का ज़िक्र है, जो Windows sandbox के साथ नेटिव रूप से चलता है। हमारी गाइड देखें: Windows के लिए ChatGPT desktop app।
  • WSL: अगर आपके काम में Linux टूल चाहिए, तो WSL 2 इस्तेमाल करें। OpenAI के मुताबिक़ Codex 0.115 से WSL 1 का सपोर्ट बंद हो गया।
  • macOS और Linux: curl -fsSL https://chatgpt.com/codex/install.sh | sh, या Homebrew: brew install --cask codex।

Windows sandbox, आसान शब्दों में

Codex अपने सुझाए कमांड एक Windows sandbox में चलाता है, जो तय करता है कि वह किन फ़ोल्डरों में लिख सकता है और नेटवर्क तक पहुँच सकता है या नहीं। OpenAI ने इसके तीन रूप बताए हैं:

  • mxc: संगत PC पर सुझाया गया। यह Microsoft Execution Containers इस्तेमाल करता है, जिन्हें Microsoft ने Windows 11 24H2 (build 26100.9278) और 25H2 (build 26200.9278) में शुरू किया। इसके लिए एडमिन सेटअप नहीं चाहिए।
  • elevated: MXC न मिले तो पसंदीदा विकल्प। इसके लिए एक बार का सेटअप चाहिए, जिसे एडमिनिस्ट्रेटर मंज़ूरी देता है।
  • unelevated: आख़िरी विकल्प, जिसमें नेटवर्क आइसोलेशन कमज़ोर है।

OpenAI चेतावनी देता है कि Codex को "full access" मोड में चलाने पर वह आपके प्रोजेक्ट फ़ोल्डर तक सीमित नहीं रहता और नुक़सानदेह बदलाव कर सकता है। sandbox चालू रखें।

समस्याएँ और हल

  • Sandbox setup failed: OpenAI के मुताबिक़ आम वजहें हैं: आपने UAC (एडमिन) प्रॉम्प्ट मना कर दिया, या कंपनी की पॉलिसी लोकल यूज़र बनाने, फ़ायरवॉल नियम बदलने या logon rights देने से रोकती है। दोबारा कोशिश करें और अनुमति हो तो प्रॉम्प्ट मंज़ूर करें। कंपनी के लैपटॉप पर IT टीम से पूछें। पॉलिसी अनुमति दे तो तब तक unelevated sandbox इस्तेमाल करें।
  • Windows error 1385: Windows, sandbox यूज़र्स को ज़रूरी logon type नहीं दे रहा। IT से logon rights जाँचने को कहें, और तब तक unelevated इस्तेमाल करें।
  • "Some folders are writable by Everyone": फ़ोल्डर की अनुमतियाँ इतनी खुली हैं कि sandbox उन्हें सुरक्षित नहीं रख सकता। ठीक लगे तो "Everyone" की write अनुमति हटाएँ, फिर Codex दोबारा शुरू करें।
  • कमांड नेटवर्क तक नहीं पहुँचते: कुछ मोड जान-बूझकर बिना नेटवर्क के चलते हैं। अगर नेटवर्क चाहिए था, तो Codex दोबारा शुरू करके फिर कोशिश करें।
  • npm.ps1 cannot be loaded because running scripts is disabled: यह npm वाले टूल्स में होता है। OpenAI के Windows app दस्तावेज़ में आम हल के रूप में Set-ExecutionPolicy -ExecutionPolicy RemoteSigned दिया गया है। बदलने से पहले Microsoft की execution policy गाइड पढ़ लें।
  • बग रिपोर्ट भेजना: OpenAI, CODEX_HOME/.sandbox/sandbox.log, आपका Windows build नंबर और सटीक एरर माँगता है। .sandbox-secrets की सामग्री कभी न भेजें।

Codex सिर्फ़ OpenAI के कमांड, npm पैकेज या GitHub releases से ही इंस्टॉल करें। किसी अनजान डाउनलोड साइट पर मिलने वाला "Codex CLI.exe" OpenAI का नहीं है।

Frequently asked questionsअक्सर पूछे जाने वाले सवाल

Is Codex CLI free?
The CLI is open source under the Apache-2.0 licence, but using it needs either a ChatGPT sign-in or an OpenAI API key. OpenAI's README names the Plus, Pro, Business, Edu and Enterprise plans. API-key use is billed at API rates.
क्या Codex CLI फ़्री है?
CLI, Apache-2.0 लाइसेंस के तहत ओपन सोर्स है, लेकिन इसे इस्तेमाल करने के लिए ChatGPT साइन-इन या OpenAI API key चाहिए। OpenAI के README में Plus, Pro, Business, Edu और Enterprise प्लान का नाम है। API key से इस्तेमाल पर API दरों से बिल बनता है।
Does Codex CLI work on Windows 10?
OpenAI calls a recent, fully updated Windows 10 "best effort": it can work but is less reliable than Windows 11. In practice it needs Windows 10 version 1809 or newer.
क्या Codex CLI, Windows 10 पर चलता है?
OpenAI नए और पूरी तरह अपडेटेड Windows 10 को "best effort" कहता है: यह चल सकता है, पर Windows 11 जितना भरोसेमंद नहीं। व्यवहार में इसके लिए Windows 10 version 1809 या नया चाहिए।
How do I update Codex CLI on Windows?
Run the same installer command again in a new PowerShell window. If you installed with npm, run npm install -g @openai/codex again.
Windows पर Codex CLI अपडेट कैसे करें?
नई PowerShell विंडो में वही इंस्टॉलर कमांड दोबारा चलाएँ। अगर npm से इंस्टॉल किया था, तो npm install -g @openai/codex फिर से चलाएँ।
Should I use Codex CLI or the ChatGPT desktop app?
Both run Codex on Windows with the same sign-in options. The CLI suits people who work in a terminal or want scripts and CI. The desktop app gives you a window with projects, parallel chats and a review pane.
Codex CLI इस्तेमाल करूँ या ChatGPT desktop app?
दोनों Windows पर Codex चलाते हैं और दोनों में साइन-इन के एक जैसे विकल्प हैं। CLI उनके लिए ठीक है जो टर्मिनल में काम करते हैं या स्क्रिप्ट और CI चाहते हैं। desktop app में प्रोजेक्ट, साथ-साथ कई चैट और review pane वाली विंडो मिलती है।

Sources

More guides

↑ ↓ to move · Enter to open · Esc to close