Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ In the codex-rs folder where the rust code lives:
- When writing tests, prefer comparing the equality of entire objects over fields one by one.
- When making a change that adds or changes an API, ensure that the documentation in the `docs/` folder is up to date if applicable.
- If you change `ConfigToml` or nested config types, run `just write-config-schema` to update `codex-rs/core/config.schema.json`.
- If you change Rust dependencies (`Cargo.toml` or `Cargo.lock`), run `just bazel-lock-update` from the
repo root to refresh `MODULE.bazel.lock`, and include that lockfile update in the same change.
- After dependency changes, run `just bazel-lock-check` from the repo root so lockfile drift is caught
locally before CI.
- Bazel does not automatically make source-tree files available to compile-time Rust file access. If
you add `include_str!`, `include_bytes!`, `sqlx::migrate!`, or similar build-time file or
directory reads, update the crate's `BUILD.bazel` (`compile_data`, `build_script_data`, or test
Expand Down
160 changes: 114 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,128 @@
<p align="center"><code>npm i -g @openai/codex</code><br />or <code>brew install --cask codex</code></p>
<p align="center"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer.
<p align="center">
<img src="https://github.com/openai/codex/blob/main/.github/codex-cli-splash.png" alt="Codex CLI splash" width="80%" />
</p>
</br>
If you want Codex in your code editor (VS Code, Cursor, Windsurf), <a href="https://developers.openai.com/codex/ide">install in your IDE.</a>
</br>If you want the desktop app experience, run <code>codex app</code> or visit <a href="https://chatgpt.com/codex?app-landing-page=true">the Codex App page</a>.
</br>If you are looking for the <em>cloud-based agent</em> from OpenAI, <strong>Codex Web</strong>, go to <a href="https://chatgpt.com/codex">chatgpt.com/codex</a>.</p>

---

## Quickstart

### Installing and running Codex CLI

Install globally with your preferred package manager:

```shell
# Install using npm
npm install -g @openai/codex
# Codex Enhanced

Codex Enhanced is a standalone public distribution of Codex focused on
multi-account ChatGPT operations, fullscreen TUI workflow improvements, and a
smaller long-term fork maintenance surface.

This repository is maintained as its own GitHub project instead of a GitHub
fork. It tracks upstream Codex where practical, while keeping product-specific
behavior behind a dedicated extension layer so future changes can converge on
plugins instead of repeated invasive rebases.

## Why This Version Exists

Upstream Codex already provides a strong local coding agent. The main problem
this project solves is operational:

- switching between multiple ChatGPT accounts should not require manual file
juggling
- rate-limit and usage-limit handling should be able to fail over to another
account automatically
- fullscreen TUI workflows should expose session and account operations in one
operator-facing control surface
- fork-specific behavior should move toward a stable extension boundary instead
of expanding the patch set in core runtime code

## What Is Included

- Managed account storage under `~/.codex/accounts`
- `codex login --auth <alias>` for capturing multiple ChatGPT logins into named
account slots
- Account pool metadata with stable IDs, aliases, cooldown state, and inferred
usage windows
- Threshold-based account routing and one-shot retry on explicit
limit/rejection failures for normal user turns in the fullscreen TUI path
- A `Ctrl-P` control panel with:
- global session picker
- account selection
- alias rename submenu
- current-session fork entry point
- A dedicated `codex-rs/ext` crate for fork-owned extension state and host
compatibility groundwork

## Current Scope

The current milestone is a practical MVP for daily use, not the final extension
architecture.

Implemented now:

- managed ChatGPT account registry and auth snapshot layout
- account activation and alias management in the TUI
- control-panel-driven session and account operations
- inferred cooldown recording from explicit limit errors
- login-time account registration

Planned next:

- broader automatic account routing coverage beyond the current fullscreen TUI
path
- observable switch reasons and richer operator status views
- hook/interceptor expansion
- capability-negotiated WASM plugins built on top of `codex-ext`

## Repository Layout

- [codex-rs/ext](./codex-rs/ext)
Fork-owned extension crate for account pool state, auth snapshots, and future
plugin host compatibility.
- [codex-rs/tui](./codex-rs/tui)
Fullscreen local TUI implementation.
- [codex-rs/tui_app_server](./codex-rs/tui_app_server)
App-server-backed TUI implementation that mirrors relevant UX changes.
- [docs/fork-extension-mvp.md](./docs/fork-extension-mvp.md)
Fork proposal, MVP design, and phased roadmap.

## Build And Run

Build the Rust CLI locally:

```bash
cd codex-rs
cargo build -p codex-cli
./target/debug/codex
```

```shell
# Install using Homebrew
brew install --cask codex
```
Install it into your shell path:

Then simply run `codex` to get started.
```bash
cd codex-rs
cargo build --release -p codex-cli
sudo ln -sf "$(pwd)/target/release/codex" /usr/local/bin/codex
codex --help
```

<details>
<summary>You can also go to the <a href="https://github.com/openai/codex/releases/latest">latest GitHub Release</a> and download the appropriate binary for your platform.</summary>
## Managed Account Quick Start

Each GitHub Release contains many executables, but in practice, you likely want one of these:
Register multiple ChatGPT logins into the managed account pool:

- macOS
- Apple Silicon/arm64: `codex-aarch64-apple-darwin.tar.gz`
- x86_64 (older Mac hardware): `codex-x86_64-apple-darwin.tar.gz`
- Linux
- x86_64: `codex-x86_64-unknown-linux-musl.tar.gz`
- arm64: `codex-aarch64-unknown-linux-musl.tar.gz`
```bash
codex login --auth primary
codex login --auth backup
codex login status
```

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.
Start Codex, then use:

</details>
- `Ctrl-P -> Sessions` to open the global session picker
- `Ctrl-P -> Accounts` to switch the active managed account
- `Ctrl-P -> Accounts -> Rename` to rename account aliases

### Using Codex with your ChatGPT plan
Managed account state is stored under:

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](https://help.openai.com/en/articles/11369540-codex-in-chatgpt).
```text
~/.codex/accounts/
├── account-pool.json
└── <account-id>/
└── auth.json
```

You can also use Codex with an API key, but this requires [additional setup](https://developers.openai.com/codex/auth#sign-in-with-an-api-key).
## Upstream Relationship

## Docs
This project is based on OpenAI Codex and keeps upstream history so changes can
be rebased and audited cleanly. The maintenance goal is to keep the fork-owned
delta small, explicit, and increasingly isolated behind `codex-ext`.

- [**Codex Documentation**](https://developers.openai.com/codex)
- [**Contributing**](./docs/contributing.md)
- [**Installing & building**](./docs/install.md)
- [**Open source fund**](./docs/open-source-fund.md)
## License

This repository is licensed under the [Apache-2.0 License](LICENSE).
This repository remains licensed under the [Apache-2.0 License](LICENSE).
2 changes: 1 addition & 1 deletion codex-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:24-slim
FROM node:25-slim

ARG TZ
ENV TZ="$TZ"
Expand Down
17 changes: 17 additions & 0 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions codex-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"hooks",
"secrets",
"exec",
"ext",
"exec-server",
"execpolicy",
"execpolicy-legacy",
Expand Down Expand Up @@ -110,6 +111,7 @@ codex-connectors = { path = "connectors" }
codex-config = { path = "config" }
codex-core = { path = "core" }
codex-exec = { path = "exec" }
codex-ext = { path = "ext" }
codex-exec-server = { path = "exec-server" }
codex-execpolicy = { path = "execpolicy" }
codex-experimental-api-macros = { path = "codex-experimental-api-macros" }
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ codex-config = { workspace = true }
codex-core = { workspace = true }
codex-exec = { workspace = true }
codex-execpolicy = { workspace = true }
codex-ext = { workspace = true }
codex-features = { workspace = true }
codex-login = { workspace = true }
codex-mcp-server = { workspace = true }
Expand Down Expand Up @@ -65,6 +66,7 @@ codex_windows_sandbox = { package = "codex-windows-sandbox", path = "../windows-
[dev-dependencies]
assert_cmd = { workspace = true }
assert_matches = { workspace = true }
base64 = { workspace = true }
codex-utils-cargo-bin = { workspace = true }
predicates = { workspace = true }
pretty_assertions = { workspace = true }
Expand Down
Loading
Loading