Updating the Codex CLI and pinning it in CI

Codex ships a stable release every few days and pre-releases most days. That cadence is a feature on your laptop and a liability in a pipeline, and the two deserve opposite policies rather than one habit applied everywhere.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Run codex update to self-update, or use the command for your install route: re-run the standalone installer, npm install -g @openai/codex, or brew upgrade --cask codex. Check with codex --version. In CI and container images install an exact version so a behavior change arrives as a commit you can revert. Checked against OpenAI sources in August 2026.

What you need to know
  • codex update self-updates when the installed release supports it.
  • Otherwise use your route: re-run the installer, npm install -g @openai/codex, or brew upgrade --cask codex.
  • codex --version before you report anything. Most bugs are already fixed.
  • Pin exactly in CI and images. Bump the pin as its own reviewable commit.
  • The release train is fast: 0.146.1 on 5 August 2026, 0.147.0 on 7 August 2026.
  • Before blaming a release, check whether it is actually the sandbox.

Updating

The one command that works regardless of route, when the build supports it.
codex update
codex --version

Per-route commands, checked against the OpenAI docs in August 2026.

Installed withUpdate withNotes
Standalone installer (macOS, Linux)curl -fsSL https://chatgpt.com/codex/install.sh | shThe install command and the update command are the same command
Standalone installer (Windows)irm https://chatgpt.com/codex/install.ps1 | iexSame again, from PowerShell
npmnpm install -g @openai/codexNot npm update; a plain install pulls the current release
Homebrew (macOS)brew upgrade --cask codexCodex is a cask, not a formula
GitHub Release binaryDownload the new archiveFor pinned or air-gapped installs
Unattended update inside a provisioning script.
curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh

Knowing what you are running

Four questions, four commands.
# what version
codex --version

# which binary, when two install routes overlap
which -a codex

# full health report: install, config, auth, runtime, git, terminal
codex doctor

# what exists on npm
npm view @openai/codex versions --json | tail -20

The release cadence, so you can calibrate

As of August 2026, stable releases land every few days and pre-releases most days. 0.146.1 published on 5 August 2026, 0.147.0 on 7 August 2026, with alpha builds in between. Two consequences follow from that rhythm and neither is optional.

  • On a laptop, staying current is cheap and being stale is expensive. An install left alone for two months is missing dozens of fixes, and you will spend the time you saved debugging one of them.
  • In a pipeline, an unpinned agent means the tool that produced yesterday's result is not the one running today. A regression becomes impossible to bisect, because nothing on your side changed.

Pinning

CI: an exact version, never a range.
npm install -g @openai/codex@0.147.0
codex --version
Images: the version is a build argument so bumping it shows in the diff.
FROM node:22-bookworm-slim
ARG CODEX_VERSION=0.147.0
RUN apt-get update && apt-get install -y --no-install-recommends \
      git ca-certificates ripgrep bubblewrap \
    && rm -rf /var/lib/apt/lists/*
RUN npm install -g @openai/codex@${CODEX_VERSION}

Two environments, two policies.

EnvironmentPolicyWhy
Your laptopTrack the current releaseFixes land constantly; being stale costs more than churn
CI and pre-merge checksPin exactlyA result has to be attributable to a commit
Container imagesPin exactly, as a build argThe image is the reproducibility boundary
A shared team boxPin, bump on a scheduleOne person updating should not surprise four others

Bump the pin on a schedule, as its own commit with nothing else in it. Then a behavior change arrives inside something you can revert, instead of appearing on a Tuesday with no corresponding change on your side.

What an update does not touch

Updating replaces a binary. It does not replace your configuration, and that is worth being explicit about because the failure modes on either side of that line look identical from the outside.

What lives where, and what survives an update.

PathHoldsSurvives an update
~/.codex/config.tomlSettings, profiles, MCP servers, feature flagsYes
~/.codex/auth.jsonCached credential, unless you use the OS keyringYes
~/.codex/sessions/JSONL transcripts of every runYes
The codex binaryThe agent itselfReplaced, which is the point
After an update, when a setting appears to have stopped working.
# inside a session: prints config layer order, lowest precedence first,
# plus any managed policy that is overriding you
/debug-config

# feature flags persisted in $CODEX_HOME/config.toml
codex features

Most "the update broke my config" reports turn out to be a profile, a project-level .codex/config.toml, or a managed requirements layer taking precedence over the file you edited. The layer dump answers that in one screen, and it is a much shorter path than reinstalling.

Rolling back

The npm route is the one with real version control over it.
npm install -g @openai/codex@0.146.1
codex --version

Before blaming a release, in order.

CheckHowWhat it rules out
Versioncodex --versionYou are not on the release you think you are
Which binarywhich -a codexA second stale install shadowing the new one
Overall healthcodex doctorInstall, auth, git and terminal problems
Effective config/debug-configA profile or managed layer overriding your file
Is it the sandbox?Run once with --sandbox danger-full-accessA policy failure masquerading as a regression
Is it the service?The OpenAI status pageA provider incident that has nothing to do with you

Deprecations worth knowing before you upgrade

Behavior that changed under you, as of August 2026.

ChangeWhat to do
codex exec --full-auto is a deprecated compatibility flag and warnsUse --sandbox workspace-write explicitly
approval_policy = "on-failure" is deprecatedon-request interactively, never non-interactively
WSL1 support ended at Codex 0.115Convert the distro to WSL2, or run natively on Windows
The Linux sandbox moved to bubblewrapInstall the bubblewrap package on Linux hosts

Questions people ask

Run codex update if your build supports self-update. Otherwise use the command for your install route: re-run the standalone installer script, npm install -g @openai/codex, or brew upgrade --cask codex. Confirm with codex --version.

codex --version. Worth doing before reporting a bug, because releases land every few days and the answer is often that it is already fixed.

Install an exact version with npm install -g @openai/codex@x.y.z, or commit the DotSlash file from the GitHub Release so every contributor gets the same executable. Pin in CI and images, not on laptops.

Install the earlier version explicitly from npm, for example npm install -g @openai/codex@0.146.1. Homebrew and the standalone installer both track the current release, so neither has a clean downgrade path.

Fast. As of August 2026 stable versions land every few days, with pre-releases most days: 0.146.1 published on 5 August 2026 and 0.147.0 on 7 August 2026.

Whether it is actually the sandbox. Run once with the restrictions removed. If the failure disappears, it is a policy problem and the fix is --add-dir, a writable_roots entry, or enabling network access for that run, not a rollback.

For CI and container images, yes. For laptops, no. An old install quietly accumulates missing fixes and the eventual debugging cost exceeds the churn it avoided.

Almost always a Homebrew cask alongside an old npm global install. Run which -a codex to see both. Remove the one you do not want rather than depending on PATH order.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. openai/codex on GitHub
  2. OpenAI Codex documentation
  3. Codex developer commands reference
  4. Codex environment variables
Try it

Attributable
behaviour.

Continuum records the agent and model each session ran, so a change in behaviour is traceable to a date.

free app · your subscriptions · local-first