uninstall.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. """``hermes uninstall`` subcommand parser."""
  2. from __future__ import annotations
  3. import argparse
  4. from typing import Callable
  5. from hermes_cli.subcommands._shared import add_yes_flag
  6. def build_uninstall_parser(subparsers, *, cmd_uninstall: Callable) -> None:
  7. """Attach the ``uninstall`` subcommand to ``subparsers``."""
  8. uninstall_parser = subparsers.add_parser(
  9. "uninstall", help="Uninstall Hermes Agent",
  10. description="Remove Hermes Agent from your system. Can keep configs/data for reinstall.")
  11. modes = uninstall_parser.add_mutually_exclusive_group()
  12. modes.add_argument(
  13. "--full", action="store_true",
  14. help="Full uninstall - remove everything including configs and data")
  15. modes.add_argument(
  16. "--gui", action="store_true",
  17. help="Uninstall only the desktop Chat GUI, leaving the agent intact")
  18. modes.add_argument(
  19. "--data",
  20. action="store_true",
  21. help="Remove only the active Hermes home's user data, leaving installed code "
  22. "intact — the one mode that works on Nix / bundled-app / Docker installs",
  23. )
  24. uninstall_parser.add_argument(
  25. "--gui-summary",
  26. action="store_true",
  27. help="Print a JSON summary of installed GUI/agent artifacts and exit "
  28. "(used by the desktop app to gate uninstall options)")
  29. add_yes_flag(uninstall_parser, "Skip confirmation prompts")
  30. uninstall_parser.add_argument(
  31. "--dry-run", action="store_true",
  32. help="Print what uninstall would remove without changing anything")
  33. uninstall_parser.add_argument("--desktop-userdata", help=argparse.SUPPRESS)
  34. uninstall_parser.set_defaults(func=cmd_uninstall)