openlit CLI ingests events from each vendor’s hook system, normalizes
them onto OpenTelemetry’s gen_ai.* and OpenLit’s coding_agent.*
semantic conventions, and ships them to your existing OpenLit
collector. The /agents page detects them automatically — no
controller, no SDK, no code change in your repos.
You only need an OpenLit instance and the
openlit CLI on each
developer’s machine. The CLI talks only to your OpenLit endpoint.
There is no managed cloud for coding-agent telemetry.Prerequisites
- A running OpenLit instance — see Installation if you don’t have one.
- An OpenLit API key (Settings → API Keys).
- The OTLP endpoint of your OpenLit collector (defaults to
http://localhost:4318for local installs).
1. Install the CLI
Pick the path that matches your OS. All paths install the sameopenlit binary built by cli-release.yml.
~/.openlit/bin/openlit and
%USERPROFILE%\.openlit\bin\openlit.exe respectively. The Linux
script prints a PATH-add hint if the directory is not already on
$PATH; the Windows script updates user-scope PATH automatically
(open a new terminal to pick it up).
If you prefer to build from source: go install github.com/openlit/openlit/cli/cmd/openlit@latest.
2. Configure once
The fastest path isopenlit configure — it answers the same
questions a CI / Helm chart would set via env. The result is written
to ~/.config/openlit/config.env (Linux/macOS) or
%APPDATA%\openlit\config.env (Windows). For headless / fleet
rollouts, prefer env vars or flags directly — they take precedence
over the file (flags > env > config file).
Standard
OTEL_EXPORTER_OTLP_* variables are honoured as fallbacks
so existing OTel users can reuse their setup.
3. Wire each vendor
openlit coding install writes the right hook config for the agent
you pass and is fully idempotent. You can also point at the
plugin marketplace
and let the agent pull the manifest itself, or invoke the agent
through openlit coding launch which auto-installs and execs.
- Claude Code
- Cursor
- Codex
~/.claude/plugins/openlit-cc/. Hooks wired:
SessionStart, UserPromptSubmit, PreToolUse, PostToolUse,
Stop, SubagentStop, SessionEnd. Claude Code’s transcript JSONL
(transcript_path in the hook payload) is tailed on SessionStart
for early model attribution and on SessionEnd for authoritative
token usage and cost.Optional: Claude Code’s native OpenTelemetry exporter. If you’d
rather not install the plugin, or you want a second signal source
for cross-checking, you can point Claude Code’s built-in OTel
exporter at your OpenLit collector instead. Both paths can run side
by side — OpenLit dedupes per session.id (Claude Code’s authoritative
cost / tokens from the native path win, while the hook path provides
the repository / working folder context that Claude Code itself
can’t see).4. Verify
Run any short coding-agent session, then refresh/agents in your
OpenLit UI. You should see a new row labelled with the vendor and a
“Coding” badge. Click in for the dedicated Overview / Sessions /
Dashboard tabs.
What gets captured
Privacy & governance
- Tier-1 redaction runs on every export and scrubs API keys, tokens, and known secret patterns without breaking JSON structure.
- Personal vs Work classification is stamped at hook time using
the org’s API-key and repo-origin allowlists (configured in OpenLit
Settings). Disputes can be filed via
POST /api/coding-agents/classification/dispute; surfacing a dispute button on the Sessions tab is planned for the next release. - k=5 cohort floor: viewer-tier accounts cannot see per-user attribution below five sessions. Admins can.
Stop tracking / uninstall
The inverse ofopenlit coding install. Removes the per-vendor host
plugin manifests written by install, deregisters the plugin from the
vendor’s own CLI where applicable (Claude Code, Codex), and leaves
your shared config alone by default so you can re-onboard without
re-entering credentials.
The
openlit binary itself is not touched. Uninstall it the way
you installed it:
Troubleshooting
- First stop — run
openlit doctor. It prints the resolved config, the cached session count, the installed plugin paths, and TCP-dials your OTLP endpoint. Exit code 1 means at least one failure; 0 (possibly with warnings) means the CLI is wired up. - No row on /agents — the hook never writes to a log file; it
emits to stderr, which is captured by the host coding agent’s
own logs (Claude Code:
~/.claude/logs/; Cursor: Developer Tools → Console; Codex:~/.codex/). SetOPENLIT_DEBUG_PAYLOAD_DIR=/tmp/openlit-debugto capture the exact JSON the vendor is sending the hook — useful when fields appear to be missing on the resulting spans. - Hooks ran but no spans — confirm
openlit configure --showreports the right endpoint. The CLI never reads~/.zshrc; if you set OPENLIT_* in your shell rc, source it before launching the agent. - “Database config not found” on /agents — your OpenLit
installation hasn’t run the latest migrations. Restart the
openlitcontainer or run the migration manually (pnpm --filter client run migrate).
What’s next
- The CLI reserves subcommands for
prompts,traces, andeval; these will light up in subsequent releases without breaking the coding-agent integration.

