Skip to Content
👋 欢迎来到 HowToUseOpenClaw 快速入门
安装卸载

卸载

两种方式:

  • 简单方式:当 openclaw 仍已安装时使用。
  • 手动移除服务:CLI 已卸载但服务仍在运行时使用。

简单方式(CLI 仍已安装)

推荐使用内置卸载器:

openclaw uninstall

非交互(自动化 / npx):

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

手动步骤(效果相同):

  1. 停止网关服务:
openclaw gateway stop
  1. 卸载网关服务(launchd/systemd/schtasks):
openclaw gateway uninstall
  1. 删除状态与配置:
rm -rf "${CLAWDBOT_STATE_DIR:-$HOME/.clawdbot}"

若将 CLAWDBOT_CONFIG_PATH 设到了状态目录外的自定义路径,也请删除该文件。

  1. 删除工作区(可选,会移除 agent 文件):
rm -rf ~/clawd
  1. 移除 CLI 安装(按你当初的安装方式选择):
npm rm -g openclaw pnpm remove -g openclaw bun remove -g openclaw
  1. 若安装了 macOS 应用:
rm -rf /Applications/OpenClaw.app

说明:

  • 若使用过 profile(--profile / CLAWDBOT_PROFILE),对每个状态目录重复步骤 3(默认名为 ~/.clawdbot-<profile>)。
  • 远程模式下,状态目录在网关主机上,请在该主机上同样执行步骤 1–4。

手动移除服务(CLI 已卸载)

适用于网关服务仍在运行但已找不到 openclaw 的情况。

macOS (launchd)

默认 label 为 bot.molt.gateway(或 bot.molt.<profile>;旧版 com.clawdbot.* 可能仍存在):

launchctl bootout gui/$UID/bot.molt.gateway rm -f ~/Library/LaunchAgents/bot.molt.gateway.plist

若使用过 profile,将 label 和 plist 名称替换为 bot.molt.<profile>。若存在旧版 com.clawdbot.* plist,一并删除。

Linux (systemd 用户单元)

默认单元名为 openclaw-gateway.service(或 openclaw-gateway-<profile>.service):

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

Windows (计划任务)

默认任务名为 OpenClaw Gateway(或 OpenClaw Gateway (<profile>))。任务脚本位于状态目录下。

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

若使用过 profile,删除对应任务名及 ~\.clawdbot-<profile>\gateway.cmd

正常安装 vs 源码检出

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

若使用过 https://molt.bot/install.shinstall.ps1,CLI 是通过 npm install -g openclaw@latest 安装的。
npm rm -g openclaw 卸载(若当初用 pnpm/bun 安装则用 pnpm remove -g / bun remove -g)。

源码检出(git clone)

若从仓库检出运行(git clone + openclaw ... / bun run openclaw ...):

  1. 删除仓库前先卸载网关服务(使用上面的简单方式或手动移除服务)。
  2. 删除仓库目录。
  3. 按上文删除状态目录和工作区。
最后更新于: