Skip to content

解除安裝

兩種途徑:

  • 如果 openclaw 仍已安裝,則採用 簡易途徑
  • 如果 CLI 已消失但服務仍在運行,則採用 手動移除服務

建議做法:使用內建解除安裝程式:

Terminal window
openclaw uninstall

非互動式(自動化 / npx):

Terminal window
openclaw uninstall --all --yes --non-interactive
npx -y openclaw uninstall --all --yes --non-interactive

手動步驟(結果相同):

  1. 停止閘道服務:
Terminal window
openclaw gateway stop
  1. 解除安裝閘道服務 (launchd/systemd/schtasks):
Terminal window
openclaw gateway uninstall
  1. 刪除狀態 + 設定:
Terminal window
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"

如果您將 OPENCLAW_CONFIG_PATH 設定為狀態目錄以外的自訂位置,也請刪除該檔案。

  1. 刪除您的工作區(可選,移除代理程式檔案):
Terminal window
rm -rf ~/.openclaw/workspace
  1. 移除 CLI 安裝(選擇您使用的那一個):
Terminal window
npm rm -g openclaw
pnpm remove -g openclaw
bun remove -g openclaw
  1. 如果您安裝了 macOS 應用程式:
Terminal window
rm -rf /Applications/OpenClaw.app

備註:

  • 如果您使用了設定檔 (--profile / OPENCLAW_PROFILE),請對每個狀態目錄重複步驟 3(預設值為 ~/.openclaw-<profile>)。
  • 在遠端模式下,狀態目錄位於 閘道主機 上,因此請在那裡也執行步驟 1-4。

如果閘道服務持續運行但 openclaw 遺失,請使用此方法。

預設標籤為 ai.openclaw.gateway(或 ai.openclaw.<profile>;舊版 com.openclaw.* 可能仍然存在):

Terminal window
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

如果您使用了設定檔,請將標籤和 plist 名稱替換為 ai.openclaw.<profile>。如果存在任何舊版 com.openclaw.* plist,請將其移除。

預設單元名稱為 openclaw-gateway.service(或 openclaw-gateway-<profile>.service):

Terminal window
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

預設任務名稱為 OpenClaw Gateway(或 OpenClaw Gateway (<profile>))。 任務腳本位於您的狀態目錄下。

Terminal window
schtasks /Delete /F /TN "OpenClaw Gateway"
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"

如果您使用了設定檔,請刪除相符的任務名稱和 ~\.openclaw-<profile>\gateway.cmd

正常安裝 (install.sh / npm / pnpm / bun)

Section titled “正常安裝 (install.sh / npm / pnpm / bun)”

如果您使用了 https://openclaw.ai/install.shinstall.ps1,CLI 是通过 npm install -g openclaw@latest 安裝的。 請使用 npm rm -g openclaw 將其移除(如果您是透過該方式安裝,則使用 pnpm remove -g / bun remove -g)。

如果您是從 repo 檢出執行 (git clone + openclaw ... / bun run openclaw ...):

  1. 請在刪除 repo 之前 解除安裝 gateway 服務(使用上述簡易路徑或手動移除服務)。
  2. 刪除 repo 目錄。
  3. 如上所示移除狀態 + 工作區。