← All FeaturesFeature

CLI Analytics

If you build a CLI tool, you need to know how developers use it. BetterMeter's Node SDK tracks command invocations, error rates, and execution duration — without collecting arguments, file paths, or any personal information.

Two lines to integrate

Auto-track with Commander.js
import { BetterMeter } from "@bettermeter/node";

const bm = new BetterMeter({
  siteId: "my-cli",
  apiKey: "bm_...",
});

// Wraps all commands automatically
bm.wrapCommander(program, { version: "1.0.0" });

What gets tracked

Command nameWhich commands are most popular
Flag namesWhich flags are used (values are never sent)
DurationHow long each command takes to execute
Exit codeSuccess vs failure rates
OS & architecturePlatform distribution of your users
CI detectionHow much usage comes from CI/CD pipelines

What is never tracked

Flag values, command arguments, file paths, environment variables, and any form of personal information are never collected. The SDK tracks structure, not content — following the same privacy principles as Stripe CLI and Vercel CLI telemetry.

Dashboard metrics

  • 01 Total invocations and unique callers with period-over-period change
  • 02 Top commands ranked by usage with error rate per command
  • 03 Average execution duration per command
  • 04 Daily activity timeseries (invocations + unique callers)
  • 05 Success rate across all commands