@f6n/copilot-usage
v0.1.2
Published
`@f6n/copilot-usage` is a drop-in wrapper for GitHub Copilot CLI that captures usage data locally while keeping your normal Copilot workflow.
Downloads
42
Readme
@f6n/copilot-usage
@f6n/copilot-usage is a drop-in wrapper for GitHub Copilot CLI that captures usage data locally while keeping your normal Copilot workflow.
Live site: https://copilot-usage.f6n.run
Repository: https://github.com/Ashwinning/copilot-usage
What This App Does
- Runs native
copilotwith your same flags and interactive behavior - Installs and maintains a repo session-end hook at
.github/hooks/f6n-copilot-usage.jsonwhen inside a Git repo - Falls back to direct latest-session capture when run outside a Git repo
- Captures usage into local JSONL files so you can inspect usage history later
- Supports prompt-mode fallback capture (
-p/--prompt) from Copilot terminal output
No cloud service is required. Data stays on your machine.
How It Works
- You run
bunx @f6n/copilot-usage(instead ofcopilot). - In Git repos, the wrapper ensures the hook file exists in your current repository.
- Copilot runs normally.
- On session end, the hook invokes
--f6n-store-sessionand stores usage from latest Copilot events. When not in a Git repo, the wrapper captures from latest Copilot session state directly after the run. - Stored summaries are readable via
--f6n-show-usageand consumable by@f6n/cli-usage.
First-Time Setup (Step by Step)
- Run Copilot through the wrapper:
bunx @f6n/copilot-usage- Confirm hook installation in your repo:
.github/hooks/f6n-copilot-usage.jsonRun at least one Copilot session.
View stored usage:
bunx @f6n/copilot-usage --f6n-show-usage- For combined Codex + Copilot reporting:
bunx @f6n/cli-usageDaily Usage
Interactive session:
bunx @f6n/copilot-usagePrompt mode:
bunx @f6n/copilot-usage -p "explain this file"Show stored data quickly:
bunx @f6n/copilot-usage --f6n-show-usageCLI Flags
Wrapper-only flags (reserved by this tool):
| Flag | What it does |
| --- | --- |
| --f6n-store-session | Internal hook mode: captures latest Copilot session from local state |
| --f6n-show-usage | Prints stored usage table and exits |
| --f6n-state-home <path> | Overrides wrapper state directory |
| --f6n-copilot-home <path> | Overrides Copilot state directory |
All non---f6n* flags are forwarded to native copilot.
What Gets Stored
Default state root:
- Windows:
%USERPROFILE%\.f6n-copilot-usage\ - macOS:
~/Library/Application Support/f6n-copilot-usage/ - Linux:
~/.f6n-copilot-usage/
Files:
usage-summaries.jsonl: captured session/prompt summariessession-archive/*.events.jsonl: archived Copilot events snapshotsstate.json: per-repo hook metadatahook-debug.jsonl: capture/debug stage logs
Copilot home default used for session-state discovery:
$XDG_STATE_HOME/.copilotwhenXDG_STATE_HOMEexists- otherwise
~/.copilot - overridable with
--f6n-copilot-homeorCOPILOT_HOME
Output You Will See
The --f6n-show-usage command prints one auto-selected table:
sessionswhen activity span is under 1 daydailywhen activity span is under 1 monthmonthlyfor longer ranges
Token columns:
InputCachedOutputReasoningTotal
Troubleshooting
- If usage is empty, run a fresh Copilot session through the wrapper and re-check
--f6n-show-usage. - If hook issues are suspected, inspect
hook-debug.jsonl. - If Copilot state is in a non-default location, pass
--f6n-copilot-home <path>. - If state should be isolated per environment, pass
--f6n-state-home <path>.
Relationship to @f6n/cli-usage
@f6n/copilot-usagecaptures and persists Copilot usage@f6n/cli-usagereports combined Codex + Copilot usage in one table
Companion site: https://cli-usage.f6n.run
Development
npm install
npm run build
npm run testRun locally from source:
node dist/cli.js [copilot args...]Links
- Copilot usage website: https://copilot-usage.f6n.run
- Copilot usage repository: https://github.com/Ashwinning/copilot-usage
- f6n.run monorepo: https://github.com/Ashwinning/f6n.run
