📝 移除 OpenClaw 的步驟

AI
編輯檔案 返回列表

🔧 快速移除(所有平台通用)

在移除前,必須先停止 Gateway 服務,否則部分檔案可能被鎖定或自動重建: EaseUS

 
 
bash
openclaw gateway stop

然後執行內建的完整移除指令:

 
 
bash
openclaw uninstall --all --yes --non-interactive

🍎 macOS 完整移除

 
 
bash
# 1. 停止並移除 Gateway 服務
openclaw gateway uninstall

# 2. 手動移除 LaunchAgent
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

# 3. 刪除設定與狀態資料
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"

# 4. 刪除工作區(可選)
rm -rf ~/.openclaw/workspace

# 5. 移除 CLI
npm rm -g openclaw
# 或 pnpm remove -g openclaw
# 或 bun remove -g openclaw

# 6. 若有安裝 macOS App
rm -rf /Applications/OpenClaw.app

🪟 Windows 完整移除

Windows 上的移除需要六個步驟,缺少任何一步都會留下殘餘檔案:停止程序 → 登出排程工作 → npm 全域移除 → 刪除設定目錄 → 刪除日誌與快取 → 確認清理完成。 Meta Intelligence

 
 
powershell
# 1. 停止 Gateway
openclaw gateway stop

# 2. 移除排程工作(需以系統管理員執行 PowerShell)
Unregister-ScheduledTask -TaskName "OpenClaw Gateway" -Confirm:$false

# 3. 移除 CLI
npm rm -g openclaw

# 4. 刪除設定目錄
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw"

# 5. 刪除殘留檔案
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"

殘留資料可能散落在:%USERPROFILE%\.openclaw\%APPDATA%\npm\%LOCALAPPDATA%\openclaw-logs\


🐧 Linux 完整移除

 
 
bash
# 1. 停用並移除 systemd 服務
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

# 2. 刪除設定與狀態資料
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"

# 3. 移除 CLI
npm rm -g openclaw

⚠️ 重要提醒

移除後務必也要撤銷已連接服務的存取權限。如果您曾授權 Google、Slack、Discord、GitHub 等服務,移除 OpenClaw 本身並不會自動取消這些已授予的存取 token,需要手動到各平台去撤銷。 OX Security

請問您是在哪個系統上移除?我可以提供更具體的協助。