acp.py 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. """``hermes acp`` subcommand parser."""
  2. from __future__ import annotations
  3. from typing import Callable
  4. from hermes_cli.subcommands._shared import add_accept_hooks_flag
  5. def build_acp_parser(subparsers, *, cmd_acp: Callable) -> None:
  6. """Attach the ``acp`` subcommand to ``subparsers``."""
  7. acp_parser = subparsers.add_parser(
  8. "acp", help="Run Hermes Agent as an ACP (Agent Client Protocol) server",
  9. description="Start Hermes Agent in ACP mode for editor integration (VS Code, Zed, JetBrains)",
  10. )
  11. add_accept_hooks_flag(acp_parser)
  12. acp_parser.add_argument(
  13. "--version", action="store_true", dest="acp_version",
  14. help="Print Hermes ACP version and exit")
  15. acp_parser.add_argument(
  16. "--check", action="store_true",
  17. help="Verify ACP dependencies and adapter imports, then exit")
  18. acp_parser.add_argument(
  19. "--setup", action="store_true",
  20. help="Run interactive Hermes provider/model setup for ACP terminal auth")
  21. acp_parser.add_argument(
  22. "--setup-browser", action="store_true",
  23. help="Install PM's pinned Chromium for browser_exec (idempotent).")
  24. acp_parser.add_argument(
  25. "--yes", "-y", action="store_true", dest="assume_yes",
  26. help="Accept all prompts (used by --setup-browser to skip the "
  27. "~400 MB Chromium download confirmation).")
  28. acp_parser.set_defaults(func=cmd_acp)