insights.py 759 B

123456789101112131415161718
  1. """``hermes insights`` subcommand parser."""
  2. from __future__ import annotations
  3. from typing import Callable
  4. def build_insights_parser(subparsers, *, cmd_insights: Callable) -> None:
  5. """Attach the ``insights`` subcommand to ``subparsers``."""
  6. insights_parser = subparsers.add_parser(
  7. "insights", help="Show usage insights and analytics",
  8. description="Analyze session history to show token usage, costs, tool patterns, and activity trends",
  9. )
  10. insights_parser.add_argument(
  11. "--days", type=int, default=30, help="Number of days to analyze (default: 30)")
  12. insights_parser.add_argument(
  13. "--source", help="Filter by platform (cli, telegram, discord, etc.)")
  14. insights_parser.set_defaults(func=cmd_insights)