解除安裝
兩種途徑:
- 如果
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- 解除安裝閘道服務 (launchd/systemd/schtasks):
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 使用者單元)
Section titled “Linux (systemd 使用者單元)”預設單元名稱為 openclaw-gateway.service(或 openclaw-gateway-<profile>.service):
systemctl --user disable --now openclaw-gateway.servicerm -f ~/.config/systemd/user/openclaw-gateway.servicesystemctl --user daemon-reloadWindows (排程任務)
Section titled “Windows (排程任務)”預設任務名稱為 OpenClaw Gateway(或 OpenClaw Gateway (<profile>))。
任務腳本位於您的狀態目錄下。
schtasks /Delete /F /TN "OpenClaw Gateway"Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"如果您使用了設定檔,請刪除相符的任務名稱和 ~\.openclaw-<profile>\gateway.cmd。
正常安裝與原始碼簽出
Section titled “正常安裝與原始碼簽出”正常安裝 (install.sh / npm / pnpm / bun)
Section titled “正常安裝 (install.sh / npm / pnpm / bun)”如果您使用了 https://openclaw.ai/install.sh 或 install.ps1,CLI 是通过 npm install -g openclaw@latest 安裝的。
請使用 npm rm -g openclaw 將其移除(如果您是透過該方式安裝,則使用 pnpm remove -g / bun remove -g)。
原始碼檢出 (git clone)
Section titled “原始碼檢出 (git clone)”如果您是從 repo 檢出執行 (git clone + openclaw ... / bun run openclaw ...):
- 請在刪除 repo 之前 解除安裝 gateway 服務(使用上述簡易路徑或手動移除服務)。
- 刪除 repo 目錄。
- 如上所示移除狀態 + 工作區。