卸载

适用范围

使用本页面当:

  • 您想从机器上删除 Moltbot
  • 卸载后网关服务仍在运行

两条路径:

  • 如果 moltbot 仍安装,简单路径
  • 如果 CLI 消失但服务仍在运行,手动服务移除

简单路径(CLI 仍安装)

推荐:使用内置卸载程序:

moltbot uninstall

非交互式(自动化 / npx):

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

手动步骤(相同结果):

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

如果您将 MOLTBOT_CONFIG_PATH 设置到状态目录之外的自定义位置,也要删除该文件。

  1. 删除您的工作区(可选,删除 agent 文件):
rm -rf ~/clawd
  1. 删除 CLI 安装(选择您使用的那个):
npm rm -g moltbot
pnpm remove -g moltbot
bun remove -g moltbot
  1. 如果您安装了 macOS 应用:
rm -rf /Applications/Moltbot.app

注意事项:

  • 如果您使用了配置文件(--profile / MOLTBOT_PROFILE),为每个状态目录重复步骤 3(默认为 ~/.moltbot-<profile>)。
  • 在远程模式下,状态目录位于网关主机上,因此在那里也运行步骤 1-4。

手动服务移除(未安装 CLI)

如果网关服务继续运行但 moltbot 缺失,请使用此方法。

macOS (launchd)

默认标签是 com.moltbot.gateway(或 com.moltbot.<profile>):

launchctl bootout gui/$UID/com.moltbot.gateway
rm -f ~/Library/LaunchAgents/com.moltbot.gateway.plist

如果您使用了配置文件,将标签和 plist 名称替换为 com.moltbot.<profile>

Linux (systemd 用户单元)

默认单元名称是 moltbot-gateway.service(或 moltbot-gateway-<profile>.service):

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

Windows (计划任务)

默认任务名称是 Moltbot Gateway(或 Moltbot Gateway (<profile>))。 任务脚本位于您的状态目录下。

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

如果您使用了配置文件,删除匹配的任务名称和 ~\.moltbot-<profile>\gateway.cmd

正常安装 vs 源码副本

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

如果您使用 https://clawd.bot/install.shinstall.ps1,CLI 使用 npm install -g moltbot@latest 安装。 使用 npm rm -g moltbot 删除它(如果您以这种方式安装,也可以使用 pnpm remove -g / bun remove -g)。

源码副本 (git clone)

如果您从仓库副本运行(git clone + moltbot ... / bun run moltbot ...):

  1. 在删除仓库之前卸载网关服务(使用上面的简单路径或手动服务移除)。
  2. 删除仓库目录。
  3. 如上所示删除状态 + 工作区。