skin.py 1.2 KB

123456789101112131415161718192021222324252627
  1. """``hermes skin`` subcommand parser."""
  2. from __future__ import annotations
  3. from typing import Callable
  4. def build_skin_parser(subparsers, *, cmd_skin: Callable) -> None:
  5. """Attach the ``skin`` subcommand to ``subparsers``."""
  6. skin_parser = subparsers.add_parser(
  7. "skin", help="List, switch, and tweak skins",
  8. description="Manage Hermes skins. `set` tweaks one color of the active skin in place.")
  9. skin_subparsers = skin_parser.add_subparsers(dest="skin_command")
  10. skin_subparsers.add_parser("list", help="List available skins")
  11. skin_use = skin_subparsers.add_parser("use", help="Switch the active skin")
  12. skin_use.add_argument("name", help="Skin name")
  13. # skin set — change ONE color of the active skin in place (bg untouched).
  14. skin_set = skin_subparsers.add_parser(
  15. "set", help="Set one color of the active skin (e.g. `skin set ui_tool '#00FFFF'`)")
  16. skin_set.add_argument("key", help="Color key (e.g. ui_tool, ui_accent, background)")
  17. skin_set.add_argument("value", help="Hex color (#rrggbb)")
  18. skin_set.add_argument("--skin", help="Target a specific skin instead of the active one")
  19. skin_parser.set_defaults(func=cmd_skin)