Skip to content
Back to skills

Cli

ASecurity

Events from a command-line program — pkg/observe/cliev (an anonymous install id, a one-time notice, DO_NOT_TRACK / <APP>_TELEMETRY=off opt-out, always off in CI, `<app> telemetry on|off|status`, a 300 ms batch at exit), the first-run event, and the native ingest key a CLI sends with.

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 14, 2026
developmentgogit

Works with

  • cli

Security analysis

A100/100

Scanned November 14, 2026

npx -y skills add reliant-labs/forge --skill cli --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cli?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cli
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reliant-labs-cli/badge)](https://www.skillsdirectory.com/skills/reliant-labs-cli)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: observability/product-events/cli
description: Events from a command-line program — pkg/observe/cliev (an anonymous install id, a one-time notice, DO_NOT_TRACK / <APP>_TELEMETRY=off opt-out, always off in CI, `<app> telemetry on|off|status`, a 300 ms batch at exit), the first-run event, and the native ingest key a CLI sends with.
---

# Events from a CLI: `pkg/observe/cliev`

A CLI has no request, no claims and no browser, so `observe.Track` does not fit
it. `cliev` records the same events (the contract in
`observability/product-events`: `event.name` `product.<name>`, `app.client`
`cli`, bounded and PII-guarded `product.<key>` tags) into the same
`product_events` table.

```go
func main() {
	c := cliev.Init(cliev.Config{
		App:      "acme",                 // config dir, ACME_TELEMETRY, the notice
		Version:  version,
		Endpoint: telemetryEndpoint,      // stamped by the release build; "" sends nothing
		Quiet:    hasFlag(os.Args, "--json"),
	})
	if c.FirstRun() {
		c.Track(ctx, cliev.FirstRunEvent("acme"), c.FirstRunAttrs("")...)
	}
	defer cliev.Flush(context.Background())
	// ... run the command; cliev.Track(ctx, "acme_export_finished", slog.Int("files", n))
}
```

What it does for you:

- **Install id.** A random UUID in `<config dir>/acme/telemetry.json`,
  recorded as `visitor.id`. The only identity an unauthenticated CLI sends. A
  signed-in CLI can add the user and org with `observe.WithActor`.
- **Notice.** One line on stderr on the first run, never on a `Quiet` run.
  Nothing is sent until it has been shown once.
- **Opt-out.** `DO_NOT_TRACK=1` (always wins), `ACME_TELEMETRY=off`, or
  `c.SetEnabled(false)` (wire it to `acme telemetry off`), which is remembered.
  Always off on a CI runner (`CI=true`, `GITHUB_ACTIONS` and the other CI
  services' variables; `cliev.InCI`): nothing turns it back on there.
- **Bounds.** One event per name per run, `cliev.MaxEventsPerDay` per install,
  the batch sent once at exit within 300 ms and dropped on failure. Telemetry
  never slows or fails a command.

**Endpoint.** On Reliant hosting, send to the keyed ingest
`https://ingest.reliantlabs.dev/k/<key>/v1/logs` with a **native** ingest key
for the project's environment. A native key is public like a browser key (it
ships in the binary): it admits logs only, needs no Origin, and has stricter
per-key and per-address limits. Bake it in at release (`-ldflags -X`), never
in a development build.

**Tags, not text.** `version`, `os`, `arch`, a command's `noun.verb`, `ok`, a
duration bucket. Never paths, hostnames, project names, flags' values or error
text.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.