CLI side (bumped to 0.2.3 so it ships to PyPI):
- track_install / track_uninstall: drop ":{cli_name}" suffix; event names
become static "cli-install" / "cli-uninstall" with CLI name moved to
properties.cli. Keeps PostHog's event catalog flat and makes breakdowns
by CLI a simple property filter.
- Add track_launch(cli_name) firing "cli-launch" from `cli-hub launch <name>`,
so we have a real usage signal distinct from install intent.
- Tests updated to match the flat event names; new test for cli-launch.
Web side:
- Replace frozen BASELINE_STATS + PostHog-increment flow with a live
merge of two sources fetched every 60s:
* PostHog HogQL (via Cloudflare Worker, allow-listed query) —
counts visit-human/agent, cli-hub call split, and both flattened
and legacy-colon-prefixed cli-install/cli-uninstall, plus cli-launch.
* Umami events/series (via same Worker, new /umami/events endpoint)
for pre-migration events that PostHog never saw.
BASELINE_STATS survives as last-resort fallback only.
- cli_hub_total now aggregates cli-hub call + cli-install + cli-uninstall
+ cli-launch so the footer's "cli-hub" number reflects end-to-end
activity; human/agent split stays tied to cli-hub call only because
Umami install events don't carry is_agent.
- docs/hub/index.html, index-modern.html: drop inline PostHog personal key
and direct us.posthog.com call; fetch from analytics.clianything.cc
(Cloudflare Worker at ~/clianything-analytics-worker) which holds the
scoped query:read key as a Worker secret. Key can no longer be harvested
or auto-revoked by secret scanning.
- cli-hub 0.2.1 -> 0.2.2 so the PostHog migration from 8cae111 actually
ships to PyPI (0.2.1 on PyPI still contains the old Umami code, which is
why cli-hub events from real users are under-represented).
- Switch cli-hub analytics client from Umami to PostHog (us.i.posthog.com),
with agent/human classification derived from env vars and parent-process
names, and persistent analytics id at ~/.cli-hub/.analytics_id.
- Add daily deploy-pages step running .github/scripts/update_hub_analytics_stats.py
to pull PostHog totals into docs/hub/analytics-stats.json.
- Redesign docs/hub footer analytics panel (index.html + index-modern.html)
as a compact Apple/OpenAI-style card: live eyebrow, total, 2px ratio bar,
and inline Human/Agent split with percentages computed client-side.
- Expand cli-hub tests to cover the new analytics context fields and
provider switch.