Two review follow-ups. The probe counted any mention of --tui/--query in the help as support -- Hermes already writes "With --tui:" into --dev's description, so a release that dropped the option while keeping the prose would still read as ready. A flag now counts only when followed by a shape argparse prints after a definition: the usage bracket, the gap before same-line help text, an uppercase metavar, or the line end. Not probed by parsing a real invocation on purpose -- a release that ignores unknown arguments would turn the probe into a live session. And the teardown trusted its commands: a stub rm that failed aborted Remove Hermes under set -e before any ~/.hermes handling, while mise failures vanished into || true. --remove now attempts every step, then judges by what is left -- the marked stub still present, or mise still resolving the tool -- and Remove Hermes tolerates the failure until the runtime is handled, then carries it in its exit code. Findings from the same codex review at xhigh, verified and proven by mutation before landing. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude <noreply@anthropic.com>
76 lines
3.2 KiB
Bash
Executable File
76 lines
3.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Remove the Hermes desktop app along with the Hermes runtime it installed.
|
|
# omarchy:requires-sudo=true
|
|
|
|
# -u so an unset HOME is an error rather than a set of rm -rf paths rooted at /.
|
|
set -euo pipefail
|
|
|
|
omarchy-pkg-drop hermes-desktop
|
|
|
|
# The mise CLI is the app's predecessor, not the app itself: Hermes Desktop takes
|
|
# it over on install and runs its own runtime instead, so a copy still here is one
|
|
# the app never superseded -- an interrupted install, or the terminal CLI from
|
|
# before the app existed. Remove Hermes clears that too, scoped by the installer
|
|
# to what Omarchy owns so a hermes the user set up themselves is left alone.
|
|
# Tolerated here rather than fatal, so the ~/.hermes handling below still runs;
|
|
# the failure is answered for at the end instead of being swallowed.
|
|
cli_removed=true
|
|
omarchy-install-hermes-cli --remove || cli_removed=false
|
|
|
|
# The app writes this when the runtime it provisions under ~/.hermes has landed,
|
|
# and it is the only thing that tells that runtime apart from one the user
|
|
# installed themselves -- the paths are the same either way. Without it the app
|
|
# never got that far: a machine where it was installed but never launched still
|
|
# has whatever was there before, and none of it is ours to delete.
|
|
if [[ -f $HOME/.hermes/hermes-agent/.hermes-bootstrap-complete ]]; then
|
|
# The checkout and venv, its own uv, its own node. None of it is any use once
|
|
# the app is gone. Not ~/.config/Hermes, which holds the gateway connections
|
|
# and their encrypted tokens, the active profile and the update settings. Not
|
|
# the rest of ~/.hermes either: the chats, memories and the skills Hermes
|
|
# wrote for itself are the user's, they are small, and finding them still
|
|
# there after a reinstall is the better surprise.
|
|
rm -rf \
|
|
"$HOME/.hermes/hermes-agent" \
|
|
"$HOME/.hermes/bootstrap-cache" \
|
|
"$HOME/.hermes/bin" \
|
|
"$HOME/.hermes/node"
|
|
|
|
# Only the wrappers pointing into ~/.hermes, matched as a plain string: the
|
|
# path carries a dot, so an unanchored pattern would also claim a wrapper
|
|
# pointing at a sibling like ~/xhermes.
|
|
for command in hermes hermes-agent hermes-acp; do
|
|
wrapper="$HOME/.local/bin/$command"
|
|
|
|
if [[ -f $wrapper && ! -L $wrapper ]] && grep -qF "$HOME/.hermes" "$wrapper"; then
|
|
rm -f "$wrapper"
|
|
fi
|
|
done
|
|
|
|
# When Hermes brought its own Node it symlinked these next to its own commands,
|
|
# and they point at what we just deleted. Only the links into ~/.hermes: a
|
|
# system Node, or someone else's, lives somewhere else entirely.
|
|
for command in node npm npx; do
|
|
link="$HOME/.local/bin/$command"
|
|
|
|
if [[ -L $link && $(readlink "$link") == "$HOME/.hermes"/* ]]; then
|
|
rm -f "$link"
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "Hermes Desktop has been removed."
|
|
echo "Your chats, memories, and skills are still in ~/.hermes,"
|
|
echo "and your connections and settings in ~/.config/Hermes."
|
|
else
|
|
echo ""
|
|
echo "Hermes Desktop has been removed."
|
|
echo "It never finished installing its own Hermes, so nothing in ~/.hermes was touched."
|
|
fi
|
|
|
|
# The messages above still hold -- the app and its runtime are gone -- but a CLI
|
|
# teardown that failed already said so on stderr, and that stands.
|
|
if [[ $cli_removed == "false" ]]; then
|
|
exit 1
|
|
fi
|