GitHub Copilot CLI Data Source (Beta)
GitHub Copilot CLI support is experimental. The adapter reads local OpenTelemetry JSONL files only.
ccusage can read GitHub Copilot CLI OpenTelemetry file exports as one of its supported local data sources. It uses the same reporting experience as the rest of ccusage: responsive tables, JSON output, LiteLLM-based pricing, cache token accounting, and all-source aggregation.
Focused Views
bunx ccusage copilot --helpnpx ccusage@latest copilot --helppnpm dlx ccusage copilot --helpData Source
The CLI reads Copilot OpenTelemetry JSONL files from ~/.copilot/otel/*.jsonl and also includes the explicit file pointed to by COPILOT_OTEL_FILE_EXPORTER_PATH.
export COPILOT_OTEL_ENABLED=true
export COPILOT_OTEL_EXPORTER_TYPE=file
mkdir -p "$HOME/.copilot/otel"
export COPILOT_OTEL_FILE_EXPORTER_PATH="$HOME/.copilot/otel/copilot-otel-$(date +%Y%m%d-%H%M%S).jsonl"~/.copilot/
└── otel/
└── *.jsonlReport Views
| Focused view | Description | See also |
|---|---|---|
ccusage copilot daily | Aggregate usage by date | Daily Usage |
ccusage copilot monthly | Aggregate usage by month | Monthly Usage |
ccusage copilot session | Group usage by Copilot session IDs | Session Usage |
These views support --json for structured output, --compact for narrow terminals, and --offline for cached pricing data.
What Gets Calculated
- Token usage - chat spans are preferred, with inference logs and agent-turn logs used as fallbacks.
- Cache tokens - cache read and cache creation token attributes are counted when present.
- Reasoning tokens - reasoning output tokens are included in total tokens and cost calculation.
- Pricing - costs are calculated from LiteLLM pricing data using the reported model name.
Environment Variables
| Variable | Description |
|---|---|
COPILOT_OTEL_FILE_EXPORTER_PATH | Explicit Copilot OpenTelemetry JSONL file to include |
LOG_LEVEL | Adjust verbosity (0 silent ... 5 trace) |
Troubleshooting
No Copilot usage data found
Ensure OpenTelemetry file export is enabled and the exporter path points to an existing .jsonl file, or place exported .jsonl files under ~/.copilot/otel/.
Costs showing as $0.00
If a model is not in LiteLLM's database, the cost will be $0.00. Open an issue to request alias support.