npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agent-analytics/cli

v0.5.5

Published

Stop juggling dashboards. Let your agent do it. Analytics your AI agent can actually use — track, analyze, experiment, optimize.

Readme

Agent Analytics CLI

Stop juggling dashboards. Let your agent do it.

Analytics your AI agent can actually use — track, analyze, experiment, optimize.

Quick Start

# 1. Start agent login or signup in the browser
npx @agent-analytics/cli login

# 2. Create a project
npx @agent-analytics/cli create my-site --domain https://mysite.com

# 3. Watch it live
npx @agent-analytics/cli live

# Optional fallbacks
npx @agent-analytics/cli login --detached
npx @agent-analytics/cli login --token aak_your_key   # advanced/manual fallback

# Optional: clear your saved local auth later
npx @agent-analytics/cli logout

Commands

# Setup
login                            Browser approval flow for signup/login
login --detached                 Detached approval flow with poll/manual exchange
login --token <key>              Advanced fallback: save a raw API key
logout                           Clear your saved local auth
create <name> --domain <url>     Create a project and get your tracking snippet
projects                         List all your projects

# Analytics
all-sites                        Historical summary across all projects
bot-traffic <name>               Filtered automated traffic by project or --all
stats <name>                     Overview: events, users, daily trends
live [name]                      Real-time terminal dashboard across all projects
insights <name>                  Period-over-period comparison with trends
breakdown <name> --property path Top pages, referrers, UTM sources, countries
pages <name>                     Entry/exit page performance & bounce rates
heatmap <name>                   Peak hours & busiest days
funnel <name>                    Funnel analysis: where users drop off
retention <name>                 Cohort retention: % of users who return
sessions-dist <name>             Session duration distribution
events <name>                    Raw event log
sessions <name>                  Individual session records
query <name>                     Flexible analytics query (metrics, group_by, filters)
properties <name>                Discover event names & property keys

# Experiments — A/B testing your agent can actually use
experiments list <project>       List experiments
experiments create <project>     Create experiment
experiments get <id>             Get experiment with results & significance
experiments complete <id>        Ship the winner

# Account
whoami                           Show current account & tier
feedback --message "..."         Send product/process feedback
logout                           Clear saved local auth (does not revoke remote sessions)
revoke-key                       Revoke and regenerate API key

The CLI is agent-session-first. It stores a renewable Agent Analytics session locally after browser approval and uses that bearer auth for API calls. Raw aak_* API keys still work, but only as an advanced/manual fallback for direct HTTP-style usage.

Bounce metrics (insights, pages, sessions) treat a session as a bounce when it has only non-interactive events: page_view, $impression, $scroll_depth, $error, $time_on_page, $performance, $web_vitals.

query keeps /events raw and lossless, but /query uses activation-safe dedupe (session_then_user) as the default for event_count: session-backed rows count by session, no-session rows fall back to user_id only when that user has no session-backed row in the same filtered/grouped result set, and fully anonymous rows fall back to event id. --count-mode only affects event_count. Use --count-mode raw when you need the old ingested-row count for debugging or audit work:

npx @agent-analytics/cli query my-site --metrics event_count --count-mode raw

Property filters must use canonical properties.* fields. Built-in filter fields are only event, user_id, date, country, session_id, and timestamp. Example:

npx @agent-analytics/cli query my-site --filter '[{"field":"properties.referrer","op":"contains","value":"clawflows.com"}]'

Invalid filter fields now fail loudly and return property discovery guidance instead of being silently ignored.

Feedback

Use the CLI feedback command when Agent Analytics was confusing, a task took too long, or the agent had to do manual analysis that the product should have handled:

npx @agent-analytics/cli feedback \
  --message "The agent had to calculate the funnel drop-off manually" \
  --project my-site \
  --command "agent-analytics funnel my-site --steps page_view,signup,purchase" \
  --context "Share the use case and friction, but avoid private owner details, secrets, or raw customer data."

Feedback goes to a real agent via Telegram, every request is seen and auto-approved, and useful fixes can land quickly, sometimes within hours.

Works With

Claude Code, OpenClaw, Cursor, Codex — any AI agent that can run npx. Or add the MCP server for rich charts in Claude Desktop:

claude mcp add agent-analytics --transport http https://mcp.agentanalytics.sh/mcp

For managed or remote runtimes that cannot receive a localhost callback, use npx @agent-analytics/cli login --detached and complete approval in the browser or with manual exchange.

Agent Skill

The installable Agent Skill lives in the canonical public repo:

npx skills add Agent-Analytics/agent-analytics-skill@agent-analytics

Do not install the skill from this CLI repo. This package is the runtime CLI; the public skill definition is maintained separately so install instructions stay consistent across Codex, Cursor, Claude Code, and other Agent Skills-compatible tools.

Environment Variables

| Variable | Description | |----------|-------------| | AGENT_ANALYTICS_API_KEY | Advanced fallback API key (overrides config file) | | AGENT_ANALYTICS_URL | Custom API URL (for self-hosted) |

Links

  • Dashboard: https://app.agentanalytics.sh
  • Docs: https://docs.agentanalytics.sh
  • Website: https://agentanalytics.sh
  • GitHub: https://github.com/Agent-Analytics
  • Self-host: https://github.com/Agent-Analytics/agent-analytics
  • Agent Skill: https://github.com/Agent-Analytics/agent-analytics-skill

License

MIT