BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Another Rust Rewrite: OpenAI’s Codex CLI Goes Native, Drops Node and TypeScript for Rust

Another Rust Rewrite: OpenAI’s Codex CLI Goes Native, Drops Node and TypeScript for Rust

Listen to this article -  0:00

OpenAI recently announced rewriting its Codex CLI in Rust. Codex CLI stack originally features React, TypeScript and Node. The rewrite seeks security and performance gains on top of improved developer experience.

The announcement explains the motivation for the rewrite as follows:

Our goal is to make the software pieces as efficient as possible and there were a few areas we wanted to improve:

  • Zero-dependency Install — currently Node v22+ is required, which is frustrating or a blocker for some users
  • Native Security Bindings — surprise! We already ship a Rust for Linux sandboxing since the bindings were available
  • Optimized Performance — no runtime garbage collection, resulting in lower memory consumption
  • Extensible Protocol — we’ve been working on a “wire protocol” for Codex CLI to allow developers to extend the agent in different languages (including Type/JavaScript, Python, etc) and MCPs (already supported in Rust)

Rust is a system language that prioritizes performance, memory usage, reliability, and resource consumption as design goals. Rust’s rich type system and ownership model guarantee memory safety and thread safety — thus eliminating many classes of bugs at compile-time. On the downside, Microsoft (which mandated the use of Rust for new developments that do not require garbage collection) developers reported a steep initial learning curve, and the reliance on some non-stabilized Rust features. While there are no further details at the moment, the ability to extend the Codex CLI with languages with a larger developer base such as JavaScript and Python will be key to community contributions.

Codex CLI’s Rust version is ongoing. The team continues work on the original TypeScript version in parallel to fix vulnerabilities until the Rust version reaches parity in terms of experience and functionality. Developers can try the new version as follows:

npm i -g @openai/codex@native
codex

Rust rewrites news are becoming commonplace, in particular for tooling in search of performance gains. Microsoft itself recently announced porting the TypeScript compiler to Rust with 10x performance improvement. There is additionally ongoing research to use Rust for safety-critical environments such as space onboard systems.

In the words of OpenAI, Codex is a cloud-based software engineering agent that can work on many tasks in parallel. Codex can perform tasks such as writing features, answering questions about a codebase, fixing bugs, and proposing pull requests for review; with each task running in its own sandbox environment.

Codex CLI is open source on GitHub and runs on MacOS, Linux, or Windows via WSL (Windows Subsystem for Linux).

About the Author

Rate this Article

Adoption
Style

BT
OSZAR »