Skip to content

The agent that grows with you

feat(telemetry): record setup completion from the CLI wizard

teknium1c8da5f7e0a8d
diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py
index 09240768e23..4077e377454 100644
--- a/hermes_cli/setup.py
+++ b/hermes_cli/setup.py
@@ -708,6 +708,7 @@ def _run_setup_wizard_impl(args):
# backwards-compatible no-op here.
if quick_requested:
_run_setup_steps([("Quick Setup", lambda: _run_quick_setup(config, hermes_home))])
+ _record_setup_completed(config)
return
print_header("Reconfigure", gap=True)
print_success("You already have Hermes configured.")
@@ -728,6 +729,7 @@ def _run_setup_wizard_impl(args):
if runner is not None:
from hermes_cli import setup_quick
_run_setup_steps([(label, lambda: getattr(setup_quick, runner)(config, hermes_home, is_existing))])
+ _record_setup_completed(config)
return
_run_full_setup(config, hermes_home, is_existing=is_existing, migration_ran=migration_ran)
@@ -738,3 +740,12 @@ def _run_setup_wizard_impl(args):
"If setup changed a value you customized, restore it with:",
f" cp {_backup_path} {config_path}")
_print_setup_summary(config, hermes_home)
+ _record_setup_completed(config)
+
+
+def _record_setup_completed(config: dict) -> None:
+ """Count a wizard run that finished. Runs after every section (shared-metrics consent
+ included) so a user who opted in during this run is counted; the API checks enablement."""
+ from hermes_cli.observability.shared_metrics_events import record_setup_completed
+ model = config.get("model")
+ record_setup_completed(surface="cli", provider=model.get("provider") if isinstance(model, dict) else None)
diff --git a/hermes_cli/setup_quick.py b/hermes_cli/setup_quick.py
index cd2a0116b38..8fed4386d24 100644
--- a/hermes_cli/setup_quick.py
+++ b/hermes_cli/setup_quick.py
@@ -56,7 +56,7 @@ def _run_nous_flow(config: dict, *, context: str, cancel_exc: tuple, cancel_line
def _run_portal_one_shot(config: dict) -> None:
"""One-shot Nous Portal setup (``hermes setup --portal`` / ``hermes portal``)."""
- from hermes_cli.setup import _info, _print_banner, print_error, print_info, print_success
+ from hermes_cli.setup import _info, _print_banner, _record_setup_completed, print_error, print_info, print_success
_print_banner("│ ☤ Hermes Setup — Nous Portal (one-shot) │")
_info(None, " One subscription, 300+ models, plus the Tool Gateway:",
" web search, image generation, TTS, browser automation",
@@ -82,6 +82,7 @@ def _run_portal_one_shot(config: dict) -> None:
print()
print_success("Portal setup complete.")
_info(" Run `hermes portal info` to inspect routing.", " Run `hermes` to start chatting.")
+ _record_setup_completed(config)
def _run_first_time_quick_setup(config: dict, hermes_home, is_existing: bool):