feat: Add npx CLI package for Copilot token usage analysis#433
Draft
feat: Add npx CLI package for Copilot token usage analysis#433
Conversation
…ommands Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
…s, test validation Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
rajbos
March 19, 2026 12:37
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standalone CLI (
copilot-token-tracker-cli) publishable to npmjs.org that reuses the extension's session discovery, parsing, token estimation, maturity scoring, and usage analysis modules without modifying them.CLI Package (
cli/)stats— Files, sessions, chat turns, tokens; breakdown by editor sourceusage— Token usage by period (today/month/last month/30d) with optional per-model and cost breakdownsenvironmental— CO₂, water, tree-offset estimates with real-world context comparisonsfluency— Copilot Fluency Score across all 6 categories with optional improvement tipscli/src/vscode-stub.tssosessionDiscovery.tsandopencode.tsimports resolve cleanlyopencode.db#ses_<id>) handled via dedicatedstatSessionFile()helperdist/cli.js(~415KB) targeting Node 18+Root integration
cli:build,cli:stats,cli:usage,cli:environmental,cli:fluency,clinpm scriptscli/from roottsconfig.jsonto avoidrootDirconflictsWorkflows
cli-build.yml— Validates build + all commands on Node 18/20/22, triggered on changes tocli/or shared source modulescli-publish.yml—workflow_dispatchwith version bump selector (patch/minor/major) and dry-run option; requiresNPM_TOKENsecret