CodeVetter · Repo Unpack · Feature catalog
openai/codex
User-facing surface is the `codex` multitool plus the app-server JSON-RPC API and the SDK wrappers. Interactive mode is a full-screen TUI with composer, approval overlays, and slash commands. Headless mode is `codex exec` (and `codex review`) for scripts and CI. Account features cover ChatGPT device-code login, API-key login, and `codex login`. Tooling includes shell, unified exec, apply_patch, MCP servers, skills, web search, and an execpolicy command allow/deny language. Session features include resume, fork, compact, and forking a thread for review.
- `codex` with no subcommand starts the interactive TUI. `codex exec` (alias `e`) runs `codex_exec::run_main` for non-interactive prompts, with `--json` JSONL events, `--output-schema`, `--sandbox`, `--full-auto`, and image inputs.
- `codex resume` and `codex fork` reopen a rollout. Resume continues the selected session; fork copies history into a new thread id. Both are CLI subcommands that flow into core session startup with a rollout path.
- `codex mcp` serves the agent as an MCP server (`mcp serve`) and manages configured MCP servers (`mcp add`, `list`, `get`, `remove`). Server configs live in config.toml under `[mcp_servers.<id>]` with stdio or streamable HTTP transport.
- Login is `codex login` / `codex logout`. ChatGPT login uses a device-code or browser OAuth flow implemented in `codex-login`; API-key login stores a key in `auth.json` under `CODEX_HOME`. `codex login status` reports the active mode.
- Slash commands in the TUI are registered in `tui/src/slash_command.rs` (`SlashCommand` enum: model, personality, approvals, review, new, resume, fork, compact, diff, mention, mcp, skills, logout, quit, and others) and rendered by the composer popup.
- Approval modes are `untrusted`, `on-request`, and `never`, mapped to `AskForApproval`. Sandbox presets exposed to users are read-only, workspace-write, and danger-full-access. `--full-auto` selects workspace-write plus on-request (or never, depending on the preset path).
- The SDK `Thread` API mirrors app-server turns. `thread.start()` sends `thread/start`; `thread.run(prompt)` sends `turn/start` and yields streamed items (agent message, command execution, file change, mcp tool call, error). `CodexOptions` selects `apiKey`, `baseUrl`, `codexPathOverride`, and config overrides.
- Cloud/environment tasks are represented by `codex exec` environment options and the `environment` module, including `codex cloud` style tasks that delegate to a remote environment when configured. Local exec remains the default.
- `codex sandbox` can run a single command under the Linux/macOS sandbox helper for debugging policy, separate from an agent turn. The Linux helper binary is `codex-linux-sandbox`.