解除安裝
兩種路徑:
- 簡易路徑 如果
openclaw仍已安裝。 - 手動移除服務 如果 CLI 已消失但服務仍在執行。
簡易路徑(CLI 仍已安裝)
Section titled “簡易路徑(CLI 仍已安裝)”建議:使用內建解除安裝程式:
openclaw uninstall非互動式(自動化 / npx):
openclaw uninstall --all --yes --non-interactivenpx -y openclaw uninstall --all --yes --non-interactive手動步驟(結果相同):
- 停止閘道服務:
openclaw gateway stop- 解除安裝閘道服務:
openclaw gateway uninstall- 刪除狀態 + 設定:
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"如果您將 OPENCLAW_CONFIG_PATH 設定為狀態目錄以外的自訂位置,請一併刪除該檔案。
- 刪除您的工作區(可選,會移除代理程式檔案):
rm -rf ~/.openclaw/workspace- 移除 CLI 安裝(選擇您使用的一個):
npm rm -g openclawpnpm remove -g openclawbun remove -g openclaw- 如果您安裝了 macOS 應用程式:
rm -rf /Applications/OpenClaw.app備註:
- 如果您使用了設定檔(
--profile/OPENCLAW_PROFILE),請針對每個狀態目錄重複步驟 3(預設為~/.openclaw-<profile>)。 - 在遠端模式下,狀態目錄位於 閘道主機 上,因此請也在該處執行步驟 1-4。
手動移除服務(CLI 未安裝)
Section titled “手動移除服務(CLI 未安裝)”如果閘道服務持續執行但 openclaw 遺失,請使用此方法。
macOS (launchd)
Section titled “macOS (launchd)”預設標籤為 ai.openclaw.gateway(或 ai.openclaw.<profile>;舊版 com.openclaw.* 可能仍然存在):
launchctl bootout gui/$UID/ai.openclaw.gatewayrm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist如果您使用了設定檔,請將標籤和 plist 名稱替換為 ai.openclaw.<profile>。如果存在任何舊版 com.openclaw.* plist,請將其移除。
Linux (systemd user unit)
Section titled “Linux (systemd user unit)”預設單元名稱為 openclaw-gateway.service(或 openclaw-gateway-<profile>.service):
systemctl --user disable --now openclaw-gateway.servicerm -f ~/.config/systemd/user/openclaw-gateway.servicesystemctl --user daemon-reloadWindows (Scheduled Task)
Section titled “Windows (Scheduled Task)”預設任務名稱為 OpenClaw Gateway(或 OpenClaw Gateway (<profile>))。
任務腳本位於您的狀態目錄下。
schtasks /Delete /F /TN "OpenClaw Gateway"Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"如果您使用了設定檔,請刪除相符的任務名稱和 ~\.openclaw-<profile>\gateway.cmd。
正常安裝 vs 原始碼检出
Section titled “正常安裝 vs 原始碼检出”如果您使用了 https://openclaw.ai/install.sh 或 install.ps1,則 CLI 是透過 npm install -g openclaw@latest 安裝的。
請使用 npm rm -g openclaw 將其移除(或者如果您是透過該方式安裝,則使用 pnpm remove -g / bun remove -g)。
如果您是從 repo checkout 執行(git clone + openclaw ... / bun run openclaw ...):
- 在刪除 repo 之前先卸載 gateway 服務(使用上述簡單路徑或手動移除服務)。
- 刪除 repo 目錄。
- 如上所示移除狀態和工作區。