Skip to content
 
 

Latest commit

 

History

6,799 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Hướng dẫn tiếng Việt về cách sử dụng:

Codext là gì

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

Bước 1: Cài codex-auth

Cài đặt với npm:

npm install -g @loongphy/codex-auth

Hoặc cài đặt không dùng global:

npx @loongphy/codex-auth list

Bước 2: Cài đặt codext

  • Install from npm:
npm i -g @loongphy/codext
  • Build from source:
cd codex-rs
cargo run --bin codex

Bước 3: Sử dụng

Điểm mạnh chính

  1. Multi-account cực mạnh

Đây là feature quan trọng nhất.

Nó kết hợp với:

codex-auth

Cho 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
  1. 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.

  1. 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.

  1. TUI mạnh hơn upstream

Header hiển thị:

  • model
  • effort
  • cwd
  • git status
  • rate limits

Giống IDE mini trong terminal.

  1. 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

Codext

An opinionated Codex CLI. This is strictly a personal hobby project, forked from openai/codex.

Preview

Quick Start

Choose one of these two ways:

  • Install from npm:
npm i -g @loongphy/codext
  • Build from source:
cd codex-rs
cargo run --bin codex

Features

Full change log: see CHANGED.md.


TUI: Status Header

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

Status Header Preview

Copy to Clipboard

  • 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.

Prompt Queue on usage limit

Prompt Queue

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 Tab to 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.

Account Switching

Account Changed

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.json for 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, and turn/start when 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.

Automatic Resumption

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 auto reload

AGENTS.md and project-doc instructions are refreshed on each new user turn, and Codex shows an explicit warning when a refresh is applied.

Project Goals

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]
Loading

Skills

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

Credits

Status bar design reference: https://linux.do/t/topic/1481797

About

An opinionated Codex CLI with better DX

Resources

Contributing

Security policy

Stars

18 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages