Files
hermes-agent/hermes_cli/subcommands/moa.py
T
Teknium b81ab901f3 refactor(cli): extract the last 16 inline parser groups from main() into hermes_cli/subcommands/
moa, fallback, worktree, browser, secrets, egress, migrate, whatsapp-cloud,
checkpoints, bundles, curator, pets, journey, computer-use, sessions and
completion each become a build_<group>_parser() builder. Closure handlers
that only closed over their own parser moved verbatim; sessions/completion
take the handler by injection. --help/usage/defaults byte-identical for all
399 parsers in the tree (in-process dump before/after).
2026-09-02 13:29:44 -07:00

26 lines
1.1 KiB
Python

"""``hermes moa`` subcommand parser.
Extracted from ``hermes_cli/main.py:main()`` (god-file Phase 2 follow-up).
Handlers are injected or imported lazily so this module never imports ``main``.
"""
from __future__ import annotations
def build_moa_parser(subparsers) -> None:
"""Attach the ``moa`` subcommand to ``subparsers``."""
from hermes_cli.moa_cmd import cmd_moa
moa_parser = subparsers.add_parser(
"moa",
help="Configure Mixture of Agents provider/model slots",
description="Configure the provider/model set used by /moa <prompt>.",
)
moa_subparsers = moa_parser.add_subparsers(dest="moa_command")
moa_subparsers.add_parser("list", aliases=["ls"], help="Show current MoA model slots")
moa_configure = moa_subparsers.add_parser("configure", aliases=["config"], help="Interactively pick MoA models")
moa_configure.add_argument("name", nargs="?", help="Preset name to create or update")
moa_delete = moa_subparsers.add_parser("delete", aliases=["rm"], help="Delete a MoA preset")
moa_delete.add_argument("name", help="Preset name to delete")
moa_parser.set_defaults(func=cmd_moa)