Remove the service and selected local data first, then any remaining CLI install. State deletion can also remove installation files nested inside that directory. Choose:

Easy path (CLI still installed)

The command attempts independent requested cleanup scopes and returns a nonzero status if any scope fails or is blocked. Service teardown remains the safety gate for state and workspace deletion; if that gate fails, those data scopes are preserved while app cleanup is still attempted. Partial cleanup is reported explicitly and is never followed by an unconditional completion result.

apus uninstall

The interactive prompt preselects only the Gateway service. For complete local removal, also select state, workspace, and app in the prompt, or run apus uninstall --all. State removal preserves configured workspace directories unless you also select --workspace.

Preview what will be removed (safe):

apus uninstall --dry-run --all

Non-interactive (automation / npx). Use with caution and only after confirming scopes:

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

Flags: --service, --state, --workspace, --app select individual scopes; --all selects all four.

Unlike apus uninstall --state, manual state deletion does not preserve workspaces. Stop and uninstall the service successfully before deleting files. Before manual state or prefix deletion, move any configuration you want to keep outside that directory.

  1. Stop the gateway service:
apus gateway stop
  1. Uninstall the gateway service (launchd/systemd/schtasks):
apus gateway uninstall
  1. Decide whether to preserve the workspace.

Move every configured workspace you want to keep, including ~/.apus/workspace, outside the state directory before manual deletion. Workspaces inside that directory will otherwise be deleted with it; they need no separate deletion.

  1. Delete state + config:
rm -rf "${APUS_STATE_DIR:-$HOME/.apus}"

If you set APUS_CONFIG_PATH to a custom location outside the state dir, delete that file too. Restore preserved workspaces after recreating their parent, or configure their new paths on reinstall.

  1. Delete an external workspace only if you want to remove its agent files too:
rm -rf /path/to/external/workspace
  1. Remove the CLI using the installation owner below.

  2. If you installed the macOS app:

rm -rf /Applications/Apus.app

Manual service removal (CLI not installed)

Use this if the gateway service keeps running but apus is missing.

macOS (launchd)

Default label is ai.apus.gateway (or ai.apus.<profile> with a profile):

launchctl bootout gui/$UID/ai.apus.gateway
rm -f ~/Library/LaunchAgents/ai.apus.gateway.plist

If you used a profile, replace the label and plist name with ai.apus.<profile>.

Linux (systemd user unit)

Default unit name is apus-gateway.service (or apus-gateway-<profile>.service). A pre-rename clawdbot-gateway.service unit may still exist on machines upgraded from very old installs; apus uninstall / apus gateway uninstall detects and removes it automatically.

systemctl --user disable --now apus-gateway.service
rm -f ~/.config/systemd/user/apus-gateway.service{,.bak}
systemctl --user daemon-reload

Windows (Scheduled Task)

Default task name is Apus Gateway (or Apus Gateway (<profile>)). The task launches a windowless gateway.vbs script under your state dir, which in turn runs gateway.cmd; remove both.

schtasks /Delete /F /TN "Apus Gateway"
Remove-Item -Force "$env:USERPROFILE\.apus\gateway.cmd" -ErrorAction SilentlyContinue
Remove-Item -Force "$env:USERPROFILE\.apus\gateway.vbs" -ErrorAction SilentlyContinue

If you used a profile, delete the matching task name and the gateway.cmd / gateway.vbs files under ~\.apus-<profile>.

Remove the CLI

Remove the Gateway service before deleting a checkout, launcher, or prefix. Inspect the resolved command and its target first; if ownership is unclear, leave it in place. Check Installer internals for custom checkout and prefix options.

Installation method CLI owner and removal
Global npm (install.sh / install.ps1 default) Run npm rm -g apus with the npm/prefix that owns this install.
Global pnpm or Bun Run only the matching command: pnpm remove -g apus or bun remove -g apus. For a Bun-only shell launcher, first inspect $(bun pm bin -g)/apus for its Apus Bun launcher header and intended package path, then remove that launcher after removing the package; Bun can leave regular launcher files behind.
install.sh --install-method git Inspect ~/.local/bin/apus; remove that launcher only if it points to the intended checkout, then remove that checkout.
install.ps1 -InstallMethod git Inspect %USERPROFILE%\.local\bin\apus.cmd; remove that launcher only if it points to the intended checkout, then remove that checkout.
install-cli.sh (npm or Git) Inspect <prefix>/bin/apus. The prefix defaults to ~/.apus; --prefix / APUS_PREFIX overrides it. Remove a dedicated prefix only after preserving data; Git mode also needs its separate checkout removed.
Direct source checkout Remove only your own wrapper/symlink, then the checkout. Keep shims owned by other installations.

Git checkouts default to ~/apus (%USERPROFILE%\apus on Windows); use the actual target of the launcher, including custom --git-dir / -GitDir or APUS_GIT_DIR. On POSIX, APUS_HOME can change the default checkout. Remove state/workspaces only as selected above.

Before deleting a prefix, move any state, configuration, and workspaces you want to keep outside it. Never delete a shared prefix wholesale: remove only verified Apus files, preserving shared Node runtimes, packages, and tools.

If completion was installed, remove only its # Apus Completion block and Apus source line from the selected shell profile. Remove a legacy apus completion source/eval line only if it contains no other command; preserve surrounding content.

Remove an installer-added PATH entry only when no other command uses it. Keep shared bin directories such as ~/.local/bin. On Windows, the same rule applies to portable Node/MinGit and their PATH entries under %LOCALAPPDATA%\Apus\deps.

Open a new shell and check command -v apus (PowerShell: Get-Command apus -ErrorAction SilentlyContinue). If a command still resolves, inspect it: a second install or foreign wrapper may remain.

Related