core-agent-ide/codex-rs
Josh McKinney 4ed4c73d6b
chore(ci): add cargo audit workflow and policy (#7108)
- add to ignore current unmaintained advisories (derivative, fxhash,
paste) so audits gate new issues only
- introduce GitHub Actions workflow to run on push/PR using to install
cargo-audit

Existing advisories (all "unmaintained"):
- https://rustsec.org/advisories/RUSTSEC-2024-0388
- https://rustsec.org/advisories/RUSTSEC-2025-0057
- https://rustsec.org/advisories/RUSTSEC-2024-0436
2025-11-24 12:20:55 -08:00
..
.cargo chore(ci): add cargo audit workflow and policy (#7108) 2025-11-24 12:20:55 -08:00
.config fix flaky test: approval_matrix_covers_all_modes (#7028) 2025-11-20 14:37:42 -08:00
.github/workflows chore(ci): add cargo audit workflow and policy (#7108) 2025-11-24 12:20:55 -08:00
ansi-escape Fix transcript mode rendering issue when showing tab chars (#4911) 2025-10-08 11:42:09 -07:00
app-server fix(windows) support apply_patch parsing in powershell (#7221) 2025-11-24 19:32:47 +00:00
app-server-protocol [app-server] feat: expose gitInfo/cwd/etc. on Thread (#7060) 2025-11-21 10:37:12 -08:00
app-server-test-client [app-server] feat: v2 apply_patch approval flow (#6760) 2025-11-19 20:13:31 -08:00
apply-patch fix(windows) support apply_patch parsing in powershell (#7221) 2025-11-24 19:32:47 +00:00
arg0 Use codex-linux-sandbox in unified exec (#6480) 2025-11-10 17:17:09 -08:00
async-utils Support graceful agent interruption (#5287) 2025-10-17 18:52:57 +00:00
backend-client storing credits (#6858) 2025-11-19 10:49:35 -08:00
chatgpt chore: merge git crates (#5909) 2025-10-29 12:11:44 +00:00
cli execpolicycheck command in codex cli (#7012) 2025-11-20 16:44:31 -05:00
cloud-tasks Add test timeout (#6612) 2025-11-14 09:30:37 -08:00
cloud-tasks-client chore(deps): bump thiserror from 2.0.16 to 2.0.17 in /codex-rs (#4426) 2025-10-30 19:00:00 -07:00
codex-backend-openapi-models update credit status details (#6862) 2025-11-19 01:40:22 +00:00
common Fix/correct reasoning display (#6749) 2025-11-19 15:52:24 -08:00
core Allow enterprises to skip upgrade checks and messages (#7213) 2025-11-24 15:04:49 -05:00
docs Revert "[core] add optional status_code to error events (#6865)" (#6955) 2025-11-20 01:26:14 +00:00
exec support MCP elicitations (#6947) 2025-11-21 14:44:53 -08:00
exec-server feat: declare server capability in shell-tool-mcp (#7112) 2025-11-21 16:11:01 -08:00
execpolicy execpolicycheck command in codex cli (#7012) 2025-11-20 16:44:31 -05:00
execpolicy-legacy migrating execpolicy -> execpolicy-legacy and execpolicy2 -> execpolicy (#6956) 2025-11-19 19:14:10 -08:00
feedback [feedback] Add source info into feedback metadata. (#7140) 2025-11-24 19:05:37 +00:00
file-search Follow symlinks during file search (#4453) 2025-11-03 20:28:33 -08:00
keyring-store Fix FreeBSD/OpenBSD builds: target-specific keyring features and BSD hardening (#6680) 2025-11-17 05:07:34 +00:00
linux-sandbox refactor: inline sandbox type lookup in process_exec_tool_call (#7122) 2025-11-21 22:53:05 +00:00
lmstudio LM Studio OSS Support (#2312) 2025-11-17 11:49:09 -08:00
login [Auth] Choose which auth storage to use based on config (#5792) 2025-10-27 19:41:49 -07:00
mcp-server support MCP elicitations (#6947) 2025-11-21 14:44:53 -08:00
mcp-types [app-server] remove serde(skip_serializing_if = "Option::is_none") annotations (#5939) 2025-10-30 18:18:53 +00:00
ollama LM Studio OSS Support (#2312) 2025-11-17 11:49:09 -08:00
otel chore: drop model_max_output_tokens (#7100) 2025-11-21 17:42:54 +00:00
process-hardening fix: Fix build process-hardening build on NetBSD (#7238) 2025-11-24 11:46:43 -08:00
protocol [feedback] Add source info into feedback metadata. (#7140) 2025-11-24 19:05:37 +00:00
responses-api-proxy feat: add options to responses-api-proxy to support Azure (#6129) 2025-11-03 10:06:00 -08:00
rmcp-client feat: declare server capability in shell-tool-mcp (#7112) 2025-11-21 16:11:01 -08:00
scripts fix(scripts) next_minor_version should reset patch number (#7050) 2025-11-21 10:17:12 -08:00
stdio-to-uds feat: experimental codex stdio-to-uds subcommand (#5350) 2025-10-19 21:12:45 -07:00
tui fix: custom prompt expansion with large pastes (#7154) 2025-11-24 12:18:32 -08:00
utils Delete tiktoken-rs (#7018) 2025-11-20 11:15:04 -08:00
windows-sandbox-rs consolidate world-writable-directories scanning. (#7234) 2025-11-24 09:51:58 -08:00
.gitignore [MCP] Prefix MCP tools names with mcp__ (#5309) 2025-10-19 20:41:55 -04:00
Cargo.lock chore(deps): bump webbrowser from 1.0.5 to 1.0.6 in /codex-rs (#7225) 2025-11-24 12:03:10 -08:00
Cargo.toml chore(deps): bump libc from 0.2.175 to 0.2.177 in /codex-rs (#7224) 2025-11-24 12:02:48 -08:00
clippy.toml fix: switch rate limit reset handling to timestamps (#5304) 2025-10-17 17:39:37 -07:00
code Send text parameter for non-gpt-5 models (#4195) 2025-09-24 22:00:06 +00:00
config.md Fix link to MCP Servers config section (#5301) 2025-10-17 14:58:27 -07:00
default.nix Fix nix build (#6230) 2025-11-04 17:07:37 -08:00
justfile feat: add app-server-test-client crate for internal use (#5391) 2025-11-14 12:39:58 -08:00
README.md add codex debug seatbelt --log-denials (#4098) 2025-11-10 22:48:14 +00:00
rust-toolchain.toml chore: upgrade to Rust 1.90 (#4124) 2025-09-24 08:32:00 -07:00
rustfmt.toml Update cargo to 2024 edition (#842) 2025-05-07 08:37:48 -07:00

Codex CLI (Rust Implementation)

We provide Codex CLI as a standalone, native executable to ensure a zero-dependency install.

Installing Codex

Today, the easiest way to install Codex is via npm:

npm i -g @openai/codex
codex

You can also install via Homebrew (brew install --cask codex) or download a platform-specific release directly from our GitHub Releases.

Documentation quickstart

What's new in the Rust CLI

The Rust implementation is now the maintained Codex CLI and serves as the default experience. It includes a number of features that the legacy TypeScript CLI never supported.

Config

Codex supports a rich set of configuration options. Note that the Rust CLI uses config.toml instead of config.json. See docs/config.md for details.

Model Context Protocol Support

MCP client

Codex CLI functions as an MCP client that allows the Codex CLI and IDE extension to connect to MCP servers on startup. See the configuration documentation for details.

MCP server (experimental)

Codex can be launched as an MCP server by running codex mcp-server. This allows other MCP clients to use Codex as a tool for another agent.

Use the @modelcontextprotocol/inspector to try it out:

npx @modelcontextprotocol/inspector codex mcp-server

Use codex mcp to add/list/get/remove MCP server launchers defined in config.toml, and codex mcp-server to run the MCP server directly.

Notifications

You can enable notifications by configuring a script that is run whenever the agent finishes a turn. The notify documentation includes a detailed example that explains how to get desktop notifications via terminal-notifier on macOS.

codex exec to run Codex programmatically/non-interactively

To run Codex non-interactively, run codex exec PROMPT (you can also pass the prompt via stdin) and Codex will work on your task until it decides that it is done and exits. Output is printed to the terminal directly. You can set the RUST_LOG environment variable to see more about what's going on.

Experimenting with the Codex Sandbox

To test to see what happens when a command is run under the sandbox provided by Codex, we provide the following subcommands in Codex CLI:

# macOS
codex sandbox macos [--full-auto] [--log-denials] [COMMAND]...

# Linux
codex sandbox linux [--full-auto] [COMMAND]...

# Windows
codex sandbox windows [--full-auto] [COMMAND]...

# Legacy aliases
codex debug seatbelt [--full-auto] [--log-denials] [COMMAND]...
codex debug landlock [--full-auto] [COMMAND]...

Selecting a sandbox policy via --sandbox

The Rust CLI exposes a dedicated --sandbox (-s) flag that lets you pick the sandbox policy without having to reach for the generic -c/--config option:

# Run Codex with the default, read-only sandbox
codex --sandbox read-only

# Allow the agent to write within the current workspace while still blocking network access
codex --sandbox workspace-write

# Danger! Disable sandboxing entirely (only do this if you are already running in a container or other isolated env)
codex --sandbox danger-full-access

The same setting can be persisted in ~/.codex/config.toml via the top-level sandbox_mode = "MODE" key, e.g. sandbox_mode = "workspace-write".

Code Organization

This folder is the root of a Cargo workspace. It contains quite a bit of experimental code, but here are the key crates:

  • core/ contains the business logic for Codex. Ultimately, we hope this to be a library crate that is generally useful for building other Rust/native applications that use Codex.
  • exec/ "headless" CLI for use in automation.
  • tui/ CLI that launches a fullscreen TUI built with Ratatui.
  • cli/ CLI multitool that provides the aforementioned CLIs via subcommands.