update
openclaw update
Section titled “openclaw update”安全地更新 OpenClaw 並在穩定版/測試版/開發版之間切換。
如果您是透過 npm/pnpm 安裝 (全域安裝,無 git 元資料),更新會透過更新中的套件管理員流程進行。
openclaw updateopenclaw update statusopenclaw update wizardopenclaw update --channel betaopenclaw update --channel devopenclaw update --tag betaopenclaw update --tag mainopenclaw update --dry-runopenclaw update --no-restartopenclaw update --jsonopenclaw --update--no-restart:成功更新後跳過重新啟動 Gateway 服務。--channel <stable|beta|dev>:設定更新頻道 (git + npm;會保留在設定中)。--tag <dist-tag|version|spec>:僅針對此更新覆寫套件目標。對於套件安裝,main會對應到github:openclaw/openclaw#main。--dry-run:預覽計劃的更新動作 (頻道/標籤/目標/重啟流程),而不寫入設定、安裝、同步外掛或重新啟動。--json:列印機器可讀取的UpdateRunResultJSON。--timeout <seconds>:每步驟的逾時時間 (預設為 1200s)。
注意:降級需要確認,因為舊版本可能會導致設定檔損壞。
update status
Section titled “update status”顯示目前的更新頻道 + git 標籤/分支/SHA (針對原始碼版本),以及更新可用性。
openclaw update statusopenclaw update status --jsonopenclaw update status --timeout 10選項:
--json:列印機器可讀取的狀態 JSON。--timeout <seconds>:檢查的逾時時間 (預設為 3s)。
update wizard
Section titled “update wizard”互動式流程,用於選擇更新頻道並確認更新後是否重新啟動 Gateway
(預設為重新啟動)。如果您在沒有 git 檢出的情況下選擇 dev,
它會提議建立一個。
當您明確切換頻道 (--channel ...) 時,OpenClaw 也會保持
安裝方式一致:
dev→ 確保有 git 檢出 (預設:~/openclaw,可透過OPENCLAW_GIT_DIR覆寫), 進行更新,並從該檢出安裝全域 CLI。stable/beta→ 使用對應的 dist-tag 從 npm 安裝。
Gateway 核心自動更新器(透過配置啟用時)會重複使用這個相同的更新路徑。
Git checkout 流程
Section titled “Git checkout 流程”頻道:
stable:checkout 最新的非 beta 標籤,然後 build + doctor。beta:checkout 最新的-beta標籤,然後 build + doctor。dev:checkoutmain,然後 fetch + rebase。
高階流程:
- 需要乾淨的工作樹(無未提交的變更)。
- 切換到選定的頻道(標籤或分支)。
- 獲取上游(僅限 dev)。
- 僅限 dev:在臨時工作樹中進行預檢 lint + TypeScript 建置;如果 tip 失敗,則會回溯最多 10 個提交以尋找最新的乾淨建置。
- 變基到選定的提交(僅限 dev)。
- 安裝依賴(優先使用 pnpm;後備使用 npm)。
- 建置並建置 Control UI。
- 執行
openclaw doctor作為最終的「安全更新」檢查。 - 將插件同步到活動頻道(dev 使用捆綁的擴充功能;stable/beta 使用 npm)並更新以 npm 安裝的插件。
--update 簡寫
Section titled “--update 簡寫”openclaw --update 會重寫為 openclaw update(適用於 shell 和啟動器腳本)。