Skip to content

Instantly share code, notes, and snippets.

@cdpath
Created June 3, 2026 02:52
Show Gist options
  • Select an option

  • Save cdpath/0397efdb6f2b6bf493c742f797acf5c1 to your computer and use it in GitHub Desktop.

Select an option

Save cdpath/0397efdb6f2b6bf493c742f797acf5c1 to your computer and use it in GitHub Desktop.
uninstall ampcode
#!/usr/bin/env bash
set -euo pipefail
AMP_SYMLINK="${HOME}/.local/bin/amp"
AMP_HOME="${HOME}/.amp"
AMP_CONFIG="${HOME}/.config/amp"
echo "Amp uninstall cleanup"
echo
if pgrep -x amp >/dev/null 2>&1; then
echo "Refusing to continue: an 'amp' process is currently running."
echo "Stop Amp first, then rerun this script."
exit 1
fi
remove_path() {
local path="$1"
if [[ -L "$path" || -e "$path" ]]; then
echo "Removing: $path"
rm -rf "$path"
else
echo "Already absent: $path"
fi
}
remove_path "$AMP_SYMLINK"
remove_path "$AMP_HOME"
remove_path "$AMP_CONFIG"
echo
if command -v amp >/dev/null 2>&1; then
echo "Warning: 'amp' still resolves to: $(command -v amp)"
echo "It may be installed by another package manager or elsewhere in PATH."
exit 2
fi
echo "Amp cleanup complete. 'amp' no longer resolves in PATH."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment