## Why Follow-up to #16379. `codex-rs/core/src/tools/spec.rs` and the corresponding handlers still owned several pure tool-definition helpers even though they do not need `codex-core` runtime state. Keeping that spec-only logic in `codex-core` keeps the crate boundary blurry and works against the guidance in `AGENTS.md` to keep shared tooling out of `codex-core` when possible. This change takes another step toward a dedicated `codex-tools` crate by moving more metadata and schema-building code behind the `codex-tools` API while leaving the actual tool execution paths in `codex-core`. ## What Changed - Added `codex-rs/tools/src/apply_patch_tool.rs` to own `ApplyPatchToolArgs`, the freeform/json `apply_patch` tool specs, and the moved `tool_apply_patch.lark` grammar. - Updated `codex-rs/tools/BUILD.bazel` so Bazel exposes the moved grammar file to `codex-tools`. - Moved the `request_user_input` availability and description helpers into `codex-rs/tools/src/request_user_input_tool.rs`, with the related unit tests moved alongside that business logic. - Moved `request_permissions_tool_description()` into `codex-rs/tools/src/local_tool.rs`. - Rewired `codex-rs/core/src/tools/spec.rs`, `codex-rs/core/src/tools/handlers/apply_patch.rs`, and `codex-rs/core/src/tools/handlers/request_user_input.rs` to consume the new `codex-tools` exports instead of local helper code. - Removed the now-redundant helper implementations and tests from `codex-core`, plus a couple of stale `client_common` re-exports that became unused after the move. ## Testing - `cargo test -p codex-tools` - `cargo test -p codex-core tools::spec::tests` - `cargo test -p codex-core tools::handlers::apply_patch::tests`
npm i -g @openai/codex
or brew install --cask codex
Codex CLI is a coding agent from OpenAI that runs locally on your computer.
If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE.
If you want the desktop app experience, run
codex app or visit the Codex App page.
If you are looking for the cloud-based agent from OpenAI, Codex Web, go to chatgpt.com/codex.
Quickstart
Installing and running Codex CLI
Install globally with your preferred package manager:
# Install using npm
npm install -g @openai/codex
# Install using Homebrew
brew install --cask codex
Then simply run codex to get started.
You can also go to the latest GitHub Release and download the appropriate binary for your platform.
Each GitHub Release contains many executables, but in practice, you likely want one of these:
- macOS
- Apple Silicon/arm64:
codex-aarch64-apple-darwin.tar.gz - x86_64 (older Mac hardware):
codex-x86_64-apple-darwin.tar.gz
- Apple Silicon/arm64:
- Linux
- x86_64:
codex-x86_64-unknown-linux-musl.tar.gz - arm64:
codex-aarch64-unknown-linux-musl.tar.gz
- x86_64:
Each archive contains a single entry with the platform baked into the name (e.g., codex-x86_64-unknown-linux-musl), so you likely want to rename it to codex after extracting it.
Using Codex with your ChatGPT plan
Run codex and select Sign in with ChatGPT. We recommend signing into your ChatGPT account to use Codex as part of your Plus, Pro, Team, Edu, or Enterprise plan. Learn more about what's included in your ChatGPT plan.
You can also use Codex with an API key, but this requires additional setup.
Docs
This repository is licensed under the Apache-2.0 License.
