See your GitHub Copilot CLI tokens and estimated spend at a glance — right in your terminal.
⚠️ Unofficial. This is a community project and is not affiliated with, endorsed by, or supported by GitHub. It reads the OpenTelemetry traces the GitHub Copilot CLI already emits — nothing more.
A zero-config statusline + local dashboard that turns Copilot CLI's OpenTelemetry traces into a real-time, model-aware view of your token usage and estimated spend — without your data ever leaving your machine.
Prerequisite: update the GitHub Copilot CLI to the latest version first — older releases may not emit the OpenTelemetry spans this tool depends on.
The package is not published to a registry yet. Install it locally from this repository.
git clone https://github.com/devartifex/copilot-cost.git
cd copilot-cost
npm run setup # installs deps, builds, links the `copilot-cost` command, runs install + doctorPrefer manual control? The equivalent steps are
npm install && npm run build && npm link && copilot-cost install.
Then restart your shell and restart copilot. That's it.
The installer configures the Copilot CLI statusline (including the required "experimental": true flag in ~/.copilot/settings.json — the GitHub Copilot CLI gates custom status lines behind that flag), appends an idempotent OpenTelemetry block to your shell profile, and enables local JSONL span output under ~/.copilot/otel/. It does not start the dashboard.
Prefer to edit your shell profile yourself? Run copilot-cost install --no-otel-profile — the OpenTelemetry block is printed for manual setup.
Verify any time with:
copilot-cost doctorThree styles, controlled by COPILOT_COST_FORMAT:
| Format | Aliases | Example |
|---|---|---|
standard |
default | $1.2522 · 1.5M in / 7.9k out · 1.5M cache |
compact |
minimal |
$1.2522 |
full |
verbose |
$1.2522 (125.22 aic) · 38.4k fresh / 1.4M cache rd / 62.1k cache wr / 7.9k out · Σ 1.5M · 1.6k reason |
export COPILOT_COST_FORMAT=compactOther knobs:
COPILOT_COST_NO_COLOR=1(orNO_COLOR=1) — plain output.COPILOT_COST_COLOR=<ansi-code>— change the statusline color.COPILOT_COST_HIDE_ZERO=1— hide the zeroed placeholder shown before the first response.
copilot-cost dashboardBinds to 127.0.0.1 by default and shows lifetime / today / week / month totals, token & cost trends, per-session and per-model breakdowns, pricing status, setup health, and CSV export.
| ☀️ Light | 🌙 Dark |
|---|---|
![]() |
![]() |
Use --port, --host 127.0.0.1, or --no-open as needed.
- 🔭 Zero-blindspot — cost and tokens visible on every prompt, not at the end of the month.
- 🔌 OpenTelemetry-native — no monkey-patching, no proxy, no auth.
- 🔒 100% local — usage data never leaves your machine; the dashboard binds only to
127.0.0.1. - 🧠 Model-aware — separate accounting for input / output / cached / reasoning tokens.
- 🪶 Lightweight — no runtime database, no daemon, no analytics.
The Copilot CLI has built-in OpenTelemetry instrumentation. With a few env vars set, every prompt, tool call, and model response is recorded as a trace span — including token counts and the model that handled it.
GitHub Copilot CLI ──OTel spans (JSONL)──▶ ~/.copilot/otel/copilot-otel.jsonl
│ tail + parse
┌───────────────────────────┴───────────────────────────┐
▼ ▼
statusline (render) dashboard (local web UI)
- Capture — the installer adds three env vars so the Copilot CLI writes spans to a JSONL file:
export COPILOT_OTEL_ENABLED=true export COPILOT_OTEL_EXPORTER_TYPE=file export COPILOT_OTEL_FILE_EXPORTER_PATH="$HOME/.copilot/otel/copilot-otel.jsonl"
- Aggregate — on every render, recent spans are read,
gen_ai.usage.*counters andgen_ai.request.modelare extracted, and rolled up by session / model / day. - Price — token counts are multiplied by a bundled pricing snapshot (refreshable from Copilot models & pricing) to produce an estimated USD cost.
- Render — a one-line statusline, plus an optional local web dashboard.
More on the underlying telemetry pipeline: Copilot OpenTelemetry observability.
- ✅ Usage data stays on your machine.
- ✅ The dashboard only supports local binds (
127.0.0.1orlocalhost). - ✅ This package emits no telemetry or analytics of its own.
- 🌐 Pricing refresh contacts
docs.github.comonly when requested or when the cache needs refreshing.
| Command | What it does |
|---|---|
render |
Render the statusline from Copilot CLI status JSON on stdin (default command). |
install [--yes] [--no-otel-profile] |
Install the statusline and (unless opted out) append local OpenTelemetry shell profile settings. |
uninstall [--yes] |
Remove settings installed by this package when they point at this tool. |
doctor |
Check statusline setup, OpenTelemetry output, pricing, and dashboard readiness. |
dashboard [--port <n>] [--host <h>] [--no-open] |
Serve the local dashboard. |
refresh-pricing [--force] |
Refresh model pricing; --force bypasses the cache TTL. |
- The statusline does not appear. Run
copilot-cost doctor. The custom statusline requires"experimental": truein~/.copilot/settings.json— without it the GitHub Copilot CLI ignores thestatusLineblock entirely (its logs showSTATUS_LINE: false). Re-runningcopilot-cost installsets both keys; then restart Copilot CLI. - No usage shows up yet. Make sure you're on the latest Copilot CLI, restart your shell and
copilot, send a prompt, then check for JSONL files in~/.copilot/otel/. - I do not want profile edits. Use
copilot-cost install --no-otel-profileand paste the printed OpenTelemetry block into the shell profile you choose. - The dashboard will not bind. Use a local host only, e.g.
copilot-cost dashboard --host 127.0.0.1 --port 4567. - Pricing looks stale. Run
copilot-cost refresh-pricing --force.
npm install
npm test
npm run buildCHANGELOG.md— release notes.- GitHub Copilot CLI docs · Copilot OpenTelemetry observability · Copilot models & pricing
📄 MIT — see LICENSE. Not affiliated with GitHub.


