DEV Community

Creeta
Creeta

Posted on • Originally published at news.creeta.com

Hand off any session to the GUI — Codex CLI 0.138.0

OpenAI's Codex CLI ships on a fast weekly cadence, and version 0.138.0 is a quiet but useful step for anyone wiring the terminal agent into a desktop or automation workflow. Here's what landed in this specific build — and why you should pin to it deliberately rather than assume it's the latest.

What 0.138.0 brings

Codex CLI 0.138.0 is an incremental quality and integration release — no new model, no pricing change, and no documented breaking change. It is tagged rust-v0.138.0 from commit c18e9f4 and ships with 141 release assets on GitHub . Treat it as a pinned-version reference, not the newest build: it sits in the middle of three releases in one week.

Version Release date Status
0.137.0 June 4, 2026 Prior build
0.138.0 June 8, 2026 This guide
0.139.0 June 9, 2026 Latest at writing

The dates above reflect the GitHub release timeline and changelog . The headline is desktop integration: a new /app command hands the active TUI thread off to Codex Desktop on macOS and native Windows, and Windows workspace launches can now open directly into Desktop instead of pausing at a manual prompt .

Three smaller changes matter for daily work. Local image file paths — for both attachments and standalone generations — are now surfaced to the model, so follow-up edits and references work without re-uploading. On auth, v2 personal access tokens are accepted in both CLI and app-server flows, and app-server integrations can read account-level token usage. Finally, the reasoning-effort selector gained fallback bindings for terminals that lack Alt-key shortcuts .

Before you begin

Three checks save time before you touch the installer. First, confirm access: Codex CLI requires a ChatGPT Plus, Pro, Business, Edu, or Enterprise plan, or a valid OpenAI API key . API-key mode is usage-based and local-focused — it excludes cloud features such as GitHub code review and Slack integration, so pick it only for CI-style workflows .

Second, check your build. Run codex --version; if it reports below 0.138.0 you can upgrade. Note that the installer always pulls the latest release — 0.139.0 was already the latest by June 9, 2026 — so if you need 0.138.0 exactly, pin a specific binary from the GitHub release assets .

Third, know your platform. macOS and Linux use the curl installer; Windows runs natively via PowerShell (Windows sandbox) or through WSL2 (Linux sandbox). The two Windows paths produce different sandbox behavior, covered below .

How to get 0.138.0

Installing is a four-step path: install for your OS, verify the version, then authenticate. The standalone installer is recommended on macOS and Linux, while Windows runs natively through PowerShell or via npm with the correct scope . Because the release cadence is weekly, confirm you actually landed on 0.138.0 before relying on the new /app hand-off.

  1. macOS / Linux: run curl -fsSL https://chatgpt.com/codex/install.sh | sh. Rerunning the same command upgrades in place; set CODEX_NON_INTERACTIVE=1 for unattended environments .
  2. Windows (PowerShell): run powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex", or install via npm with the scope: npm install -g @openai/codex. A bare npm install -g codex pulls an unrelated package — covered in the next section .
  3. Verify: codex --version should print 0.138.0, and codex login status exits 0 when valid credentials are present .
  4. Headless auth: pipe a key with printenv OPENAI_API_KEY | codex login --with-api-key, use codex login --device-auth for the OAuth device-code flow, or pass an access token via printenv CODEX_ACCESS_TOKEN | codex login --with-access-token .

Common stumbling blocks

Most 0.138.0 install and runtime failures trace to four predictable causes — the npm scope trap, AGENTS.md path resolution, Linux proxy socket length, and config-write errors that only now report their root cause. Each has a concrete check.

  • The npm scope trap. Installing the bare package name silently pulls an unrelated codex project, not OpenAI's CLI . Always use the full scoped form: npm install -g @openai/codex.
  • AGENTS.md not loading. Loading in remote or symlinked workspaces was broken before 0.138.0 and is fixed in this release . If it still fails post-upgrade, confirm the workspace root isn't inside a deep symlink chain resolving outside the project directory.
  • Linux proxy socket path errors. 0.138.0 shortened socket paths on Linux . If errors persist, verify the combined path stays under ~108 characters (the macOS limit is ~104).
  • Config-write failures. These now surface their underlying cause for the first time in 0.138.0 . If you see what reads like a new error, the root problem likely predates this version — the diagnostic message is new, not the bug.

Going further with 0.138.0

With a clean install running, the feature worth exercising first is the desktop hand-off. Open a session in the terminal, do some work — read a file, queue a plan, run a few edits — then type /app; the current thread transfers into Codex Desktop on macOS or native Windows without losing context . That is most useful for teams that switch between terminal and GUI depending on the task: triage and scripting in the shell, visual diff review in the app. For CI, the structured plugin commands are the practical win — codex plugins add <name> --json and codex plugins remove <name> --json emit JSONL you can pipe through jq, and the expanded fields now include marketplace source info for scriptable management .

One caveat before you pin this guide: 0.139.0 shipped June 9, 2026, one increment ahead . At this weekly cadence, behavioral details move fast — check its changelog against the steps here to see what shifted. The takeaway: 0.138.0 is a solid pin if you need the /app bridge and JSON plugin output today, but verify with codex --version before scripting against it.

Frequently asked questions

What subscription do I need to run Codex CLI 0.138.0?

Codex CLI 0.138.0 requires a ChatGPT Plus, Pro, Business, Edu, or Enterprise plan, or an API key . There is no free tier. API-key mode is usage-based and suits CI-style local workflows, but it excludes cloud features such as GitHub code review and Slack integration . Pick subscription sign-in if you want the full cloud surface.

How do I confirm I'm on Codex CLI 0.138.0 and not an older build?

Run codex --version and check the string against 0.138.0, which GitHub tags as rust-v0.138.0 and dates to June 8, 2026 . If you are below it, rerun the standalone installer or npm install -g @openai/codex to upgrade . Validate credentials separately with codex login status, which exits 0 when a valid session is present .

What does the /app command do in 0.138.0?

The /app slash command — new in 0.138.0 — hands the active terminal thread to Codex Desktop on macOS or native Windows . Session context transfers mid-thread, so there is no restart and no copy-paste; you continue the same conversation in the GUI. On Windows, workspace launches can now open directly into Desktop instead of stopping at a manual prompt .

Why is resume --last faster in 0.138.0?

Earlier builds scanned full session history to find the most recent thread; 0.138.0 replaces that with a direct state-DB lookup, accelerating resume --last on large histories . The difference is most noticeable on archives with dozens of saved sessions. The same release also sped up large MCP and Ollama streams and long message histories through optimized byte scanning .

Can I run Codex CLI 0.138.0 in CI without interactive prompts?

Yes. Set CODEX_NON_INTERACTIVE=1 for unattended runs, authenticate non-interactively with printenv OPENAI_API_KEY | codex login --with-api-key, then drive work through codex exec --sandbox workspace-write and capture the result with --output-last-message . For headless OAuth instead of a key, codex login --device-auth uses the device-code flow, and the never approval policy keeps CI/CD pipelines from blocking on prompts .

Top comments (0)