codex-rs is a Cargo workspace that builds the Rust implementation of the Codex CLI plus “server mode” frontends. The split is: types/protocol (codex-protocol), engine (codex-core), and adapters/UI (codex-cli, codex-tui, codex-exec, app-server, mcp-server).
core/(codex-core): the engine. Owns session state, model streaming, tool dispatch, sandboxing, approvals, rollouts, and config loading.protocol/(codex-protocol): the SQ/EQ message protocol between a UI/client and the engine. This is whereOp(inputs) andEvent/EventMsg(outputs) live (protocol/src/protocol.rs).cli/(codex-cli): thecodexmultitool binary. It routes to subcommands likecodex exec,codex mcp-server,codex app-server, etc (cli/src/main.rs).tui/(codex-tui): the fullscreen interactive UI (tui/src/lib.rs,tui/src/main.rs).