實作指南 / 10 分鐘
安裝 Codex 並證明工具鏈正常
從可辨識的 binary、明確版本與可重複診斷開始。
可靠的 Codex 工作流從第一個 prompt 之前就開始。使用官方 standalone installer,確認實際執行的 binary 與版本,刻意更新,並用內建診斷報告處理 config、auth、Git 或 terminal 問題,而不是猜測。
CLI
已驗證 Terminal Sequence
- $
curl -fsSL https://chatgpt.com/codex/install.sh | sh - $
irm https://chatgpt.com/codex/install.ps1 | iex - $
codex --version - $
codex update - $
codex doctor
A
工作原則
辨識 executable
Alias 與多種安裝方式可能指向不同 binary;先記錄真正執行的 command 與版本。
刻意更新
只有支援 self-update 的 release 才使用 codex update;更新後重新檢查版本敏感行為。
分層診斷
codex doctor 盤點 installation、config、auth、runtime、Git、terminal、app-server 與 threads。
B
實地程序
- 01
使用官方 installer
macOS/Linux 的 POSIX shell 使用 install.sh;Windows PowerShell 使用 install.ps1。第一次保留互動提示以看清 path 變更。
- 02
確認版本
在實際工作會用的 shell 執行 codex --version。
- 03
檢查 command discovery
找不到 Codex 時先重新開 terminal 與檢查 PATH,不要立刻再裝一份。
- 04
產生診斷報告
執行 codex doctor,先修第一個失敗 layer。
- 05
留下 baseline
在本機 setup notes 記錄版本與成功診斷結果。
PASS / FAIL
驗收清單
- Installer 符合作業系統與目前 shell。
- codex --version 成功。
- codex doctor 指向正確 runtime 與 repo。
- PATH 只有預期 binary 優先。
- 診斷與 credential 檔沒有被 commit。
WATCH / REJECT
失敗模式
- 在 POSIX shell 執行 PowerShell installer,或反過來。
- 不看 PATH 就重複安裝。
- 假設所有版本都能 self-update。
- 未檢查敏感路徑就公開診斷輸出。