hermes-agent/hermes_cli
teknium1 b52b37ae64 feat: add /insights command with usage analytics and cost estimation
Inspired by Claude Code's /insights, adapted for Hermes Agent's multi-platform
architecture. Analyzes session history from state.db to produce comprehensive
usage insights.

Features:
- Overview stats: sessions, messages, tokens, estimated cost, active time
- Model breakdown: per-model sessions, tokens, and cost estimation
- Platform breakdown: CLI vs Telegram vs Discord etc. (unique to Hermes)
- Tool usage ranking: most-used tools with percentages
- Activity patterns: day-of-week chart, peak hours, streaks
- Notable sessions: longest, most messages, most tokens, most tool calls
- Cost estimation: real pricing data for 25+ models (OpenAI, Anthropic,
  DeepSeek, Google, Meta) with fuzzy model name matching
- Configurable time window: --days flag (default 30)
- Source filtering: --source flag to filter by platform

Three entry points:
- /insights slash command in CLI (supports --days and --source flags)
- /insights slash command in gateway (compact markdown format)
- hermes insights CLI subcommand (standalone)

Includes 56 tests covering pricing helpers, format helpers, empty DB,
populated DB with multi-platform data, filtering, formatting, and edge cases.
2026-03-06 14:04:59 -08:00
..
__init__.py Hermes Agent UX Improvements 2026-02-22 02:16:11 -08:00
auth.py Fix nous refresh token rotation failure in case where api key mint/retrieval fails 2026-03-02 17:18:15 +11:00
banner.py feat: smart context length probing with persistent caching + banner display 2026-03-05 16:09:57 -08:00
callbacks.py refactor: reorganize agent and CLI structure for improved clarity 2026-02-21 23:17:18 -08:00
clipboard.py fix: clipboard image paste on WSL2, Wayland, and VSCode terminal 2026-03-05 20:22:44 -08:00
codex_models.py refactor(auth): transition Codex OAuth tokens to Hermes auth store 2026-03-01 19:59:24 -08:00
colors.py Cleanup time! 2026-02-20 23:23:32 -08:00
commands.py feat: add /insights command with usage analytics and cost estimation 2026-03-06 14:04:59 -08:00
config.py Merge PR #469: fix(config): route API keys and tokens to .env instead of config.yaml 2026-03-06 04:23:49 -08:00
cron.py refactor: streamline cron job handling and update CLI commands 2026-02-21 16:21:19 -08:00
doctor.py feat(cli): add Daytona to setup wizard, doctor, and status display 2026-03-05 10:02:22 -08:00
gateway.py feat: add detailed setup instructions for Telegram, Discord, and Slack platforms 2026-03-03 20:05:15 -08:00
main.py feat: add /insights command with usage analytics and cost estimation 2026-03-06 14:04:59 -08:00
models.py chore: update OpenRouter model list 2026-03-06 00:52:45 -08:00
pairing.py Cleanup time! 2026-02-20 23:23:32 -08:00
runtime_provider.py fix: prioritize OPENROUTER_API_KEY over OPENAI_API_KEY 2026-03-03 00:28:26 +03:00
setup.py fix(setup): Escape skips instead of exiting, add control hints to all prompts 2026-03-06 05:27:11 -08:00
skills_hub.py fix: review fixes — path traversal guard, trust_style consistency, edge cases 2026-03-06 01:40:01 -08:00
status.py Merge PR #448: fix(cli): use correct dict key for codex auth file path in status output 2026-03-06 04:34:46 -08:00
tools_config.py feat: enhance Home Assistant integration with service discovery and setup 2026-03-03 05:16:53 -08:00
uninstall.py Cleanup time! 2026-02-20 23:23:32 -08:00