Uninstall
3 分钟阅读
Uninstall
Two paths:
两种方法:
Easy path if
openclawis still installed.- 简易方法(前提是
openclaw仍已安装)
- 简易方法(前提是
Manual service removal if the CLI is gone but the service is still running.
- 手动移除服务,适用于 CLI 已消失但服务仍在运行的情况。
Easy path (CLI still installed)
Recommended: use the built-in uninstaller:
推荐使用内置卸载程序:
| |
Non-interactive (automation / npx):
非交互式(自动化 / npx 模式):
| |
Manual steps (same result):
手动步骤(结果相同):
- Stop the gateway service: 停止网关服务:
| |
- Uninstall the gateway service (launchd/systemd/schtasks):
| |
- Delete state + config: 删除状态和配置:
| |
If you set OPENCLAW_CONFIG_PATH to a custom location outside the state dir, delete that file too.
如果你将 OPENCLAW_CONFIG_PATH 设置为状态 state 之外的自定义位置,请也删除该文件。
- Delete your workspace (optional, removes agent files): 删除你的工作区(可选,会删除 agent 文件):
| |
- Remove the CLI install (pick the one you used): 卸载 CLI 安装程序(选择你使用的安装方式):
| |
- If you installed the macOS app: 如果你安装了 macOS 应用:
| |
Notes:
If you used profiles (
--profile/OPENCLAW_PROFILE), repeat step 3 for each state dir (defaults are~/.openclaw-<profile>).
- 如果你使用了配置文件(
--profile/OPENCLAW_PROFILE),请对每个 state 目录重复步骤 3(默认目录为~/.openclaw-<profile>)In remote mode, the state dir lives on the gateway host, so run steps 1-4 there too.
- 在远程模式下,state 目录位于gateway 主机上,因此也请在该主机上执行第 1 至 4 步。
Manual service removal (CLI not installed)
这里的CLI, 就是通过
npm install -g openclaw、pnpm add -g openclaw或bun install -g openclaw全局安装的那个!
Use this if the gateway service keeps running but openclaw is missing.
如果 gateway 服务持续运行但缺少 openclaw,请使用此方法。
macOS (launchd)
Default label is ai.openclaw.gateway (or ai.openclaw.<profile>; legacy com.openclaw.* may still exist):
默认标签为 ai.openclaw.gateway(或 ai.openclaw.<profile>;旧版 com.openclaw.* 可能仍存在):
| |
If you used a profile, replace the label and plist name with ai.openclaw.<profile>. Remove any legacy com.openclaw.* plists if present.
如果你使用了配置文件,请将标签和 plist 名称替换为ai.openclaw.<profile>。如果存在任何旧版的com.openclaw.* plist,请将其删除。
Linux (systemd user unit)
Default unit name is openclaw-gateway.service (or openclaw-gateway-<profile>.service):
默认单元名称为 openclaw-gateway.service(或 openclaw-gateway-<profile>.service):
| |
Windows (Scheduled Task) (计划任务)
Default task name is OpenClaw Gateway (or OpenClaw Gateway (<profile>)). The task script lives under your state dir.
默认任务名称为 OpenClaw Gateway(或 OpenClaw Gateway (<profile>))。任务脚本位于你的 state 目录下。
| |
If you used a profile, delete the matching task name and ~\.openclaw-<profile>\gateway.cmd.
如果你使用了配置文件,请删除对应的任务名称和 ~\.openclaw-<profile>\gateway.cmd。
Normal install vs source checkout 常规安装与源码检出对比
Normal install (install.sh / npm / pnpm / bun)
If you used https://openclaw.ai/install.sh or install.ps1, the CLI was installed with npm install -g openclaw@latest. Remove it with npm rm -g openclaw (or pnpm remove -g / bun remove -g if you installed that way).
如果你使用了 https://openclaw.ai/install.sh 或 install.ps1,则 CLI 是通过 npm install -g openclaw@latest 安装的。可使用 npm rm -g openclaw(若通过其他方式安装,可使用 pnpm remove -g 或 bun remove -g)将其卸载。
Source checkout (git clone)
If you run from a repo checkout (git clone + openclaw ... / bun run openclaw ...):
如果你从仓库签出运行(git clone + openclaw ... / bun run openclaw ...):
Uninstall the gateway service before deleting the repo (use the easy path above or manual service removal).
在删除仓库之前**卸载 ** gateway 服务(使用上方的简易步骤或手动删除服务)。
Delete the repo directory.
Remove state + workspace as shown above.
按上述步骤删除 state 和工作区。