Recently, technology media Dev Class reported that OpenAI announced the migration of its AI programming tool, Codex CLI, from the original Node.js architecture to a rewrite in Rust. This decision has drawn significant attention from the industry, especially for technical developers and users, as the addition of Rust may bring about many unexpected advantages.
Codex CLI is an experimental AI programming tool developed by OpenAI. Users can operate it through the ChatGPT web interface or a local command line. It adopts a chat-style user interface, supporting interactive input commands and silent operation in non-interactive mode, suitable for scenarios like continuous delivery, such as generating update logs. Currently, Codex CLI has been open-sourced on GitHub and supports macOS, Linux, and Windows via WSL.
Source: Image generated by AI, provided by Midjourney
When asked about the reasons for the rewrite, maintainer Fouad Matin stated that while the TypeScript and Node.js version was developed rapidly and easy to iterate, the introduction of Rust would bring four main advantages. First, Rust achieves zero dependency installation, eliminating the need for users to install Node.js separately, thus solving installation obstacles for some users. Second, Rust stands out in terms of security. The new version of Codex CLI will be able to run in sandboxed environments, using Apple Seatbelt on macOS and Landlock technology on Linux, further enhancing security.
Third, Rust language offers excellent performance optimization, avoiding runtime garbage collection and reducing memory requirements. Finally, Rust also supports the existing Model Context Protocol (MCP), enabling Codex CLI to function as both an MCP client and server simultaneously. Although Rust's learning curve is relatively steep, its efficient features and powerful system language advantages make it the better choice.
As development of the new version progresses, the original TypeScript version will continue to fix vulnerabilities until the Rust version reaches parity in terms of experience and functionality. For developers at large, this is undoubtedly exciting news.