Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

34.2 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
<!-- Google tag (gtag.js), Google Ads AW-18388216863. Loaded only when Do Not Track is
     off, so it follows the same rule as the PostHog block on this site. -->
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){ dataLayer.push(arguments); }
  if (navigator.doNotTrack !== '1') {
    var gtagScript = document.createElement('script');
    gtagScript.async = true;
    gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=AW-18388216863';
    document.head.appendChild(gtagScript);
    gtag('js', new Date());
    gtag('config', 'AW-18388216863');
  }
</script>

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Codex CLI: What It Is and How to Install It on Mac, Windows and Linux — Munder Difflin Blog</title>
<meta name="description" content="Codex CLI is OpenAI&#39;s open source coding agent for the terminal. Install it on Mac, Windows or Linux, sign in, update it, check the version or remove it." />
<link rel="canonical" href="https://munderdiffl.in/blog/how-to-install-codex-cli/" />

<link rel="icon" type="image/png" href="https://munderdiffl.in/logo.png" />
<link rel="apple-touch-icon" href="https://munderdiffl.in/logo.png" />
<meta name="theme-color" content="#F5F2E8" />

<!-- Open Graph -->
<meta property="og:site_name" content="Munder Difflin Blog" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Codex CLI: What It Is and How to Install It on Mac, Windows and Linux — Munder Difflin Blog" />
<meta property="og:description" content="Codex CLI is OpenAI&#39;s open source coding agent for the terminal. Install it on Mac, Windows or Linux, sign in, update it, check the version or remove it." />
<meta property="og:url" content="https://munderdiffl.in/blog/how-to-install-codex-cli/" />
<meta property="og:image" content="https://munderdiffl.in/blog/assets/media/how-to-install-codex-cli/hero.png" />
<meta property="og:image:width" content="1600" />
<meta property="og:image:height" content="900" />
<meta property="og:image:alt" content="Hand drawn sketch: a yellow character at a desk with a terminal window, labelled npm, brew or script, and install, sign in, update" />
<meta property="og:locale" content="en_US" />
<meta property="article:published_time" content="2026-09-14T00:00:00.000Z" />
<meta property="article:author" content="Chaitanya Giri" />
<meta property="article:tag" content="Guides" />
<meta property="article:tag" content="Codex" />
<meta property="article:tag" content="Getting Started" />
<meta property="article:tag" content="Engines" />


<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Codex CLI: What It Is and How to Install It on Mac, Windows and Linux — Munder Difflin Blog" />
<meta name="twitter:description" content="Codex CLI is OpenAI&#39;s open source coding agent for the terminal. Install it on Mac, Windows or Linux, sign in, update it, check the version or remove it." />
<meta name="twitter:image" content="https://munderdiffl.in/blog/assets/media/how-to-install-codex-cli/hero.png" />
<meta name="twitter:image:alt" content="Hand drawn sketch: a yellow character at a desk with a terminal window, labelled npm, brew or script, and install, sign in, update" />

<link rel="alternate" type="application/atom+xml" title="Munder Difflin Blog" href="https://munderdiffl.in/blog/feed.xml" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,[email protected],500;9..144,600;9..144,700;9..144,900&amp;family=Source+Serif+4:opsz,[email protected],400;8..60,600;8..60,700&amp;family=Space+Grotesk:wght@500;600;700&amp;family=JetBrains+Mono:wght@400;600&amp;display=swap" rel="stylesheet" />
<link rel="stylesheet" href="/blog/assets/blog-press.css" />

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Codex CLI: What It Is and How to Install It on Mac, Windows and Linux",
  "description": "Codex CLI is OpenAI's open source coding agent for the terminal. Install it on Mac, Windows or Linux, sign in, update it, check the version or remove it.",
  "image": ["https://munderdiffl.in/blog/assets/media/how-to-install-codex-cli/hero.png"],
  "datePublished": "2026-09-14T00:00:00.000Z",
  "dateModified": "2026-09-29T00:00:00.000Z",
  "author": { "@type": "Person", "name": "Chaitanya Giri" },
  "publisher": {
    "@type": "Organization",
    "name": "Munder Difflin",
    "logo": { "@type": "ImageObject", "url": "https://munderdiffl.in/logo.png" }
  },
  "mainEntityOfPage": { "@type": "WebPage", "@id": "https://munderdiffl.in/blog/how-to-install-codex-cli/" },
  "keywords": "codex cli, how to install codex cli, codex cli install, install codex cli, codex install, how to install codex, what is codex cli",
  "articleSection": "Guides",
  "inLanguage": "en-US",
  "url": "https://munderdiffl.in/blog/how-to-install-codex-cli/"
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://munderdiffl.in/" },
    { "@type": "ListItem", "position": 2, "name": "Blog", "item": "https://munderdiffl.in/blog/" },
    { "@type": "ListItem", "position": 3, "name": "Codex CLI: What It Is and How to Install It on Mac, Windows and Linux", "item": "https://munderdiffl.in/blog/how-to-install-codex-cli/" }
  ]
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    { "@type": "Question", "name": "Is Codex CLI free?", "acceptedAnswer": { "@type": "Answer", "text": "The CLI is free and open source under the Apache-2.0 licence, but the model calls behind it need a ChatGPT plan or an OpenAI API key. OpenAI's Codex pricing page lists Free, Go, Plus and Pro for individuals, checked 29 Sep 2026, so a free ChatGPT account can sign in. An API key bills per use instead." } },
    { "@type": "Question", "name": "Do I need Node.js to install Codex CLI?", "acceptedAnswer": { "@type": "Answer", "text": "Only if you install it with npm. The @openai/codex package declares Node 16 or newer in its engines field, checked on the npm registry on 29 Sep 2026. The standalone script, the Windows PowerShell installer and the Homebrew cask all download a prebuilt binary, so they need no Node at all." } },
    { "@type": "Question", "name": "What is the difference between Codex CLI and the Codex app?", "acceptedAnswer": { "@type": "Answer", "text": "Codex CLI runs in your terminal; the Codex app is OpenAI's desktop app with its own window. Both come from OpenAI and sign in with the same ChatGPT account. Running codex app from the CLI launches the desktop app, or opens its installer if it is missing." } },
    { "@type": "Question", "name": "Why does npm install -g codex install the wrong thing?", "acceptedAnswer": { "@type": "Answer", "text": "The unscoped codex package on npm is an unrelated documentation generator, not OpenAI's agent. OpenAI publishes the CLI under its own scope, so the command is npm install -g @openai/codex. If you already installed the wrong one, remove it with npm uninstall -g codex first." } },
    { "@type": "Question", "name": "How do I log in to Codex CLI on a server with no browser?", "acceptedAnswer": { "@type": "Answer", "text": "Run codex login with the device auth flag, open the link it prints on any device with a browser, and enter the one time code. OpenAI marks device code login as beta, and it has to be enabled first: in your ChatGPT security settings on a personal account, or by a workspace admin on a work account. The fallbacks are copying the cached auth.json across over SSH, or forwarding port 1455 so the normal browser login works." } }
    
  ]
}
</script>


<script>
  // Anonymous blog analytics (PostHog) — same posture as the main site and the
  // app's TELEMETRY.md: public write-only token ('' = inert), anonymous-only
  // (person_profiles 'never'), no autocapture/recording, DNT respected.
  (function () {
    var PH_KEY = 'phc_qJzsokwcbtTGHemnvywR3nSqivNNgMjHeNVEWkZNydFB';
    if (!PH_KEY || navigator.doNotTrack === '1') return;
    var s = document.createElement('script');
    s.async = true;
    s.src = 'https://us-assets.i.posthog.com/static/array.js';
    s.onload = function () {
      if (!window.posthog) return;
      window.posthog.init(PH_KEY, {
        api_host: 'https://us.i.posthog.com',
        person_profiles: 'never',
        autocapture: false,
        before_send: function (event) {
          // PostHog fills $ip from the connection unless the event carries one.
          // Null it here and disable the GeoIP lookup so no IP, city, postal
          // code or lat/long is ever derived or stored for this page view.
          if (event && event.properties) {
            event.properties.$ip = null;
            event.properties.$geoip_disable = true;
          }
          return event;
        },
        disable_session_recording: true,
        respect_dnt: true
      });
    };
    document.head.appendChild(s);
  })();
</script>
</head>
<body class="theme-press">
<a class="skip-link" href="#main">Skip to content</a>
<nav id="nav">
  <a class="brand" href="https://munderdiffl.in" aria-label="Munder Difflin home">
    <img class="brand-logo" src="https://munderdiffl.in/logo.png" width="1318" height="840" alt="Munder Difflin, Inc. — Multi-Agent Harness" />
  </a>
  <span class="spacer"></span>
  <div class="links">
    <a href="/blog/">Latest</a>
    <a href="/blog/topics/">Topics</a>
    <a href="/blog/about/">About</a>
    <a href="https://munderdiffl.in">↗ Product</a>
  </div>
  <div class="nav-actions">
    <a class="btn sm" href="https://munderdiffl.in/blog/feed.xml" aria-label="RSS feed">⤵ RSS</a>
    <a class="btn sm primary" href="https://munderdiffl.in/#install">⤓ Download</a>
  </div>
</nav>

<main id="main">

<article class="t-guides">
  <header class="post-head wrap">
    <nav class="crumbs" aria-label="Breadcrumb">
      <a href="/blog/">Blog</a>
      <span>/</span>
      <a href="/blog/topics/guides/">Guides</a>
    </nav>
    <h1>Codex CLI: What It Is and How to Install It on Mac, Windows and Linux</h1>
    <p class="dek">Codex CLI is OpenAI&#39;s open source coding agent for the terminal. Install it on Mac, Windows or Linux, sign in, update it, check the version or remove it.</p>
    <div class="byline">
      <span class="av" aria-hidden="true">MD</span>
      <strong>Chaitanya Giri</strong>
      <span class="dot" aria-hidden="true">·</span>
      <time datetime="2026-09-14">Sep 14, 2026</time>
      <span class="dot" aria-hidden="true">·</span>
      <span>7 min read</span>
      <span class="tag kind">Guides</span>
    </div>
  </header>

  <div class="hero-wrap wrap"><figure class="fig fig-hero"><img src="/blog/assets/media/how-to-install-codex-cli/hero.png" alt="Hand drawn sketch: a yellow character at a desk with a terminal window, labelled npm, brew or script, and install, sign in, update" loading="lazy" decoding="async" /></figure></div>

  <div class="post-wrap wrap">
    <div class="prose">
      <p>Codex CLI is OpenAI’s open source coding agent for the terminal, and you install it with one command: <code>curl -fsSL https://chatgpt.com/codex/install.sh | sh</code> on macOS or Linux, or OpenAI’s PowerShell installer on Windows. npm and Homebrew work too. Then run <code>codex</code> in a project, sign in with ChatGPT or an API key, and check <code>codex --version</code>.</p>
<p>You can do all of this by hand, or use <a href="https://harnessmd.com/download">Munder Difflin</a>, free and open source, a desktop app that runs Codex agents next to Claude Code and other CLIs on one screen. As of Munder Difflin 0.5.3, onboarding marks Codex as INSTALLED or INSTALLS ON FIRST RUN. If <code>codex</code> is missing when a Codex agent starts, the app runs <code>npm install -g @openai/codex</code> in that agent’s terminal, installing Node first when npm is absent and a Node installer is available (otherwise it falls back to a manual step), then relaunches the agent. Each Codex agent gets its own <code>CODEX_HOME</code> that links your <code>~/.codex/auth.json</code> and seeds its settings from your <code>config.toml</code>, so your terminal login carries over and your own <code>~/.codex</code> stays as it was. The <a href="/blog/how-to-install-and-use-munder-difflin/">Munder Difflin install guide</a> covers that setup.</p>
<h2 id="what-is-codex-cli" tabindex="-1">What is Codex CLI? <a class="anchor" href="#what-is-codex-cli" aria-hidden="true">#</a></h2>
<p>Codex CLI is OpenAI’s coding agent that runs locally in your terminal: you describe a change, and it reads your repository, edits files and runs commands within the permissions you give it.</p>
<p>The source lives at <a href="https://github.com/openai/codex">openai/codex on GitHub</a> under the Apache-2.0 licence. It’s written in Rust, so the standalone install is a native binary rather than a Node app. Plain <code>codex</code> opens the interactive terminal UI, and the same binary scripts well: <code>codex exec</code> runs a task non interactively (handy in CI), <code>codex review</code> reviews your changes, <code>codex resume</code> picks up an earlier session, and <code>codex mcp</code> connects outside tools over MCP.</p>
<p>“Codex” also names three other OpenAI products, which is where most confusion starts:</p>
<ul>
<li><strong>The Codex app</strong>, a desktop app. <code>codex app</code> launches it, or opens its installer if it’s missing.</li>
<li><strong>The Codex IDE extension</strong> for VS Code, Cursor and Windsurf.</li>
<li><strong>Codex Web</strong>, the cloud agent at <a href="http://chatgpt.com/codex">chatgpt.com/codex</a>, which works in the browser instead of on your machine.</li>
</ul>
<p>And one thing that isn’t OpenAI’s at all: the unscoped <code>codex</code> package on npm, an unrelated documentation generator. For how the four OpenAI products fit together, and which ChatGPT plans include each one, see <a href="/blog/what-is-codex/">what is Codex</a>.</p>
<h2 id="which-codex-cli-install-method-should-i-use" tabindex="-1">Which Codex CLI install method should I use? <a class="anchor" href="#which-codex-cli-install-method-should-i-use" aria-hidden="true">#</a></h2>
<p>Use the standalone installer unless you already manage your tools with Homebrew or npm. It needs no Node, and updating is just running it again. Checked on 29 Sep 2026, when the current stable release was <a href="https://github.com/openai/codex/releases/tag/rust-v0.158.0">0.158.0, published on GitHub on 28 Sep 2026 (UTC)</a>; npm and Homebrew both served 0.158.0 the same day.</p>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Method</th>
<th>Platforms</th>
<th>Needs Node?</th>
<th>Installs <code>codex</code> to</th>
<th>Update with</th>
</tr>
</thead>
<tbody>
<tr>
<td>Standalone script</td>
<td>macOS, Linux</td>
<td>No</td>
<td><code>~/.local/bin</code></td>
<td>Rerun the script</td>
</tr>
<tr>
<td>PowerShell installer</td>
<td>Windows (x64, ARM64)</td>
<td>No</td>
<td><code>%LOCALAPPDATA%\Programs\OpenAI\Codex\bin</code></td>
<td>Rerun the installer</td>
</tr>
<tr>
<td>Homebrew cask</td>
<td>macOS, Linux</td>
<td>No</td>
<td>Homebrew’s prefix</td>
<td><code>brew upgrade --cask codex</code></td>
</tr>
<tr>
<td>npm</td>
<td>macOS, Linux, Windows</td>
<td>Node 16+</td>
<td>npm’s global folder</td>
<td><code>npm install -g @openai/codex</code></td>
</tr>
</tbody>
</table>
</div>
<p>Pick the script if you want the fewest moving parts. Pick Homebrew if every other tool on the machine already comes from <code>brew</code>. Pick npm if Node is already how you install developer tools, or your company mirrors the npm registry.</p>
<h2 id="how-do-i-install-codex-cli-on-mac-or-linux" tabindex="-1">How do I install Codex CLI on Mac or Linux? <a class="anchor" href="#how-do-i-install-codex-cli-on-mac-or-linux" aria-hidden="true">#</a></h2>
<p>Run OpenAI’s standalone installer, which downloads a prebuilt binary, so there’s nothing to set up first:</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">curl</span> <span class="token parameter variable">-fsSL</span> https://chatgpt.com/codex/install.sh <span class="token operator">|</span> <span class="token function">sh</span></code></pre>
<p>We read the script again on 29 Sep 2026. It detects Apple Silicon, Intel Macs and x64 or ARM64 Linux, puts <code>codex</code> in <code>~/.local/bin</code>, and keeps each release under <code>~/.codex/packages/standalone/releases</code>. If that folder isn’t on your <code>PATH</code>, it adds a block marked <code># &gt;&gt;&gt; Codex installer &gt;&gt;&gt;</code> to your shell profile and prints the <code>export PATH</code> line for the terminal you’re in. <code>CODEX_INSTALL_DIR</code> changes the target folder, and <code>--release</code> pins a version:</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">curl</span> <span class="token parameter variable">-fsSL</span> https://chatgpt.com/codex/install.sh <span class="token operator">|</span> <span class="token function">sh</span> <span class="token parameter variable">-s</span> -- <span class="token parameter variable">--release</span> <span class="token number">0.157</span>.1</code></pre>
<p>The script also looks for an existing Homebrew or npm copy, warns that “PATH order decides which one runs”, and offers to uninstall the other one. Pick one method and stay with it.</p>
<figure class="fig fig-inline"><img src="/blog/assets/media/how-to-install-codex-cli/note-1.png" alt="Hand drawn sketch: a character at a desk typing into a terminal" loading="lazy" decoding="async" /></figure>
<p>Prefer a package manager? OpenAI’s README lists both:</p>
<pre class="language-bash"><code class="language-bash">brew <span class="token function">install</span> <span class="token parameter variable">--cask</span> codex      <span class="token comment"># Homebrew</span>
<span class="token function">npm</span> <span class="token function">install</span> <span class="token parameter variable">-g</span> @openai/codex   <span class="token comment"># npm</span></code></pre>
<p>The npm package declares Node 16 or newer in its <code>engines</code> field (npm registry, checked 29 Sep 2026). Some guides ask for Node 18 or 22; that’s stricter than the package itself. Mind the scope: <code>npm install -g codex</code> without <code>@openai/</code> installs somebody else’s project entirely.</p>
<h2 id="how-do-i-install-codex-cli-on-windows" tabindex="-1">How do I install Codex CLI on Windows? <a class="anchor" href="#how-do-i-install-codex-cli-on-windows" aria-hidden="true">#</a></h2>
<p>Open PowerShell and run OpenAI’s Windows installer, which installs a native <code>codex.exe</code> with no WSL needed:</p>
<pre class="language-powershell"><code class="language-powershell">powershell <span class="token operator">-</span>ExecutionPolicy ByPass <span class="token operator">-</span>c <span class="token string">"irm https://chatgpt.com/codex/install.ps1 | iex"</span></code></pre>
<p>The script puts the command in <code>%LOCALAPPDATA%\Programs\OpenAI\Codex\bin</code> and adds that folder to your user <code>Path</code>, so open a new PowerShell window afterwards. The repo’s own requirements table still lists Windows 11 via WSL2, but the README now leads with this native installer. If your repositories already live in WSL2, run the Linux command from the previous section inside your WSL shell instead, so Codex works right next to your code.</p>
<h2 id="how-do-i-sign-in-to-codex-cli" tabindex="-1">How do I sign in to Codex CLI? <a class="anchor" href="#how-do-i-sign-in-to-codex-cli" aria-hidden="true">#</a></h2>
<p>Run <code>codex</code> in a project folder and pick Sign in with ChatGPT, which opens a browser and hands the login back to the terminal. OpenAI’s <a href="https://learn.chatgpt.com/docs/auth">authentication docs</a> say the credentials are cached in <code>~/.codex/auth.json</code> by default, or in your OS credential store if you set <code>cli_auth_credentials_store</code>. Treat that file like a password. <code>codex login status</code> shows which method is active.</p>
<p>For CI, or to pay per use at API rates, pipe an API key in:</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">printenv</span> OPENAI_API_KEY <span class="token operator">|</span> codex login --with-api-key</code></pre>
<p>On a server with no browser, <code>codex login --device-auth</code> prints a link and a one time code to enter on any other device. It’s in beta and has to be enabled first: in your ChatGPT security settings on a personal account, or by a workspace admin in workspace permissions. The docs also describe two fallbacks: copy <code>auth.json</code> across over SSH, or forward <code>localhost:1455</code> so the normal browser flow works.</p>
<figure class="fig fig-inline"><img src="/blog/assets/media/how-to-install-codex-cli/note-2.png" alt="Hand drawn sketch: a character carrying a letter towards a box" loading="lazy" decoding="async" /></figure>
<h2 id="is-codex-cli-free" tabindex="-1">Is Codex CLI free? <a class="anchor" href="#is-codex-cli-free" aria-hidden="true">#</a></h2>
<p>The CLI itself is free and open source, but the model calls behind it need a ChatGPT plan or an API key. OpenAI’s <a href="https://learn.chatgpt.com/docs/pricing">Codex pricing page</a> lists Free, Go, Plus and Pro (in 5x and 20x usage tiers) for individuals, Business, Enterprise and Edu for teams, and API key billing for pay per use (checked 29 Sep 2026). The same page carries a notice worth knowing before you settle on a model: GPT-5.5 retires from ChatGPT and Codex on all plans on 14 Oct 2026, while the API is not affected.</p>
<h2 id="how-do-i-update-codex-cli" tabindex="-1">How do I update Codex CLI? <a class="anchor" href="#how-do-i-update-codex-cli" aria-hidden="true">#</a></h2>
<p>Rerun the command you installed with, except on Homebrew, where it’s <code>brew upgrade --cask codex</code>. <code>codex --help</code> also lists an <code>update</code> command, described as “Update Codex to the latest version”.</p>
<p>This is the step people skip. Here is the Mac this post was written on, on 29 Sep 2026:</p>
<pre class="language-text"><code class="language-text">$ codex --version
codex-cli 0.153.4
$ ls ~/.codex/packages/standalone/releases
0.137.0-aarch64-apple-darwin
0.153.4-aarch64-apple-darwin</code></pre>
<p>Since 0.153.4, OpenAI has shipped eight stable releases, from 0.154.0 on 9 Sep to 0.158.0 on 28 Sep, with alpha builds landing most days in between. Falling behind takes no effort at all. The listing also shows that old builds stay in the releases folder after an update, so 0.137.0 is still on disk.</p>
<h2 id="how-do-i-check-which-codex-cli-version-i-have" tabindex="-1">How do I check which Codex CLI version I have? <a class="anchor" href="#how-do-i-check-which-codex-cli-version-i-have" aria-hidden="true">#</a></h2>
<p>Run <code>codex --version</code>, which prints <code>codex-cli</code> followed by the version number. If the shell can’t find <code>codex</code> right after installing, open a new terminal so the updated <code>PATH</code> loads. If the version looks stale after an update, you probably have two installs: <code>which -a codex</code> lists them in the order your shell tries them. For anything stranger, <code>codex doctor</code> checks the installation, config, auth and runtime health in one report.</p>
<h2 id="how-do-i-uninstall-codex-cli" tabindex="-1">How do I uninstall Codex CLI? <a class="anchor" href="#how-do-i-uninstall-codex-cli" aria-hidden="true">#</a></h2>
<p>Uninstall with the tool you installed with: <code>npm uninstall -g @openai/codex</code> or <code>brew uninstall --cask codex</code>. The standalone script has no uninstall option, so remove what it created (paths from the script, read on 29 Sep 2026):</p>
<pre class="language-bash"><code class="language-bash"><span class="token function">rm</span> ~/.local/bin/codex
<span class="token function">rm</span> ~/.local/bin/codex-code-mode-host   <span class="token comment"># macOS only</span>
<span class="token function">rm</span> <span class="token parameter variable">-rf</span> ~/.codex/packages/standalone</code></pre>
<p>Then delete the <code># &gt;&gt;&gt; Codex installer &gt;&gt;&gt;</code> block from your shell profile if the script added one. On Windows, delete <code>%LOCALAPPDATA%\Programs\OpenAI\Codex\bin</code> and <code>%USERPROFILE%\.codex\packages\standalone</code>, and take the bin folder out of your user <code>Path</code>. Leave the rest of <code>~/.codex</code> alone unless you want a clean slate: it holds your config, your login and your saved sessions.</p>
<p>Once it runs, <a href="/blog/codex-cli-vs-claude-code/">Codex CLI vs Claude Code</a> explains the sandbox and approval flags you’ll meet on your first task, and <a href="/blog/run-a-mixed-engine-office/">running a mixed engine office</a> shows where a Codex agent fits next to other CLIs.</p>


      
      <section class="faq" aria-label="Frequently asked questions">
        <h2 id="faq">FAQ</h2>
        
        <div class="qa">
          <p class="q">Is Codex CLI free?</p>
          <p class="a">The CLI is free and open source under the Apache-2.0 licence, but the model calls behind it need a ChatGPT plan or an OpenAI API key. OpenAI&#39;s Codex pricing page lists Free, Go, Plus and Pro for individuals, checked 29 Sep 2026, so a free ChatGPT account can sign in. An API key bills per use instead.</p>
        </div>
        
        <div class="qa">
          <p class="q">Do I need Node.js to install Codex CLI?</p>
          <p class="a">Only if you install it with npm. The @openai/codex package declares Node 16 or newer in its engines field, checked on the npm registry on 29 Sep 2026. The standalone script, the Windows PowerShell installer and the Homebrew cask all download a prebuilt binary, so they need no Node at all.</p>
        </div>
        
        <div class="qa">
          <p class="q">What is the difference between Codex CLI and the Codex app?</p>
          <p class="a">Codex CLI runs in your terminal; the Codex app is OpenAI&#39;s desktop app with its own window. Both come from OpenAI and sign in with the same ChatGPT account. Running codex app from the CLI launches the desktop app, or opens its installer if it is missing.</p>
        </div>
        
        <div class="qa">
          <p class="q">Why does npm install -g codex install the wrong thing?</p>
          <p class="a">The unscoped codex package on npm is an unrelated documentation generator, not OpenAI&#39;s agent. OpenAI publishes the CLI under its own scope, so the command is npm install -g @openai/codex. If you already installed the wrong one, remove it with npm uninstall -g codex first.</p>
        </div>
        
        <div class="qa">
          <p class="q">How do I log in to Codex CLI on a server with no browser?</p>
          <p class="a">Run codex login with the device auth flag, open the link it prints on any device with a browser, and enter the one time code. OpenAI marks device code login as beta, and it has to be enabled first: in your ChatGPT security settings on a personal account, or by a workspace admin on a work account. The fallbacks are copying the cached auth.json across over SSH, or forwarding port 1455 so the normal browser login works.</p>
        </div>
        
      </section>
      

      
      <hr />
      <div class="share">
        <span class="lbl">Tags</span>
        <a class="tag" href="/blog/tags/guides/">Guides</a><a class="tag" href="/blog/tags/codex/">Codex</a><a class="tag" href="/blog/tags/getting-started/">Getting Started</a><a class="tag" href="/blog/tags/engines/">Engines</a>
      </div>
      
    </div>

    
    <aside class="toc-rail" aria-label="Table of contents">
      <div class="tt">On this page</div>
      <ol>
        <li class="lvl-2"><a href="#what-is-codex-cli">What is Codex CLI?</a></li><li class="lvl-2"><a href="#which-codex-cli-install-method-should-i-use">Which Codex CLI install method should I use?</a></li><li class="lvl-2"><a href="#how-do-i-install-codex-cli-on-mac-or-linux">How do I install Codex CLI on Mac or Linux?</a></li><li class="lvl-2"><a href="#how-do-i-install-codex-cli-on-windows">How do I install Codex CLI on Windows?</a></li><li class="lvl-2"><a href="#how-do-i-sign-in-to-codex-cli">How do I sign in to Codex CLI?</a></li><li class="lvl-2"><a href="#is-codex-cli-free">Is Codex CLI free?</a></li><li class="lvl-2"><a href="#how-do-i-update-codex-cli">How do I update Codex CLI?</a></li><li class="lvl-2"><a href="#how-do-i-check-which-codex-cli-version-i-have">How do I check which Codex CLI version I have?</a></li><li class="lvl-2"><a href="#how-do-i-uninstall-codex-cli">How do I uninstall Codex CLI?</a></li>
      </ol>
    </aside>
    
  </div>

  <footer class="post-foot wrap"><div class="prevnext">
      <a class="pn prev" href="/blog/is-claude-code-max-worth-it/"><span class="k">← Older</span><span class="t">Claude Max Plan: Is It Worth It? Max 5x vs 20x vs Pro</span></a>
      <a class="pn next" href="/blog/how-to-connect-ollama-to-claude-code/"><span class="k">Newer →</span><span class="t">How to Connect Ollama to Claude Code</span></a>
    </div>
    <section class="related">
      <h2>Related in Guides</h2>
      <div class="post-grid">
        <article class="card t-guides">
  <a class="thumb t-guides" href="/blog/claude-md-best-practices/" aria-hidden="true" tabindex="-1"><img src="/blog/assets/media/claude-md-best-practices/hero.png" alt="" loading="lazy" decoding="async" /></a>
  <div class="body">
    <div class="meta">
      <time datetime="2026-10-26">Oct 26, 2026</time>
      <span class="dot" aria-hidden="true"></span>
      <span>4 min</span>
    </div>
    <h3><a href="/blog/claude-md-best-practices/">CLAUDE.md Best Practices: What to Write, Where It Lives, How Long (Oct 2026)</a></h3>
    <p class="dek">CLAUDE.md best practices from Anthropic&#39;s docs, checked 26 Oct 2026: what to put in it, where each file lives, the 200 line target and how AGENTS.md loads.</p>
    <div class="foot">
      <span class="tag kind">Guides</span>
      <a class="more" href="/blog/claude-md-best-practices/" aria-label="Read: CLAUDE.md Best Practices: What to Write, Where It Lives, How Long (Oct 2026)">Read →</a>
    </div>
  </div>
</article>
<article class="card t-guides">
  <a class="thumb t-guides" href="/blog/codex-computer-use/" aria-hidden="true" tabindex="-1"><img src="/blog/assets/media/codex-computer-use/hero.png" alt="" loading="lazy" decoding="async" /></a>
  <div class="body">
    <div class="meta">
      <time datetime="2026-10-26">Oct 26, 2026</time>
      <span class="dot" aria-hidden="true"></span>
      <span>4 min</span>
    </div>
    <h3><a href="/blog/codex-computer-use/">Codex Computer Use: How to Turn It On, Plans and Limits (Oct 2026)</a></h3>
    <p class="dek">Codex computer use lets the ChatGPT desktop app see and click apps on macOS and Windows. Setup, which plans get it, locked use and how Claude&#39;s compares.</p>
    <div class="foot">
      <span class="tag kind">Guides</span>
      <a class="more" href="/blog/codex-computer-use/" aria-label="Read: Codex Computer Use: How to Turn It On, Plans and Limits (Oct 2026)">Read →</a>
    </div>
  </div>
</article>
<article class="card t-guides">
  <a class="thumb t-guides" href="/blog/cursor-pricing/" aria-hidden="true" tabindex="-1"><img src="/blog/assets/media/cursor-pricing/hero.png" alt="" loading="lazy" decoding="async" /></a>
  <div class="body">
    <div class="meta">
      <time datetime="2026-10-26">Oct 26, 2026</time>
      <span class="dot" aria-hidden="true"></span>
      <span>5 min</span>
    </div>
    <h3><a href="/blog/cursor-pricing/">Cursor Pricing (Oct 2026): Every Plan After the 12 Oct Change</a></h3>
    <p class="dek">Cursor pricing as of 26 Oct 2026: Free, Plus $8, Premium $30, Super $100, Ultra $200, Teams seats, what changed on 12 Oct and what old plans keep.</p>
    <div class="foot">
      <span class="tag kind">Guides</span>
      <a class="more" href="/blog/cursor-pricing/" aria-label="Read: Cursor Pricing (Oct 2026): Every Plan After the 12 Oct Change">Read →</a>
    </div>
  </div>
</article>

      </div>
    </section>
    
  </footer>
</article>

</main>
<footer class="site-foot">
  <div class="wrap">
    <div class="foot-top">
      <a class="foot-brand brand" href="https://munderdiffl.in" aria-label="Munder Difflin home">
        <img class="brand-logo" src="https://munderdiffl.in/logo.png" width="1318" height="840" alt="Munder Difflin, Inc. — Multi-Agent Harness" />
      </a>
      <div class="foot-links">
        <a href="/blog/">Latest</a>
        <a href="/blog/topics/">Topics</a>
        <a href="/blog/about/">About</a>
        <a href="https://munderdiffl.in/blog/feed.xml">RSS</a>
        <a href="https://github.com/chaitanyagiri/munder-difflin">GitHub</a>
        <a href="https://munderdiffl.in">munderdiffl.in ↗</a>
      </div>
    </div>
    <div class="foot-meta">
      © 2026 Munder Difflin · Local-first · MIT-licensed ·
      Built on <a href="https://munderdiffl.in">Electron, React, Pixi.js, xterm.js &amp; node-pty</a>.
      Run an office of agents while you sleep.
    </div>
  </div>
</footer>

<script>
  // sticky-nav border on scroll
  (function () {
    var nav = document.getElementById('nav');
    if (!nav) return;
    var onScroll = function () { nav.classList.toggle('scrolled', window.scrollY > 8); };
    onScroll(); window.addEventListener('scroll', onScroll, { passive: true });
  })();
  // YouTube click-to-load: thumbnail button → youtube-nocookie iframe
  (function () {
    document.addEventListener('click', function (e) {
      var btn = e.target.closest('.yt-load');
      if (!btn) return;
      var box = btn.closest('.yt');
      var id = box && box.getAttribute('data-yt');
      // Only an 11 character YouTube video id may reach the iframe URL.
      if (!id || !/^[A-Za-z0-9_-]{11}$/.test(id)) return;
      var frame = document.createElement('iframe');
      frame.src = 'https://www.youtube-nocookie.com/embed/' + encodeURIComponent(id) + '?autoplay=1';
      frame.title = box.getAttribute('data-title') || 'YouTube video';
      frame.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share';
      frame.setAttribute('allowfullscreen', '');
      box.replaceChildren(frame);
    });
  })();
</script>

</body>
</html>