feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
[package]
|
|
|
|
|
name = "codex-tui"
|
2025-11-24 12:22:18 -08:00
|
|
|
version.workspace = true
|
|
|
|
|
edition.workspace = true
|
|
|
|
|
license.workspace = true
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
|
name = "codex-tui"
|
|
|
|
|
path = "src/main.rs"
|
|
|
|
|
|
|
|
|
|
[lib]
|
|
|
|
|
name = "codex_tui"
|
|
|
|
|
path = "src/lib.rs"
|
|
|
|
|
|
2025-08-04 21:23:22 -07:00
|
|
|
[features]
|
|
|
|
|
# Enable vt100-based tests (emulator) when running with `--features vt100-tests`.
|
|
|
|
|
vt100-tests = []
|
2025-08-12 17:37:28 -07:00
|
|
|
# Gate verbose debug logging inside the TUI implementation.
|
|
|
|
|
debug-logs = []
|
2025-08-04 21:23:22 -07:00
|
|
|
|
2025-05-08 09:46:18 -07:00
|
|
|
[lints]
|
|
|
|
|
workspace = true
|
|
|
|
|
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
[dependencies]
|
2025-09-22 18:47:01 +02:00
|
|
|
anyhow = { workspace = true }
|
|
|
|
|
base64 = { workspace = true }
|
|
|
|
|
chrono = { workspace = true, features = ["serde"] }
|
|
|
|
|
clap = { workspace = true, features = ["derive"] }
|
|
|
|
|
codex-ansi-escape = { workspace = true }
|
2025-11-06 10:44:42 -08:00
|
|
|
codex-app-server-protocol = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
codex-arg0 = { workspace = true }
|
2025-11-17 16:06:26 -08:00
|
|
|
codex-backend-client = { workspace = true }
|
2026-01-28 19:51:58 -08:00
|
|
|
codex-chatgpt = { workspace = true }
|
2026-01-30 12:03:29 +00:00
|
|
|
codex-cloud-requirements = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
codex-core = { workspace = true }
|
2025-11-06 10:44:42 -08:00
|
|
|
codex-feedback = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
codex-file-search = { workspace = true }
|
|
|
|
|
codex-login = { workspace = true }
|
2026-01-21 11:07:26 -08:00
|
|
|
codex-otel = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
codex-protocol = { workspace = true }
|
2026-01-29 10:23:03 +01:00
|
|
|
codex-state = { workspace = true }
|
2026-02-11 04:59:24 -08:00
|
|
|
codex-utils-approval-presets = { workspace = true }
|
2025-12-12 15:25:22 -08:00
|
|
|
codex-utils-absolute-path = { workspace = true }
|
2026-02-11 04:59:24 -08:00
|
|
|
codex-utils-cli = { workspace = true }
|
|
|
|
|
codex-utils-elapsed = { workspace = true }
|
|
|
|
|
codex-utils-fuzzy-match = { workspace = true }
|
|
|
|
|
codex-utils-oss = { workspace = true }
|
|
|
|
|
codex-utils-sandbox-summary = { workspace = true }
|
2026-02-13 18:31:39 +00:00
|
|
|
codex-utils-sleep-inhibitor = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
color-eyre = { workspace = true }
|
2025-11-06 10:44:42 -08:00
|
|
|
crossterm = { workspace = true, features = ["bracketed-paste", "event-stream"] }
|
2025-11-07 15:54:07 -08:00
|
|
|
derive_more = { workspace = true, features = ["is_variant"] }
|
2025-09-22 18:47:01 +02:00
|
|
|
diffy = { workspace = true }
|
2025-09-26 16:35:56 -07:00
|
|
|
dirs = { workspace = true }
|
2025-10-01 14:33:19 -07:00
|
|
|
dunce = { workspace = true }
|
2026-02-09 14:47:22 -08:00
|
|
|
image = { workspace = true, features = ["jpeg", "png", "gif", "webp"] }
|
2025-09-22 18:47:01 +02:00
|
|
|
itertools = { workspace = true }
|
|
|
|
|
lazy_static = { workspace = true }
|
2025-09-26 16:35:56 -07:00
|
|
|
pathdiff = { workspace = true }
|
|
|
|
|
pulldown-cmark = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
rand = { workspace = true }
|
|
|
|
|
ratatui = { workspace = true, features = [
|
2025-07-28 07:45:49 -07:00
|
|
|
"scrolling-regions",
|
2025-09-26 16:35:56 -07:00
|
|
|
"unstable-backend-writer",
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
"unstable-rendered-line-info",
|
2025-07-28 07:45:49 -07:00
|
|
|
"unstable-widget-ref",
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
] }
|
2025-10-20 14:40:14 -07:00
|
|
|
ratatui-macros = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
regex-lite = { workspace = true }
|
2025-11-17 14:49:09 -05:00
|
|
|
reqwest = { version = "0.12", features = ["json"] }
|
feat: replace custom mcp-types crate with equivalents from rmcp (#10349)
We started working with MCP in Codex before
https://crates.io/crates/rmcp was mature, so we had our own crate for
MCP types that was generated from the MCP schema:
https://github.com/openai/codex/blob/8b95d3e082376f4cb23e92641705a22afb28a9da/codex-rs/mcp-types/README.md
Now that `rmcp` is more mature, it makes more sense to use their MCP
types in Rust, as they handle details (like the `_meta` field) that our
custom version ignored. Though one advantage that our custom types had
is that our generated types implemented `JsonSchema` and `ts_rs::TS`,
whereas the types in `rmcp` do not. As such, part of the work of this PR
is leveraging the adapters between `rmcp` types and the serializable
types that are API for us (app server and MCP) introduced in #10356.
Note this PR results in a number of changes to
`codex-rs/app-server-protocol/schema`, which merit special attention
during review. We must ensure that these changes are still
backwards-compatible, which is possible because we have:
```diff
- export type CallToolResult = { content: Array<ContentBlock>, isError?: boolean, structuredContent?: JsonValue, };
+ export type CallToolResult = { content: Array<JsonValue>, structuredContent?: JsonValue, isError?: boolean, _meta?: JsonValue, };
```
so `ContentBlock` has been replaced with the more general `JsonValue`.
Note that `ContentBlock` was defined as:
```typescript
export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource;
```
so the deletion of those individual variants should not be a cause of
great concern.
Similarly, we have the following change in
`codex-rs/app-server-protocol/schema/typescript/Tool.ts`:
```
- export type Tool = { annotations?: ToolAnnotations, description?: string, inputSchema: ToolInputSchema, name: string, outputSchema?: ToolOutputSchema, title?: string, };
+ export type Tool = { name: string, title?: string, description?: string, inputSchema: JsonValue, outputSchema?: JsonValue, annotations?: JsonValue, icons?: Array<JsonValue>, _meta?: JsonValue, };
```
so:
- `annotations?: ToolAnnotations` ➡️ `JsonValue`
- `inputSchema: ToolInputSchema` ➡️ `JsonValue`
- `outputSchema?: ToolOutputSchema` ➡️ `JsonValue`
and two new fields: `icons?: Array<JsonValue>, _meta?: JsonValue`
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/10349).
* #10357
* __->__ #10349
* #10356
2026-02-02 17:41:55 -08:00
|
|
|
rmcp = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
serde = { workspace = true, features = ["derive"] }
|
|
|
|
|
serde_json = { workspace = true, features = ["preserve_order"] }
|
|
|
|
|
shlex = { workspace = true }
|
|
|
|
|
strum = { workspace = true }
|
|
|
|
|
strum_macros = { workspace = true }
|
|
|
|
|
supports-color = { workspace = true }
|
|
|
|
|
tempfile = { workspace = true }
|
|
|
|
|
textwrap = { workspace = true }
|
2025-12-22 15:12:23 -08:00
|
|
|
thiserror = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
tokio = { workspace = true, features = [
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
"io-std",
|
|
|
|
|
"macros",
|
|
|
|
|
"process",
|
|
|
|
|
"rt-multi-thread",
|
|
|
|
|
"signal",
|
2025-12-03 18:00:47 -08:00
|
|
|
"test-util",
|
|
|
|
|
"time",
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
] }
|
2025-12-16 01:14:03 -08:00
|
|
|
tokio-stream = { workspace = true, features = ["sync"] }
|
2025-10-16 11:23:38 -07:00
|
|
|
toml = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
tracing = { workspace = true, features = ["log"] }
|
|
|
|
|
tracing-appender = { workspace = true }
|
|
|
|
|
tracing-subscriber = { workspace = true, features = ["env-filter"] }
|
2025-11-06 10:44:42 -08:00
|
|
|
tree-sitter-bash = { workspace = true }
|
|
|
|
|
tree-sitter-highlight = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
unicode-segmentation = { workspace = true }
|
|
|
|
|
unicode-width = { workspace = true }
|
|
|
|
|
url = { workspace = true }
|
2026-02-10 09:59:43 -08:00
|
|
|
webbrowser = { workspace = true }
|
2026-01-30 10:40:09 +00:00
|
|
|
uuid = { workspace = true }
|
2025-05-16 11:33:08 -07:00
|
|
|
|
2025-11-06 10:44:42 -08:00
|
|
|
codex-windows-sandbox = { workspace = true }
|
2025-12-02 15:19:27 -08:00
|
|
|
tokio-util = { workspace = true, features = ["time"] }
|
2025-11-06 10:44:42 -08:00
|
|
|
|
2025-08-11 22:03:58 -07:00
|
|
|
[target.'cfg(unix)'.dependencies]
|
2025-09-22 18:47:01 +02:00
|
|
|
libc = { workspace = true }
|
2025-08-11 22:03:58 -07:00
|
|
|
|
2025-12-22 15:12:23 -08:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
|
|
|
which = { workspace = true }
|
|
|
|
|
windows-sys = { version = "0.52", features = [
|
|
|
|
|
"Win32_Foundation",
|
|
|
|
|
"Win32_System_Console",
|
|
|
|
|
] }
|
|
|
|
|
winsplit = "0.1"
|
|
|
|
|
|
2025-09-03 15:36:40 +09:00
|
|
|
# Clipboard support via `arboard` is not available on Android/Termux.
|
|
|
|
|
# Only include it for non-Android targets so the crate builds on Android.
|
|
|
|
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
2025-09-22 18:47:01 +02:00
|
|
|
arboard = { workspace = true }
|
2025-09-03 15:36:40 +09:00
|
|
|
|
2025-07-31 17:30:44 -07:00
|
|
|
|
2025-05-16 11:33:08 -07:00
|
|
|
[dev-dependencies]
|
2026-01-13 15:39:34 -08:00
|
|
|
codex-cli = { workspace = true }
|
2026-02-10 22:44:02 -08:00
|
|
|
codex-core = { workspace = true }
|
2026-01-13 15:39:34 -08:00
|
|
|
codex-utils-cargo-bin = { workspace = true }
|
|
|
|
|
codex-utils-pty = { workspace = true }
|
2025-10-05 14:12:31 -07:00
|
|
|
assert_matches = { workspace = true }
|
2025-09-22 18:47:01 +02:00
|
|
|
chrono = { workspace = true, features = ["serde"] }
|
|
|
|
|
insta = { workspace = true }
|
|
|
|
|
pretty_assertions = { workspace = true }
|
|
|
|
|
rand = { workspace = true }
|
2025-11-03 11:27:45 -08:00
|
|
|
serial_test = { workspace = true }
|
2025-11-06 10:44:42 -08:00
|
|
|
vt100 = { workspace = true }
|
2025-12-03 11:25:44 -08:00
|
|
|
uuid = { workspace = true }
|