CLI
autotel-cli provides an interactive setup wizard, a static observability score for your codebase, diagnostics, incremental feature additions, and telemetry investigation commands.
Installation
Section titled “Installation”npm install -g autotel-cli# ornpx autotel <command>Commands
Section titled “Commands”autotel init
Section titled “autotel init”Interactive setup wizard:
# Interactive modenpx autotel init
# Use defaultsnpx autotel init --yes
# Use a quick presetnpx autotel init --preset node-datadog-pino
# Dry runnpx autotel init --dry-runQuick presets:
node-datadog-pino: Node.js + Datadog + Pino loggingnode-datadog-agent: Node.js + Datadog Agent (local dev)node-honeycomb: Node.js + Honeycombnode-otlp: Node.js + Generic OTLP endpoint
autotel map
Section titled “autotel map”Score the observability of every entry point in your codebase. Static analysis, so nothing runs and nothing leaves the machine:
npx autotel map # score + the three to fix firstnpx autotel map --all # every entry point as a matrixnpx autotel map src/routes/checkout.ts # one entry point and its fixesnpx autotel map --json --no-write # for agentsnpx autotel map --min-score 70 # CI floornpx autotel map --baseline git:origin/main # CI ratchetSee Observability Map for the checks, the scoring, and
the autotel.map.json contract.
autotel doctor
Section titled “autotel doctor”Run diagnostics on your setup:
npx autotel doctor # Run all checksnpx autotel doctor --json # Machine-readable outputnpx autotel doctor --fix # Auto-fix resolvable issuesautotel add <type> <name>
Section titled “autotel add <type> <name>”Add components incrementally:
npx autotel add backend datadognpx autotel add subscriber posthognpx autotel add plugin bigquerynpx autotel add platform cloudflareautotel investigate surface
Section titled “autotel investigate surface”The CLI can query and diagnose telemetry directly (same backend model as autotel-mcp), returning one JSON document per invocation.
# backend health + signal availabilitynpx autotel healthnpx autotel capabilities
# discoverynpx autotel discover servicesnpx autotel discover trace-fieldsnpx autotel discover log-fields
# traces / spans / logs / metricsnpx autotel query traces --service-name checkout --error-only --limit 20npx autotel query spans --service-name checkout --operation-name db.querynpx autotel query logs --trace-id <traceId>npx autotel query metrics --service-name checkout
# incident triagenpx autotel diagnose anomalies --service checkoutnpx autotel diagnose root-cause <traceId>npx autotel correlate trace <traceId>
# security triage (security.* schema)npx autotel security summary --lookback-minutes 60npx autotel security events --severity critical --lookback-minutes 240
# MCP protocol-boundary security (mcp.security.* / mcp.tool.*)npx autotel security mcp --lookback-minutes 60The security summary / security events commands read the stable security.*
schema emitted by autotel-audit. See
Security Observability for the full picture.
security mcp aggregates the MCP signals emitted by
autotel-mcp-instrumentation (prompt-injection verdicts, output-budget
breaches, untrusted-content tool calls). See MCP.
All backend-touching commands accept:
--backend collector|jaeger|tempo|prometheus|loki|stack|auto|fixture|logfire|datadog|signoz--jaeger-base-url <url>--tempo-base-url <url>--prometheus-base-url <url>--loki-base-url <url>--collector-port <n>--fixture-path <path>--logfire-base-url <url>--datadog-site <site>--signoz-base-url <url>Hosted vendors
Section titled “Hosted vendors”logfire, datadog and signoz are trace-only — capabilities reports their
metrics and logs as unsupported rather than returning empty results, so you can
tell “this backend can’t answer that” from “there’s nothing there”.
Their credentials are read from the environment and never accepted as flags, because argv is readable from the process table:
| Backend | Credentials |
|---|---|
logfire |
LOGFIRE_READ_TOKEN — must be read-scope; the query API rejects write tokens |
datadog |
DD_API_KEY and DD_APP_KEY — an application key is separate from the API key |
signoz |
SIGNOZ_API_KEY — omit for an unauthenticated self-hosted instance |
DD_SITE accepts a bare site (uk1.datadoghq.com) or a full API URL. For
Logfire, note that ingest and queries use different hosts: writes go to the
regional OTLP host selected by createLogfireConfig, while
LOGFIRE_BASE_URL for reads must name the same region (logfire-us /
logfire-eu). SigNoz reads use its Query Builder v5 API.
Hosted read APIs retry HTTP 429 responses with bounded backoff and honour
Retry-After. If the retry budget is exhausted, command JSON reports
AUTOTEL_E_RATE_LIMITED with retryable: true; agents should wait for the
vendor’s rate-limit window and retry instead of interpreting it as “no data”.
Ingest lag
Section titled “Ingest lag”npx autotel health --otlp-endpoint http://localhost:4318Writes one probe span and polls until it reads back, reporting
freshness.timeToQueryableSeconds. Backends differ by two orders of magnitude
here, and on a slow one a write-then-read loop sees nothing and wrongly concludes
no telemetry was emitted — so check this before trusting an empty result.
The probe sends OTLP protobuf by default (the encoding every OTLP/HTTP receiver
must accept); the built-in collector reads JSON and is switched automatically.
Override with --otlp-encoding json|protobuf, bound the wait with
--freshness-timeout-ms, and authenticate hosted endpoints through the standard
OTEL_EXPORTER_OTLP_HEADERS — which for most vendors is the write
credential, not the read token used for querying.
The timeout bounds both the write and every backend read. Authentication and
configuration failures are returned immediately rather than being disguised as
ingest lag. Vendor endpoint path prefixes are preserved when /v1/traces is
appended.
Use --output-file <path> to persist command JSON and --no-secrets-in-output to redact secret-shaped values.
autotel codemod trace <path>
Section titled “autotel codemod trace <path>”Wrap functions with trace():
npx autotel codemod trace ./srcExamples
Section titled “Examples”See any example app. autotel init generates the instrumentation.ts file used across all examples.
Related
Section titled “Related”- Observability Map: the
autotel mapscoring surface in full. - MCP: the
autotel-mcpserver this CLI investigate surface mirrors. - Claude Code Skill: using these commands from a Claude skill workflow.
- Devtools: local OTLP receiver UI. Run it with
npx autotel-devtools(notnpx autotel dev tools).