Codex CLI: `codex exec` Gains Stdin Piping & App-Server TUI Reliability

Codex

Codex CLI 0.118.0 extends the codex exec subcommand with prompt-plus-stdin piping, enabling developers to feed file contents or command output directly into an agent task from the shell. The release also hardens the app-server TUI, resolving a batch of regressions that affected /copy, /resume, hook notifications, /agent stale-thread detection, and the skills-picker scroll. Windows users gain proxy-only sandbox networking, and operators running custom model providers can now supply dynamic bearer tokens that rotate without restarting the session.


New Features

codex exec Now Accepts Stdin Input

Codex CLI 0.118.0 extends the codex exec subcommand to accept both a prompt and piped stdin in a single invocation. Developers can now pipe the contents of a file, a command's output, or any arbitrary text stream directly into an agent task from the shell β€” for example, cat error.log | codex exec "diagnose this error". This unlocks scripting workflows where Codex agents can be composed into larger pipelines without requiring an interactive session.

Dynamic Bearer Tokens for Custom Model Providers

Operators who configure Codex to use a custom model provider (e.g., a self-hosted or third-party API endpoint) can now supply dynamic bearer tokens that are fetched or rotated at runtime. Previously, the token had to be set at startup; the new mechanism allows credentials to change without requiring a session restart, which is essential for short-lived tokens issued by enterprise identity systems.

Windows Sandbox: Proxy-Only Networking

On Windows, the sandbox environment now supports proxy-only networking. This gives enterprise deployments a way to restrict outbound traffic from sandboxed agents to go exclusively through an approved HTTP proxy, improving security posture in environments with strict egress controls.

Reliability Fixes

App-Server TUI Regression Batch

Version 0.118.0 resolves a set of regressions that had been affecting the app-server TUI mode since earlier releases:

  • /copy: The copy command was silently failing to place content on the clipboard; this is now fixed.
  • /resume: Resuming a previous session from the TUI no longer errors or drops context.
  • Hook notifications: Hooks that fire during a session (e.g., SessionStart, SessionStop, or custom user hooks) were not displaying their notifications in the TUI; notifications now surface correctly.
  • /agent stale thread detection: The /agent command was sometimes referencing stale or already-closed threads; the stale-thread detection logic has been corrected.
  • Skills picker scrolling: The skills picker overlay was not scrollable when the list of available skills exceeded the visible area; scrolling now works as expected.

MCP Startup Robustness

The MCP (Model Context Protocol) server startup sequence has been made more robust. Transient errors during MCP initialization β€” such as a slow-starting server or a brief network hiccup β€” are now handled gracefully rather than causing the session to abort.

Linux bwrap PATH Fix

On Linux systems that use bwrap (Bubblewrap) for sandboxing, an incorrect PATH was being constructed inside the sandbox, causing some commands to fail with "not found" errors. The PATH construction logic has been corrected so that standard system binaries are accessible from within the bwrap sandbox.