An opinionated Codex CLI. This is strictly a personal hobby project, forked from openai/codex.
Choose one of these two ways:
- Install from npm:
npm i -g @loongphy/codext- Build from source:
cd codex-rs
cargo run --bin codexFull change log: see CHANGED.md.
The TUI header provides a compact overview of the active session:
- Context: Displays the active model, effort level, and current working directory (
cwd). - Git Status: Background-polled summary of the repository state for the session
cwd. - Rate Limits: ChatGPT usage-limit snapshots that refresh while the UI is idle.
Ctrl+Shift+C: Copies the current draft to the system clipboard.Ctrl+C: Retains existing behavior; remains backward-compatible with legacy logic when the draft is empty.
This feature helps manage follow-up messages when quota or rate limits are reached:
- Paused and Waiting: Queued messages wait instead of being sent into more failed turns.
- Append While Limited: Even while autosend is paused, you can still press
Tabto add messages to the queue. - Resume on Availability: Once a later rate-limit snapshot shows quota is available again, Codext sends the first queued message.
Codex now reloads authentication after external auth.json writes settle, so account changes can be picked up without restarting at safe boundaries.
- TUI: Watches
auth.jsonfor changes via filesystem notifications, with trailing debounce so reloads happen after writes settle. Auth is deferred until any active task completes; transient read errors do not clear cached auth. - App-server: Reloads auth before
thread/start,thread/resume, andturn/startwhen no turn is running, so the new account is picked up at the next safe request boundary.
This enables auth refresh for TUI and Codex App flows when external tools update auth.json.
It also supports Codex App account switching via codex-auth#103.
After a turn stops on UsageLimitExceeded, the TUI can park a recovery prompt and dispatch it after a later auth.json reload changes account identity.
You can configure this behavior using [tui].usage_limit_resume_prompt:
-
Custom Prompt: Define a specific string to be sent as the "resumption turn." This prompt will be used to signal the model to continue where it left off.
-
Disable: Set to
""(empty string) to disable this automatic recovery behavior entirely. -
Default: If left unset, the system uses the following built-in prompt:
Please continue from where the conversation left off after the usage limit reset or account switch.Example:
[tui] usage_limit_resume_prompt = ""
AGENTS.md and project-doc instructions are refreshed on each new user turn, and Codex shows an explicit warning when a refresh is applied.
We will never merge code from the upstream repo; instead, we re-implement our changes on top of the latest upstream code.
Iteration flow (aligned with .agents/skills/codex-upstream-reapply):
flowchart TD
A[Fetch upstream tags] --> B[Choose latest stable rust tag]
B --> C[Create fresh branch from tag]
C --> D[Generate old-branch reference bundle]
D --> E[Read intent docs and old changes<br/>CHANGED.md / README.md / AGENTS.md<br/>bundle diff / changed-files / commits]
E --> F[Re-implement required changes on fresh branch]
F --> G[Build: cargo build -p codex-cli]
G --> H[Review final diff against tag]
H --> I[Push finished branch]
When syncing to the latest upstream codex version, use .agents/skills/codex-upstream-reapply to re-implement our custom requirements on top of the newest code, avoiding merge conflicts from the old branch history.
Example:
$codex-upstream-reapply old_branch feat/rust-v0.130.0, new origin tag: rust-v0.131.0
Status bar design reference: https://linux.do/t/topic/1481797


