Ghi chú: Bản này mình folk về để update hướng dẫn tiếng Việt cho dễ dùng. Các bạn cần hỏi thì D.M https://t.me/tankisstank
codext = một CLI AI coding assistant chạy trong terminal giống Codex CLI, nhưng được Loongphy custom thêm nhiều tính năng:
quản lý nhiều account ChatGPT/Codex auto switch account khi rate limit auto resume task status bar mạnh hơn reload AGENTS.md tự động tối ưu workflow WSL/Linux tương thích codex-auth
Nó chủ yếu dành cho:
dev dùng Codex nhiều giờ/ngày nhiều account Plus/Team/Pro workflow terminal-first automation coding
Cài đặt với npm:
npm install -g @loongphy/codex-authHoặc cài đặt không dùng global:
npx @loongphy/codex-auth list- Install from npm:
npm i -g @loongphy/codext- Build from source:
cd codex-rs
cargo run --bin codexĐiểm mạnh chính
- Multi-account cực mạnh
Đây là feature quan trọng nhất.
Nó kết hợp với:
codex-authCho phép:
- lưu nhiều account
- switch nhanh
- auto switch khi quota hết
- xem usage từng account
Ví dụ:
codex-auth list
Switch:
codex-auth switch
Hoặc:
codex-auth switch 02
- Auto reload auth
codext sẽ monitor auth.json.
Khi account đổi:
- tự reload
- không cần restart CLI
- tự resume task dang dở
Đây là khác biệt lớn so với Codex gốc.
- Auto resume task
Khi account A hết quota:
- codext switch sang account B
- gửi prompt resume tự động
- tiếp tục coding
Prompt mặc định:
continue the previous coding task...
Có thể config custom hoặc disable.
- TUI mạnh hơn upstream
Header hiển thị:
- model
- effort
- cwd
- git status
- rate limits
Giống IDE mini trong terminal.
- AGENTS.md auto reload
Nó reload instruction file mỗi turn.
Hữu ích nếu bạn dùng:
- coding rules
- project conventions
- AI workflow docs
Rất hợp với:
- monorepo
- team workflow
- AI pair programming
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.
Tip
The icons requires Nerd Fonts installed and configured in your terminal.
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.
- Account Info: Email + Plan, API Key
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