> ## Documentation Index
> Fetch the complete documentation index at: https://docs.recodex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 安裝 CLI

> 安裝 ReCodex 命令列,與官方 Codex 客戶端配合使用。

# 安裝 CLI

命令列和[桌面端](/zh-Hant/quickstart)用的是**同一個帳號、同一份額度**,按習慣選一個即可,也可以兩個都裝。

<Note>
  無論用哪種方式,你的機器上都需要先裝好官方 **Codex 桌面客戶端** —— ReCodex 是在它之上工作的。
</Note>

## 一鍵安裝(推薦)

<CodeGroup>
  ```bash macOS / Linux theme={null}
  curl -fsSL https://recodex.dev/install.sh | bash
  ```

  ```powershell Windows theme={null}
  powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://recodex.dev/install.ps1 | iex"
  ```
</CodeGroup>

腳本做三件事:按平台選二進位、**校驗 sha256**、裝到 PATH 上。

<Warning>
  校驗不是可選項。`curl | sh` 這種裝法等於把「裝什麼」完全交給網路 —— 所以腳本在雜湊對不上時會**直接中止**,不會退而求其次裝上去。
</Warning>

可以用環境變數改裝到哪裡:

```bash theme={null}
RECODEX_INSTALL_DIR=~/bin curl -fsSL https://recodex.dev/install.sh | bash
```

驗證:

```bash theme={null}
recodex version
```

## 手動下載

也可以到 [recodex.dev/download](https://recodex.dev/download) 直接取二進位, 和校驗檔 `SHA256SUMS` 一起下載並自行核對,然後放進 `PATH`。

<Warning>
  不要從聊天記錄、網盤或未知鏡像取客戶端。正式下載位址與校驗資訊以 recodex.dev 為準。
</Warning>

## 安裝官方 Codex

ReCodex 需要官方 Codex 客戶端在場。若還沒裝:

<Note>
  官方下載頁 `openai.com/chatgpt/download` 在部分地區打不開。 [recodex.dev/download](https://recodex.dev/download) 上有直達入口,不用先能打開官網。
</Note>

**桌面客戶端**(桌面端使用者裝這個):

[recodex.dev/download](https://recodex.dev/download) 的**第 1 步**就是它,兩個平台都能點一下直接下載:

* **Windows**:官方只上架 Microsoft Store,沒有獨立安裝包。下載頁給的是從商店取出的原包(`.msixbundle`), 下載後雙擊由系統的「應用程式安裝程式」裝上,需要 Windows 10 2004 或更高版本。 ARM64 機器請選頁面上的 arm64 版本 —— 架構給錯了裝不上。
* **macOS**:官方只提供 `ChatGPT.dmg`,下載頁放的是同一個包並公布 sha256。

兩個平台的包都只做搬運:不解包、不修改內容、不重新簽名。

**命令列版 Codex**(只用終端的話裝這個就夠):

<CodeGroup>
  ```bash macOS / Linux theme={null}
  curl -fsSL https://chatgpt.com/codex/install.sh | sh
  ```

  ```powershell Windows theme={null}
  powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
  ```
</CodeGroup>

裝完之後可以讓 ReCodex 確認一遍:

```bash theme={null}
recodex install check
```

它能辨識從\*\*應用商店(MSIX)\*\*安裝的版本 —— 那種裝法不在 `Programs` 目錄下,單看常規路徑會誤判成「沒裝」。

## IDE 與桌面端

Codex 的 IDE 擴充和桌面端讀的是同一份 `~/.codex` 設定。完成 `recodex login` 後, 請**重新啟動**已經打開的 IDE 或桌面端,讓它重新載入環境變數與託管設定。

## 升級

```bash theme={null}
recodex update
```

只接受帶有效簽名的發布清單;簽名驗不過會直接拒絕,不會裝來源不明的二進位。

Codex 本身用 OpenAI 官方安裝器或套件管理器升級。

## 解除安裝

```bash theme={null}
recodex uninstall
```

會先註銷目前裝置、還原登入前的 Codex 設定,再刪除 ReCodex 的客戶端資料。 你自己的 `~/.codex` 資料(工作階段、記憶、日誌)不受影響。程式檔案可隨後手動刪除。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.