How to Uninstall OpenClaw CLI, npm, and Global Installations

Step-by-step guide to fully uninstall OpenClaw CLI, npm global packages, shell profile changes, and command-line leftovers on macOS, Windows, and Linux.
Mar 13, 2026

Step 1: Open a terminal

  • Mac — press Command + Space, type Terminal, press Enter.
  • Windows — press Win + R, type cmd, press Enter; or search for PowerShell.
  • Linux — open your terminal or press Ctrl + Alt + T.

Step 2: Quick uninstall (CLI still installed)

If the openclaw command still works, run:

openclaw uninstall --all --yes
  • uninstall — tells the program you want to remove it.
  • --all — removes everything: gateway service, local database, config files.
  • --yes — auto-confirms all prompts.

For fully non-interactive use (scripts, CI, npx):

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

This handles the gateway stop, service uninstall, and state/config deletion in one step.

Step 3: Remove the CLI global package

After the uninstall command finishes, only the CLI shell remains. Remove it with whichever package manager you originally used:

npm rm -g openclaw
# or
pnpm remove -g openclaw
# or
bun remove -g openclaw

Verify it is gone:

which openclaw    # macOS/Linux — should return nothing
where.exe openclaw  # Windows — should return nothing

Step 4: Manual gateway steps (if you skipped step 2)

If you want explicit control instead of openclaw uninstall --all:

openclaw gateway stop
openclaw gateway uninstall

Then delete state and config:

rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
rm -rf ~/.openclaw/workspace

On Windows (PowerShell):

Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw"

Step 5: Clean up shell profile

Check whether OpenClaw added entries to your shell config:

  • ~/.zshrc, ~/.zprofile (macOS)
  • ~/.bashrc, ~/.bash_profile, ~/.profile (Linux)
  • PowerShell $PROFILE (Windows)

Remove any:

  • OPENCLAW_* environment variables
  • PATH entries pointing to OpenClaw
  • source lines referencing OpenClaw scripts
  • Aliases wrapping the openclaw command

Step 6: Source checkout cleanup (git clone)

If you ran OpenClaw from a repo checkout instead of a global npm install:

  1. Uninstall the gateway service before deleting the repo (use step 2 or step 4 above).
  2. Delete the repo directory.
  3. Delete state + workspace as shown above.

Step 7: Verify clean state

Run the following to confirm nothing remains:

macOS/Linux:

which openclaw
npm ls -g openclaw
ls ~/.openclaw 2>/dev/null

Windows (PowerShell):

where.exe openclaw
npm ls -g openclaw
Test-Path "$env:USERPROFILE\.openclaw"

All should return empty or "not found."

Important notes

  • Reboot recommended — restart your machine after cleanup to ensure all background processes are stopped.
  • Revoke API keys — if you bound API keys (OpenAI, Claude, etc.) in OpenClaw, go to the provider dashboard and revoke the old keys, then generate new ones.
  • Profiles — if you used --profile or OPENCLAW_PROFILE, repeat state deletion for each profile directory (e.g. ~/.openclaw-<profile>).
  • Custom config path — if you set OPENCLAW_CONFIG_PATH to a location outside the state dir, delete that file too.

How to Uninstall OpenClaw CLI, npm, and Global Installations